SeattleTestbed / seash

Interactive vessel management tool
MIT License
0 stars 10 forks source link

uploaddir module should treat sub-dirs gracefully #88

Closed aaaaalbert closed 9 years ago

aaaaalbert commented 9 years ago

Currently, if a directory-to-be-uploaded using uploaddir contains further subdirs, uploaddir will return this error on encounter and not continue with the rest the "normal" files contained in the desired source directory:

albert@browsegood !> uploaddir ../../SensibilityTestbed/sensorlib
Uploading '../../SensibilityTestbed/sensorlib/.git'...
Traceback (most recent call last):
  File "seash.py", line 261, in command_loop
  File "/Users/albert/Downloads/sensibility-testbed-demokit-20150409-1731/seash_dictionary.py", line 2109, in command_dispatch
  File "/Users/albert/Downloads/sensibility-testbed-demokit-20150409-1731/modules/uploaddir/__init__.py", line 93, in upload_directory_contents
  File "/Users/albert/Downloads/sensibility-testbed-demokit-20150409-1731/command_callbacks.py", line 1865, in upload_filename
IOError: [Errno 21] Is a directory: '../../SensibilityTestbed/sensorlib/.git'

This is not helpful, unnecessarily hard to work around (remove subdirs, outside of seash!), and doesn't look good either.

We should rather skip subdirs with a nice message such as (Skipping sub-directory '.git'. You may upload it separately.)

aaaaalbert commented 9 years ago

See @XuefengHuang's PR #90 for a possible implementation.

aaaaalbert commented 9 years ago

Fixed via PR #90, thanks!