diff --git a/picowatch_d/picowatch.py b/picowatch_d/picowatch.py index 5b2cc85..1f3e913 100644 --- a/picowatch_d/picowatch.py +++ b/picowatch_d/picowatch.py @@ -37,6 +37,7 @@ from typing import Dict, List, Optional, Tuple, Union BUFFER_SIZE: int = 256 +PRINT_STRPAD = '\t\t =>' class Telnet: @@ -499,8 +500,6 @@ class FileSystem(object): raise e -PRINT_PREFIX_EXCEPTION = '\t\t =>' - class Picowatch(object): _fs: FileSystem @@ -524,7 +523,7 @@ class Picowatch(object): else: print('[:]', name[1:], f'({size}b)') else: - print('[?]', remote, PRINT_PREFIX_EXCEPTION, exception) + print('[?]', remote, PRINT_STRPAD, exception) def contents(self, remote: str): try: @@ -557,9 +556,9 @@ class Picowatch(object): for filename, remote in queue: try: - print('[↑]', filename, PRINT_PREFIX_EXCEPTION, self._fs.upload(filename, remote)) + print('[↑]', filename, PRINT_STRPAD, self._fs.upload(filename, remote)) except Exception as e: - print('[?]', filename, PRINT_PREFIX_EXCEPTION, str(e)) + print('[?]', filename, PRINT_STRPAD, str(e)) def download(self, filepath: str): if filepath.startswith('.'): @@ -577,11 +576,11 @@ class Picowatch(object): if not size == -1: try: - print('[↓]', local, PRINT_PREFIX_EXCEPTION, self._fs.download(remote, local)) + print('[↓]', local, PRINT_STRPAD, self._fs.download(remote, local)) except Exception as e: - print('[?]', local, PRINT_PREFIX_EXCEPTION, str(e)) + print('[?]', local, PRINT_STRPAD, str(e)) else: - print('[?]', filepath, PRINT_PREFIX_EXCEPTION, exception) + print('[?]', filepath, PRINT_STRPAD, exception) def delete(self, filepath: str): status, output, exception = self._fs.rm(filepath) @@ -593,9 +592,9 @@ class Picowatch(object): if checked: print('[-]', local) else: - print('[?]', local, PRINT_PREFIX_EXCEPTION, message) + print('[?]', local, PRINT_STRPAD, message) else: - print('[?]', filepath, PRINT_PREFIX_EXCEPTION, exception) + print('[?]', filepath, PRINT_STRPAD, exception) def launch(self, filepath: str): self._fs.launch(filepath)