CC-2633: added new encode_to()

- added encode_to() to api_client
- replaced .encode() with new encode_to()
This commit is contained in:
James 2011-08-05 14:40:03 -04:00
parent a199585cb9
commit 8995e828ff
10 changed files with 54 additions and 33 deletions

View file

@ -38,9 +38,9 @@ def copy_or_move_files_to(paths, dest, flag):
else:
path = currentDir+path
path = apc.to_unicode(path)
path = path.encode('utf-8')
path = apc.encode_to(path, 'utf-8')
dest = apc.to_unicode(dest)
dest = dest.encode('utf-8')
dest = apc.encode_to(dest, 'utf-8')
if(os.path.exists(path)):
if(os.path.isdir(path)):
path = format_dir_string(path)
@ -148,8 +148,8 @@ def WatchAddAction(option, opt, value, parser):
path = os.path.realpath(path)
else:
path = currentDir+path
path = api_client.apc.to_unicode(path)
path = path.encode('utf-8')
path = apc.to_unicode(path)
path = apc.encode_to(path, 'utf-8')
if(os.path.isdir(path)):
res = api_client.add_watched_dir(path)
if(res is None):
@ -190,7 +190,7 @@ def WatchRemoveAction(option, opt, value, parser):
else:
path = currentDir+path
path = apc.to_unicode(path)
path = path.encode('utf-8')
path = apc.encode_to(path, 'utf-8')
if(os.path.isdir(path)):
res = api_client.remove_watched_dir(path)
if(res is None):
@ -236,7 +236,7 @@ def StorageSetAction(option, opt, value, parser):
else:
path = currentDir+path
path = apc.to_unicode(path)
path = path.encode('utf-8')
path = apc.encode_to(path, 'utf-8')
if(os.path.isdir(path)):
res = api_client.set_storage_dir(path)
if(res is None):