CC-2611: Airtime-import: support relative path for directories

- fixed
This commit is contained in:
James 2011-07-28 10:47:57 -04:00
parent 8187a5504b
commit 5fb9207c7b
1 changed files with 12 additions and 0 deletions

View File

@ -144,6 +144,10 @@ def WatchAddAction(option, opt, value, parser):
elif(len(parser.rargs) == 0 ):
raise OptionValueError("No argument found. This option requires exactly one argument.")
path = parser.rargs[0]
if (path[0] == "/" or path[0] == "~"):
path = os.path.realpath(path)
else:
path = currentDir+path
path = path.decode('utf-8')
path = path.encode('utf-8')
if(os.path.isdir(path)):
@ -181,6 +185,10 @@ def WatchRemoveAction(option, opt, value, parser):
elif(len(parser.rargs) == 0 ):
raise OptionValueError("No argument found. This option requires exactly one argument.")
path = parser.rargs[0]
if (path[0] == "/" or path[0] == "~"):
path = os.path.realpath(path)
else:
path = currentDir+path
path = path.decode('utf-8')
path = path.encode('utf-8')
if(os.path.isdir(path)):
@ -223,6 +231,10 @@ def StorageSetAction(option, opt, value, parser):
raise OptionValueError("No argument found. This option requires exactly one argument.")
path = parser.rargs[0]
if (path[0] == "/" or path[0] == "~"):
path = os.path.realpath(path)
else:
path = currentDir+path
path = path.decode('utf-8')
path = path.encode('utf-8')
if(os.path.isdir(path)):