CC-2545:Airtime-import doesn't handle spaces in file/dir names

- fixed
This commit is contained in:
James 2011-07-14 10:03:04 -04:00
parent 1736675464
commit f0cc6614d9
1 changed files with 6 additions and 0 deletions

View File

@ -35,6 +35,7 @@ def copy_or_move_files_to(paths, dest, flag):
for path in paths: for path in paths:
if(os.path.exists(path)): if(os.path.exists(path)):
if(os.path.isdir(path)): if(os.path.isdir(path)):
path = format_dir_string(path)
#construct full path #construct full path
sub_path = [] sub_path = []
for temp in os.listdir(path): for temp in os.listdir(path):
@ -54,6 +55,11 @@ def copy_or_move_files_to(paths, dest, flag):
else: else:
print "Cannot find file or path: %s" % path print "Cannot find file or path: %s" % path
def format_dir_string(path):
if(path[-1] != '/'):
path = path+'/'
return path
def helper_get_stor_dir(): def helper_get_stor_dir():
res = api_client.list_all_watched_dirs() res = api_client.list_all_watched_dirs()
if(res is None): if(res is None):