Save work in progress...
This commit is contained in:
@@ -37,6 +37,7 @@ from typing import Dict, List, Optional, Tuple, Union
|
|||||||
|
|
||||||
|
|
||||||
BUFFER_SIZE: int = 256
|
BUFFER_SIZE: int = 256
|
||||||
|
PRINT_STRPAD = '\t\t =>'
|
||||||
|
|
||||||
|
|
||||||
class Telnet:
|
class Telnet:
|
||||||
@@ -499,8 +500,6 @@ class FileSystem(object):
|
|||||||
raise e
|
raise e
|
||||||
|
|
||||||
|
|
||||||
PRINT_PREFIX_EXCEPTION = '\t\t =>'
|
|
||||||
|
|
||||||
class Picowatch(object):
|
class Picowatch(object):
|
||||||
_fs: FileSystem
|
_fs: FileSystem
|
||||||
|
|
||||||
@@ -524,7 +523,7 @@ class Picowatch(object):
|
|||||||
else:
|
else:
|
||||||
print('[:]', name[1:], f'({size}b)')
|
print('[:]', name[1:], f'({size}b)')
|
||||||
else:
|
else:
|
||||||
print('[?]', remote, PRINT_PREFIX_EXCEPTION, exception)
|
print('[?]', remote, PRINT_STRPAD, exception)
|
||||||
|
|
||||||
def contents(self, remote: str):
|
def contents(self, remote: str):
|
||||||
try:
|
try:
|
||||||
@@ -557,9 +556,9 @@ class Picowatch(object):
|
|||||||
|
|
||||||
for filename, remote in queue:
|
for filename, remote in queue:
|
||||||
try:
|
try:
|
||||||
print('[↑]', filename, PRINT_PREFIX_EXCEPTION, self._fs.upload(filename, remote))
|
print('[↑]', filename, PRINT_STRPAD, self._fs.upload(filename, remote))
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print('[?]', filename, PRINT_PREFIX_EXCEPTION, str(e))
|
print('[?]', filename, PRINT_STRPAD, str(e))
|
||||||
|
|
||||||
def download(self, filepath: str):
|
def download(self, filepath: str):
|
||||||
if filepath.startswith('.'):
|
if filepath.startswith('.'):
|
||||||
@@ -577,11 +576,11 @@ class Picowatch(object):
|
|||||||
|
|
||||||
if not size == -1:
|
if not size == -1:
|
||||||
try:
|
try:
|
||||||
print('[↓]', local, PRINT_PREFIX_EXCEPTION, self._fs.download(remote, local))
|
print('[↓]', local, PRINT_STRPAD, self._fs.download(remote, local))
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print('[?]', local, PRINT_PREFIX_EXCEPTION, str(e))
|
print('[?]', local, PRINT_STRPAD, str(e))
|
||||||
else:
|
else:
|
||||||
print('[?]', filepath, PRINT_PREFIX_EXCEPTION, exception)
|
print('[?]', filepath, PRINT_STRPAD, exception)
|
||||||
|
|
||||||
def delete(self, filepath: str):
|
def delete(self, filepath: str):
|
||||||
status, output, exception = self._fs.rm(filepath)
|
status, output, exception = self._fs.rm(filepath)
|
||||||
@@ -593,9 +592,9 @@ class Picowatch(object):
|
|||||||
if checked:
|
if checked:
|
||||||
print('[-]', local)
|
print('[-]', local)
|
||||||
else:
|
else:
|
||||||
print('[?]', local, PRINT_PREFIX_EXCEPTION, message)
|
print('[?]', local, PRINT_STRPAD, message)
|
||||||
else:
|
else:
|
||||||
print('[?]', filepath, PRINT_PREFIX_EXCEPTION, exception)
|
print('[?]', filepath, PRINT_STRPAD, exception)
|
||||||
|
|
||||||
def launch(self, filepath: str):
|
def launch(self, filepath: str):
|
||||||
self._fs.launch(filepath)
|
self._fs.launch(filepath)
|
||||||
|
|||||||
Reference in New Issue
Block a user