def makedirs(self, remoteFolder): """ Like os.makedirs remotely. """ if len(remoteFolder) and not self.exists(remoteFolder): log.info('RemotePath.makedirs, path: %s' % remoteFolder) parent = dirname(remoteFolder) # if have parent and it doen't exist, create it recursively if len(parent) and not self.exists(parent): self.makedirs(parent) self.sftp.mkdir(remoteFolder)
def makeFilePath(self, *remoteFiles): """ Create the remote folder path for remoteFiles. """ self.makePath(*[dirname(r) for r in remoteFiles])