-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for logging to windows NTEventLog
- Loading branch information
Showing
4 changed files
with
17 additions
and
29 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 |
---|---|---|
@@ -1,19 +1,8 @@ | ||
from banker.data.category import Category | ||
from banker.data.transaction import Transaction | ||
from banker.parser.interfaces.categories_parser import ICategoriesParser | ||
from banker.parser.interfaces.transactions_parser import ITransactionsParser | ||
|
||
|
||
def get_parsed_categories(categories_parser: ICategoriesParser, categories_filepath: str) -> list[Category]: | ||
with open(categories_filepath, "r") as file: | ||
return categories_parser.parse_categories(file.read()) | ||
|
||
|
||
def get_parsed_transactions(transactions_parser: ITransactionsParser, transactions_filepath: str) -> list[Transaction]: | ||
with open(transactions_filepath, "r") as transactions_file: | ||
return transactions_parser.parse_transactions(transactions_file.read()) | ||
def read_file(filepath: str) -> str: | ||
with open(filepath, "r", encoding="utf-8") as file: | ||
return file.read() | ||
|
||
|
||
def save_to_file(filepath: str, content: str): | ||
with open(filepath, "w") as file: | ||
with open(filepath, "w", encoding="utf-8") as file: | ||
file.write(content) |
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