Ejemplo n.º 1
0
    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)
Ejemplo n.º 2
0
    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()