Skip to content

Commit

Permalink
Update zakat_tracker.py
Browse files Browse the repository at this point in the history
حذف سطور غير ضرورية في طبقة النموذج
  • Loading branch information
vzool authored Sep 20, 2024
1 parent a47cec0 commit f7f348f
Showing 1 changed file with 0 additions and 45 deletions.
45 changes: 0 additions & 45 deletions zakat/zakat_tracker.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,6 @@ def path(self, path: str = None) -> str:
Returns:
str: The current or new path to the database file.
"""
pass

@abstractmethod
def sub(self, unscaled_value: float | int | Decimal, desc: str = '', account: int = 1, created: int = None,
Expand Down Expand Up @@ -202,7 +201,6 @@ def sub(self, unscaled_value: float | int | Decimal, desc: str = '', account: in
ValueError: The box transaction happened again in the same nanosecond time.
ValueError: The log transaction happened again in the same nanosecond time.
"""
pass

@abstractmethod
def track(self, unscaled_value: float | int | Decimal = 0, desc: str = '', account: int = 1, logging: bool = True,
Expand All @@ -228,7 +226,6 @@ def track(self, unscaled_value: float | int | Decimal = 0, desc: str = '', accou
ValueError: The log transaction happened again in the same nanosecond time.
ValueError: The box transaction happened again in the same nanosecond time.
"""
pass

@abstractmethod
def add_file(self, account: int, ref: int, path: str) -> int:
Expand All @@ -243,7 +240,6 @@ def add_file(self, account: int, ref: int, path: str) -> int:
Returns:
int: The reference of the added file. If the account or transaction log entry does not exist, returns 0.
"""
pass

@abstractmethod
def remove_file(self, account: int, ref: int, file_ref: int) -> bool:
Expand All @@ -258,7 +254,6 @@ def remove_file(self, account: int, ref: int, file_ref: int) -> bool:
Returns:
bool: True if the file reference is successfully removed, False otherwise.
"""
pass

@abstractmethod
def hide(self, account: int, status: bool = None) -> bool:
Expand Down Expand Up @@ -287,7 +282,6 @@ def hide(self, account: int, status: bool = None) -> bool:
>>> tracker.db.hide(1, False)
False
"""
pass

@abstractmethod
def zakatable(self, account: int, status: bool = None) -> bool:
Expand Down Expand Up @@ -316,7 +310,6 @@ def zakatable(self, account: int, status: bool = None) -> bool:
>>> tracker.db.zakatable(1, False)
False
"""
pass

@abstractmethod
def name(self, account: int) -> str | None:
Expand All @@ -329,7 +322,6 @@ def name(self, account: int) -> str | None:
Returns:
str | None: The name associated with the account, or None if not found.
"""
pass

@abstractmethod
def accounts(self) -> dict:
Expand All @@ -342,7 +334,6 @@ def accounts(self) -> dict:
Returns:
dict: A dictionary where keys are account numbers and values are their respective balances.
"""
pass

@abstractmethod
def exchange(self, account: int, created: int = None, rate: float = None, description: str = None,
Expand All @@ -361,7 +352,6 @@ def exchange(self, account: int, created: int = None, rate: float = None, descri
- dict: A dictionary containing the latest exchange rate and its description. If no exchange rate is found,
it returns a dictionary with default values for the rate and description.
"""
pass

@abstractmethod
def exchanges(self, account: int) -> dict | None:
Expand All @@ -374,7 +364,6 @@ def exchanges(self, account: int) -> dict | None:
Returns:
dict | None: A dictionary containing the exchange information if the account exists, otherwise None.
"""
pass

@abstractmethod
def account(self, name: str, ref: int = None) -> tuple[int, str]:
Expand Down Expand Up @@ -405,7 +394,6 @@ def account(self, name: str, ref: int = None) -> tuple[int, str]:
function to update the 'name' field in the corresponding account entry.
5. Finally, the function returns a tuple containing the account number and the associated name.
"""
pass

@abstractmethod
def transfer(self, unscaled_amount: float | int | Decimal, from_account: int, to_account: int, desc: str = '',
Expand All @@ -430,7 +418,6 @@ def transfer(self, unscaled_amount: float | int | Decimal, from_account: int, to
ValueError: The box transaction happened again in the same nanosecond time.
ValueError: The log transaction happened again in the same nanosecond time.
"""
pass

@abstractmethod
def account_exists(self, account: int) -> bool:
Expand All @@ -443,7 +430,6 @@ def account_exists(self, account: int) -> bool:
Returns:
bool: True if the account exists, False otherwise.
"""
pass

@abstractmethod
def steps(self) -> dict:
Expand All @@ -456,7 +442,6 @@ def steps(self) -> dict:
Returns:
dict: A copy of the history of steps taken in the ZakatTracker.
"""
pass

@abstractmethod
def files(self) -> list[dict[str, str | int]]:
Expand All @@ -483,7 +468,6 @@ def files(self) -> list[dict[str, str | int]]:
print(f"Type: {info['type']}, Exists: {info['exists']}, Size: {info['human_readable_size']}")
```
"""
pass

@abstractmethod
def stats(self, ignore_ram: bool = True) -> dict[str, tuple[int, str]]:
Expand Down Expand Up @@ -515,7 +499,6 @@ def stats(self, ignore_ram: bool = True) -> dict[str, tuple[int, str]]:
>>> print(stats['ram'])
(12345, '12.1 KB')
"""
pass

@abstractmethod
def logs(self, account: int) -> dict:
Expand All @@ -529,7 +512,6 @@ def logs(self, account: int) -> dict:
dict: A dictionary containing the logs associated with the given account.
If the account does not exist, an empty dictionary is returned.
"""
pass

@abstractmethod
def boxes(self, account: int) -> dict:
Expand All @@ -543,7 +525,6 @@ def boxes(self, account: int) -> dict:
dict: A dictionary containing the boxes associated with the given account.
If the account does not exist, an empty dictionary is returned.
"""
pass

@abstractmethod
def balance(self, account: int = 1, cached: bool = True) -> int:
Expand All @@ -561,7 +542,6 @@ def balance(self, account: int = 1, cached: bool = True) -> int:
If cached is True, the function returns the cached balance.
If cached is False, the function calculates the balance from the box by summing up the 'rest' values of all box items.
"""
pass

@abstractmethod
def box_size(self, account: int) -> int:
Expand All @@ -574,7 +554,6 @@ def box_size(self, account: int) -> int:
Returns:
int: The size of the box for the given account. If the account does not exist, -1 is returned.
"""
pass

@abstractmethod
def log_size(self, account: int) -> int:
Expand All @@ -587,7 +566,6 @@ def log_size(self, account: int) -> int:
Returns:
int: The size of the log for the given account. If the account does not exist, -1 is returned.
"""
pass

@abstractmethod
def nolock(self) -> bool:
Expand All @@ -597,7 +575,6 @@ def nolock(self) -> bool:
Returns:
bool: True if the vault lock is not set, False otherwise.
"""
pass

@abstractmethod
def lock(self) -> int:
Expand All @@ -607,7 +584,6 @@ def lock(self) -> int:
Returns:
int: The lock ID. This ID can be used to release the lock later.
"""
pass

@abstractmethod
def free(self, lock: int, auto_save: bool = True) -> bool:
Expand All @@ -621,7 +597,6 @@ def free(self, lock: int, auto_save: bool = True) -> bool:
Returns:
bool: True if the lock is successfully released and (optionally) saved, False otherwise.
"""
pass

@abstractmethod
def history(self, status: bool = None) -> bool:
Expand All @@ -634,7 +609,6 @@ def history(self, status: bool = None) -> bool:
Returns:
None
"""
pass

@abstractmethod
def save(self, path: str = None) -> bool:
Expand All @@ -649,7 +623,6 @@ def save(self, path: str = None) -> bool:
Returns:
bool: True if the save operation is successful, False otherwise.
"""
pass

@abstractmethod
def load(self, path: str = None) -> bool:
Expand All @@ -662,7 +635,6 @@ def load(self, path: str = None) -> bool:
Returns:
bool: True if the load operation is successful, False otherwise.
"""
pass

@abstractmethod
def recall(self, dry=True, debug=False) -> bool:
Expand All @@ -676,7 +648,6 @@ def recall(self, dry=True, debug=False) -> bool:
Returns:
bool: True if the operation was successful, False otherwise.
"""
pass

@abstractmethod
def reset(self) -> None:
Expand All @@ -689,7 +660,6 @@ def reset(self) -> None:
Returns:
None
"""
pass

@abstractmethod
def check(self,
Expand All @@ -713,7 +683,6 @@ def check(self,
tuple: A tuple containing a boolean indicating the eligibility for Zakat, a list of brief statistics,
and a dictionary containing the Zakat plan.
"""
pass

@abstractmethod
def zakat(self, report: tuple, parts: Dict[str, Dict | bool | Any] = None, debug: bool = False) -> bool:
Expand All @@ -728,7 +697,6 @@ def zakat(self, report: tuple, parts: Dict[str, Dict | bool | Any] = None, debug
Returns:
bool: True if the zakat calculation is successful, False otherwise.
"""
pass

@abstractmethod
def import_csv_cache_path(self):
Expand All @@ -747,7 +715,6 @@ def import_csv_cache_path(self):
>>> obj.db.import_csv_cache_path()
'/data/reports.import_csv.camel'
"""
pass

@abstractmethod
def daily_logs(self, weekday: WeekDay = WeekDay.Friday, debug: bool = False):
Expand Down Expand Up @@ -828,7 +795,6 @@ def daily_logs(self, weekday: WeekDay = WeekDay.Friday, debug: bool = False):
},
}
"""
pass

@abstractmethod
def export_json(self, path: str = "data.json") -> bool:
Expand All @@ -844,7 +810,6 @@ def export_json(self, path: str = "data.json") -> bool:
Raises:
No specific exceptions are raised by this method.
"""
pass

@abstractmethod
def vault(self) -> dict:
Expand All @@ -858,7 +823,6 @@ def vault(self) -> dict:
Returns:
dict: A copy of the internal vault dictionary.
"""
pass

@abstractmethod
def snapshot(self) -> bool:
Expand All @@ -880,7 +844,6 @@ def snapshot(self) -> bool:
bool: True if a snapshot with the same hash already exists or if the snapshot is successfully created.
False if the snapshot creation fails.
"""
pass

@staticmethod
@abstractmethod
Expand All @@ -891,7 +854,6 @@ def ext() -> str:
Returns:
str: The file extension used by the ZakatTracker class, which is 'camel' or 'sqlite'.
"""
pass

@abstractmethod
def log(self, value: float, desc: str = '', account: int = 1, created: int = None, ref: int = None,
Expand All @@ -916,7 +878,6 @@ def log(self, value: float, desc: str = '', account: int = 1, created: int = Non
Raises:
ValueError: The log transaction happened again in the same nanosecond time.
"""
pass

@abstractmethod
def step(self, action: Action = None, account=None, ref: int = None, file: int = None, value: float = None,
Expand All @@ -936,7 +897,6 @@ def step(self, action: Action = None, account=None, ref: int = None, file: int =
Returns:
- int: The lock time of the recorded action. If no lock was performed, it returns 0.
"""
pass

@abstractmethod
def ref_exists(self, account: int, ref_type: str, ref: int) -> bool:
Expand All @@ -951,7 +911,6 @@ def ref_exists(self, account: int, ref_type: str, ref: int) -> bool:
Returns:
bool: True if the reference exists for the given account and reference type, False otherwise.
"""
pass

@abstractmethod
def box_exists(self, account: int, ref: int) -> bool:
Expand All @@ -965,7 +924,6 @@ def box_exists(self, account: int, ref: int) -> bool:
Returns:
- bool: True if the box exists for the given account and reference, False otherwise.
"""
pass

@abstractmethod
def log_exists(self, account: int, ref: int) -> bool:
Expand All @@ -979,7 +937,6 @@ def log_exists(self, account: int, ref: int) -> bool:
Returns:
bool: True if the transaction log entry exists, False otherwise.
"""
pass

@abstractmethod
def snapshots(self, hide_missing: bool = True, verified_hash_only: bool = False) \
Expand All @@ -995,7 +952,6 @@ def snapshots(self, hide_missing: bool = True, verified_hash_only: bool = False)
- dict[int, tuple[str, str, bool]]: A dictionary where the keys are the timestamps of the snapshots,
and the values are tuples containing the snapshot's hash, path, and existence status.
"""
pass

@abstractmethod
def clean_history(self, lock: int | None = None) -> int:
Expand All @@ -1009,7 +965,6 @@ def clean_history(self, lock: int | None = None) -> int:
Returns:
int: The number of locks cleaned up.
"""
pass


class Helper:
Expand Down

0 comments on commit f7f348f

Please sign in to comment.