예제 #1
0
    def run(self, args):
        if not os.path.exists(args.file):
            self.ctx.die(670, "No such file: %s" % args.file)
        else:
            client = self.ctx.conn(args)
            store = SessionsStore()
            srv, usr, uuid = store.get_current()
            props = store.get(srv, usr, uuid)

            from omero.scripts import parse_file
            from omero.util.temp_files import create_path
            path = create_path()
            text = """
omero.host=%(omero.host)s
omero.user=%(omero.sess)s
omero.pass=%(omero.sess)s
            """
            path.write_text(text % props)

            params = parse_file(args.file)
            m = self._parse_inputs(args, params)
            for k, v in m.items():
                if v is not None:
                    client.setInput(k, v)

            p = self.ctx.popen([sys.executable, args.file], stdout=sys.stdout,
                               stderr=sys.stderr, ICE_CONFIG=str(path))
            p.wait()
            if p.poll() != 0:
                self.ctx.die(p.poll(), "Execution failed.")
예제 #2
0
    def run(self, args):
        if not os.path.exists(args.file):
            self.ctx.die(670, "No such file: %s" % args.file)
        else:
            client = self.ctx.conn(args)
            store = SessionsStore()
            srv, usr, uuid = store.get_current()
            props = store.get(srv, usr, uuid)

            from omero.scripts import parse_file
            from omero.util.temp_files import create_path
            path = create_path()
            text = """
omero.host=%(omero.host)s
omero.user=%(omero.sess)s
omero.pass=%(omero.sess)s
            """
            path.write_text(text % props)

            params = parse_file(args.file)
            m = self._parse_inputs(args, params)
            for k, v in m.items():
                if v is not None:
                    client.setInput(k, v)

            p = self.ctx.popen([sys.executable, args.file],
                               stdout=sys.stdout,
                               stderr=sys.stderr,
                               ICE_CONFIG=str(path))
            p.wait()
            if p.poll() != 0:
                self.ctx.die(p.poll(), "Execution failed.")