-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
adding filtering, more structure, packages and lots of cleanup
- Loading branch information
Showing
8 changed files
with
94 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
from alpha import Alpha | ||
from eurobank import Eurobank | ||
from utils import * | ||
from basebank import BaseBank |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import time | ||
from decimal import * | ||
|
||
FILTER_ALL = lambda row: True | ||
|
||
FILTER_POSITIVE = lambda row: row['amount']>0 | ||
|
||
FILTER_NEGATIVE = lambda row: row['amount']<0 | ||
|
||
class Type: | ||
ROW=1 | ||
CURRENCY=2 | ||
|
||
def format_day(row): | ||
return time.strftime('%d/%m/%Y',row['date']) | ||
|
||
FORMAT_DEFAULT = lambda row, type = Type.ROW: (format_day(row), row['name'], row['amount'], row['description']) if type == Type.ROW else row | ||
|
||
def FORMAT_SUPERSIZE_ME(row, type = Type.ROW): | ||
supersize_me = lambda x: str(Decimal(x)*100) | ||
if type == Type.ROW: | ||
return (format_day(row), row['name'], supersize_me(row['amount']), row['description']) | ||
else: | ||
return supersize_me(row) | ||
|