Пример #1
0
 def realPath(self, path):
     container, obj = obj_to_path(path)
     real_path = '/'
     if container:
         real_path += container
     if obj:
         real_path += '/' + obj
     return real_path
Пример #2
0
 def openForWriting(self, path):
     self.log_command('openForWriting', path)
     fullpath = self._fullpath(path)
     container, obj = obj_to_path(fullpath)
     if not container or not obj:
         raise CmdNotImplementedForArgError(
             'Cannot upload files to root directory.')
     f = SwiftWriteFile(self.swiftfilesystem, fullpath)
     return defer.succeed(f)
Пример #3
0
 def realPath(self, path):
     """ Normalizes a filepath """
     container, obj = obj_to_path(path)
     real_path = '/'
     if container:
         real_path += container
     if obj:
         real_path += '/' + obj
     return real_path
Пример #4
0
 def openForWriting(self, path):
     self.log_command('openForWriting', path)
     fullpath = self._fullpath(path)
     container, obj = obj_to_path(fullpath)
     if not container or not obj:
         raise CmdNotImplementedForArgError(
             'Cannot upload files to root directory.')
     f = SwiftWriteFile(self.swiftfilesystem, fullpath)
     return defer.succeed(f)
Пример #5
0
 def realPath(self, path):
     """ Normalizes a filepath """
     container, obj = obj_to_path(path)
     real_path = '/'
     if container:
         real_path += container
     if obj:
         real_path += '/' + obj
     return real_path