Skip to content
This repository has been archived by the owner on Sep 5, 2022. It is now read-only.

Commit

Permalink
Refactor classes in 'Command' design pattern
Browse files Browse the repository at this point in the history
* Add new base class `Receiver`
* Add class `Shopkonfigurator`
* Create dedicated class modules, preventing circular imports
* Adjust wiring of module `database` to new specs
* Improve method `match_payments` in classes `Paypal` & `Volksbank`
* Reinstate `contacts` & `ranking` methods
* Remove regex config options
* Move regex to class `Invoice`
* Fix method `invoice2number` & invoice regex
  • Loading branch information
S1SYPHOS authored May 25, 2021
1 parent 795b94f commit ad89256
Show file tree
Hide file tree
Showing 17 changed files with 809 additions and 608 deletions.
11 changes: 0 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,6 @@ verbose = off # Enable verbose mode
data_dir = ~/.local/share/knv-cli # database directory
import_dir = ./imports # files to be processed & imported to database
export_dir = ./dist # generated spreadsheets & graphs

# Regexes for import files
[regexes]
# (1) .. exported by PayPal™
payment_regex = Download*.CSV
# (2) .. exported by Volksbank
volksbank_regex = Umsaetze_*_*.csv
# (3) .. exported by Shopkonfigurator
order_regex = Orders_*.csv
info_regex = OrdersInfo_*.csv
invoice_regex = *_Invoices_TimeFrom*_TimeTo*.pdf
```

As you can see, many config options refer to the directory from which `knvcli` is being called.
Expand Down
12 changes: 10 additions & 2 deletions knv_cli/__init__.py
Original file line number Diff line number Diff line change
@@ -1,21 +1,29 @@
from .gateways.payments import Payments
from .gateways.paypal import Paypal
from .gateways.volksbank import Volksbank
from .knv.shopkonfigurator import Orders, Infos

from .knv.infos import Infos
from .knv.invoices import Invoices
from .utils import dedupe, group_data
from .knv.orders import Orders
from .knv.shopkonfigurator import Shopkonfigurator

from .utils import build_path, dedupe, group_data


__all__ = [
# KNV data sources
'Shopkonfigurator',
'Orders',
'Infos',
'Invoices',

# Payment gateways
'Payments',
'Paypal',
'Volksbank',

# Utilities
'build_path',
'dedupe',
'group_data'
]
113 changes: 0 additions & 113 deletions knv_cli/base.py

This file was deleted.

Loading

0 comments on commit ad89256

Please sign in to comment.