-
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.
- Loading branch information
1 parent
b2b3f5f
commit 2e171c9
Showing
5 changed files
with
49 additions
and
17 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -53,4 +53,5 @@ cover/ | |
|
||
# Project specific | ||
settings.json | ||
logs/* | ||
logs/* | ||
testing/* |
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,27 @@ | ||
from file import File | ||
from common.logger import Logger | ||
|
||
class FileAction: | ||
def __init__(self, target_file: File) -> None: | ||
self.target_file = target_file | ||
|
||
def execute(self) -> None: | ||
pass | ||
|
||
class DeleteFileAction(FileAction): | ||
def execute(self) -> None: | ||
self.target_file.delete() | ||
Logger.info(f'Deleting {self.target_file.full_name()}') | ||
|
||
|
||
class FileActionQueue: | ||
def __init__(self) -> None: | ||
self.queue = [] | ||
|
||
def queue_action(self, new_action: FileAction): | ||
self.queue.append(new_action) | ||
return self | ||
|
||
def execute_actions(self): | ||
for action in self.queue: | ||
action.execute() |
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