Browse Source

Make file listing use correctly the uploader.file_list method.

Godzil 6 years ago
parent
commit
ce4356049d
2 changed files with 6 additions and 2 deletions
  1. 6 1
      nodemcu_uploader/main.py
  2. 0 1
      nodemcu_uploader/uploader.py

+ 6 - 1
nodemcu_uploader/main.py

@@ -85,11 +85,16 @@ def operation_download(uploader, sources):
         raise Exception('You must specify a destination filename for each file you want to download.')
     log.info('All done!')
 
+def operation_list(uploader):
+    """List file on target"""
+    files = uploader.file_list()
+    for f in files:
+        log.info("{file:30s} {size}".format(file=f[0], size=f[1]))
 
 def operation_file(uploader, cmd, filename=''):
     """File operations"""
     if cmd == 'list':
-        uploader.file_list()
+        operation_list(uploader)
     if cmd == 'do':
         for path in filename:
             uploader.file_do(path)

+ 0 - 1
nodemcu_uploader/uploader.py

@@ -407,7 +407,6 @@ class Uploader(object):
         """list files on the device"""
         log.info('Listing files')
         res = self.__exchange(LIST_FILES)
-        log.info(res)
         res = res.split('\r\n')
         # skip first and last lines
         res = res[1:-1]