dirs can't end in slash for dropbox "exists" method part of #114

This commit is contained in:
Rob Weber 2017-12-08 08:46:12 -06:00
parent 588132c8dc
commit e02245e422

View File

@ -188,7 +188,7 @@ class DropboxFileSystem(Vfs):
def exists(self,aFile): def exists(self,aFile):
aFile = self._fix_slashes(aFile) aFile = self._fix_slashes(aFile)
utils.log('check exists:' + aFile)
if(self.client != None): if(self.client != None):
#can't list root metadata #can't list root metadata
if(aFile == ''): if(aFile == ''):
@ -232,9 +232,14 @@ class DropboxFileSystem(Vfs):
def _fix_slashes(self,filename): def _fix_slashes(self,filename):
result = filename.replace('\\','/') result = filename.replace('\\','/')
#root needs to be a blank string
if(result == '/'): if(result == '/'):
result = "" result = ""
#if dir ends in slash, remove it
if(result[-1:] == "/"):
result = result[:-1]
return result return result