Skip to content

Commit

Permalink
إضافة شعار للواجهة المظلمة
Browse files Browse the repository at this point in the history
  • Loading branch information
vzool committed Jun 23, 2024
1 parent 18c91de commit a2802d2
Show file tree
Hide file tree
Showing 8 changed files with 88 additions and 6 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# This workflow will install Python dependencies, run tests, and lint with a variety of Python versions
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python

name: Python package

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

jobs:
build:

runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11", "3.12"]

steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
pip install --upgrade pip
pip install wheel
pip install setuptools
pip install twine
pip install pytest==8.2.2
pip install pytest-runner==6.0.1
- name: Test with pytest
run: |
pytest
7 changes: 6 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,9 @@ venv
dist
build
*.egg-info
.eggs
.eggs
*.csv
*.pickle
tmp
*.json
*.pyc
33 changes: 33 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
.PHONY: init
# init development
init:
python3 -m venv venv

.PHONY: deps
# deps development
deps:
pip install --upgrade pip
pip install wheel
pip install setuptools
pip install twine
pip install pytest==8.2.2
pip install pytest-runner==6.0.1

# show help
help:
@echo ''
@echo 'Usage:'
@echo ' make [target]'
@echo ''
@echo 'Targets:'
@awk '/^[a-zA-Z\-0-9]+:/ { \
helpMessage = match(lastLine, /^# (.*)/); \
if (helpMessage) { \
helpCommand = substr($$1, 0, index($$1, ":")-1); \
helpMessage = substr(lastLine, RSTART + 2, RLENGTH); \
printf "\033[36m%-22s\033[0m %s\n", helpCommand,helpMessage; \
} \
} \
{ lastLine = $$0 }' $(MAKEFILE_LIST)

.DEFAULT_GOAL := help
2 changes: 1 addition & 1 deletion README.ar.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<div align="center" style="text-align: center;">

![Zakat Tracker Logo](images/logo.png)
![Zakat Tracker Logo](images/logo.jpg)

<div dir="rtl">

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<div align="center" style="text-align: center;">

![Zakat Tracker Logo](images/logo.png)
![Zakat Tracker Logo](images/logo.jpg)

# ZakatTracker: A Python Library for Islamic Financial Management

Expand Down
Binary file added images/logo.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions tests/test_zakat_tracker.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import pytest
from zakat import ZakatTracker

def test_zakat_tracker():
ledger = ZakatTracker("test.pickle")
ledger.test(True)
7 changes: 4 additions & 3 deletions zakat/zakat_tracker.py
Original file line number Diff line number Diff line change
Expand Up @@ -1048,9 +1048,10 @@ def load(self, _path: str = None) -> bool:
"""
if _path is None:
_path = self.path()
with open(_path, "rb") as f:
self._vault = pickle.load(f)
return True
if os.path.exists(_path):
with open(_path, "rb") as f:
self._vault = pickle.load(f)
return True
return False

def import_csv(self, _path: str = 'file.csv') -> tuple:
Expand Down

0 comments on commit a2802d2

Please sign in to comment.