def configure(self, opts, args): IRODSClientController.configure(self, opts, args) if not args: sys.exit(0) # If the last path element isn't local it might be remote if not filepath.FilePath(args[-1]).exists(): dest = args.pop() if not risabs(dest): dest = rnormpath(rjoin(self.config.irodsCwd, str(dest))) self.dest = dest else: self.dest = self.config.irodsCwd self.paths = [] for path in args: fp = filepath.FilePath(path) if fp.isdir(): if not opts.recursive: log.err("omitting directory `%s'" % path) continue if fp.exists(): self.paths.append(fp) else: log.err("omitting directory `%s'" % path)
def configure(self, opts, args): IRODSClientController.configure(self, opts, args) self.paths = list(set(args)) self.paths.sort() if not args: self.paths.append(self.config.irodsCwd)
def parseArguments(self, optp): optp.add_option("-r", "--recursive", action='append_const', const='recursive', dest="flags", default=[], help="copy directories recursively") optp.add_option("-f", "--force", action='append_const', const='force', dest="flags", default=[], help="force deletion of files, skipping trash") IRODSClientController.parseArguments(self, optp)
def configure(self, opts, args): IRODSClientController.configure(self, opts, args) self.paths = [] for path in args: if rpath.isabs(path): self.paths.append(path) else: self.paths.append(rpath.normpath( rpath.join(self.config.irodsCwd, path)))
def configure(self, opts, args): IRODSClientController.configure(self, opts, args) if args: path = args[0] else: path = self.config.irodsHome if rpath.isabs(path): self.path = path else: self.path = rpath.normpath(rpath.join(self.config.irodsCwd, path))
def configure(self, opts, args): IRODSClientController.configure(self, opts, args) pwd = self.config.irodsCwd self.paths = [] for path in args: if rpath.isabs(path): self.paths.append(path) else: self.paths.append(rpath.normpath( rpath.join(self.config.irodsCwd, path))) if not self.paths: sys.exit(0) self.flags = dict.fromkeys(opts.flags, 1)
def configure(self, opts, args): IRODSClientController.configure(self, opts, args) self.paths = [] for path in args: if risabs(path): self.paths.append(path) else: self.paths.append(rnormpath(rjoin(self.config.irodsCwd, path))) if not self.paths: sys.exit(0) # TODO still need to handle the case where there is one argument and # it has the same name as a local file. # If the last path element is local it might be the dest if filepath.FilePath(args[-1]).exists(): dest = self.paths.pop() if not isabs(dest): dest = normpath(join(os.getcwd(), dest)) self.dest = dest else: self.dest = os.getcwd()
def parseArguments(self, optp): optp.add_option("-r", "--recursive", action='store_true', help="copy directories recursively") IRODSClientController.parseArguments(self, optp)
def configure(self, opts, args): IRODSClientController.configure(self, opts, args) pwd = self.config.irodsCwd self.rm_path = path.join(pwd, args[0])