-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improved formatting and method/class docstrings.
- Applied strict typing to method/class params lacking typing. Signed-off-by: schlopp96 <[email protected]>
- Loading branch information
Showing
4 changed files
with
78 additions
and
44 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 |
---|---|---|
@@ -1,32 +1,35 @@ | ||
from msvcrt import getch | ||
|
||
from PyFiTransfer.appevents.events import Events, exprogram, logger | ||
from PyFiTransfer.appevents.events import events, exit_program, logger | ||
|
||
|
||
def CLI_loop() -> None: | ||
"""CLI program event loop. | ||
--- | ||
:return: run CLI program. | ||
:rtype: None | ||
""" | ||
origin: str = Events._get_src_dir() | ||
|
||
origin: str = events._get_src_dir() | ||
logger.info(f'Got containing directory:\n>> "{origin}"\n') | ||
|
||
targetDir: str = Events._get_dest_dir() | ||
targetDir: str = events._get_dest_dir() | ||
logger.info(f'Got target destination:\n>> "{targetDir}"\n') | ||
|
||
fileExt: str = Events._get_ext() | ||
fileExt: str = events._get_ext() | ||
logger.info( | ||
f'Got extension of files to be transferred:\n>> ".{fileExt}"\n') | ||
|
||
if Events._verify_dir(origin) and Events._verify_dir(targetDir): | ||
if events._verify_dir(origin) and events._verify_dir(targetDir): | ||
logger.info("Starting file transfer...\n") | ||
|
||
if not Events.transfer(origin, targetDir, fileExt): | ||
if not events.transfer(origin, targetDir, fileExt): | ||
print('Press any key to exit...') | ||
getch() | ||
return exprogram.error("File transfer failed!") | ||
return exit_program.error("File transfer failed!") | ||
print('Press any key to exit...') | ||
getch() | ||
return exprogram.success() | ||
return exprogram.error(f'No files found with extension: "{fileExt}"') | ||
return exit_program.success() | ||
return exit_program.error(f'No files found with extension: "{fileExt}"') |
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