Exemplo n.º 1
0
    def build(self, zip_filename=None, config=None):
        sys.path.insert(0, self.tmp_dir)
        self.base_dir = self.tmp_dir
        shutil.copytree(self.project_path, join(self.tmp_dir, self.name))
        for module_path, item in self._find_flows():
            wrapper = FlowWrapper(item, self)
            wrapper.build()

        if exists(join(self.project_path, 'system.properties')):
            shutil.copy(join(self.project_path, 'system.properties'),
                        self.base_dir)

        if zip_filename:
            self.zip_path = zip_filename
        else:
            _, self.zip_path = tempfile.mkstemp('.zip', self.name + '-')

        if config:
            config = deepcopy(config)
            config['project'] = self.name
            with open(join(self.base_dir, 'config.yml'), 'w') as fd:
                yaml.dump(config, fd)

        shutil.make_archive(remove_ext(self.zip_path), 'zip',
                            join(self.base_dir))
Exemplo n.º 2
0
    def build(self, zip_filename=None, config=None):
        sys.path.insert(0, self.tmp_dir)
        self.base_dir = self.tmp_dir
        shutil.copytree(self.project_path, join(self.tmp_dir, self.name))
        for module_path, item in self._find_flows():
            wrapper = FlowWrapper(item, self)
            wrapper.build()

        if exists(join(self.project_path, "system.properties")):
            shutil.copy(join(self.project_path, "system.properties"),
                        self.base_dir)

        if zip_filename:
            self.zip_path = zip_filename
        else:
            _, self.zip_path = tempfile.mkstemp(".zip", self.name + "-")

        if config:
            config = deepcopy(config)
            config["project"] = self.name
            with open(join(self.base_dir, "config.yml"), "w") as fd:
                yaml.dump(config, fd)

        shutil.make_archive(
            remove_ext(self.zip_path),
            "zip",
            join(self.base_dir)
        )
Exemplo n.º 3
0
    def build(self, zip_filename=None, config=None):
        self.base_dir = self.tmp_dir
        shutil.copytree(self.project_path, join(self.tmp_dir, self.name))

        if zip_filename:
            self.zip_path = zip_filename
        else:
            _, self.zip_path = tempfile.mkstemp('.zip', self.name + '-')

        shutil.make_archive(
            remove_ext(self.zip_path),
            'zip',
            join(self.base_dir)
        )
Exemplo n.º 4
0
    def build(self, zip_filename=None, config=None):
        self.base_dir = self.tmp_dir
        shutil.copytree(self.project_path, join(self.tmp_dir, self.name))

        if zip_filename:
            self.zip_path = zip_filename
        else:
            _, self.zip_path = tempfile.mkstemp('.zip', self.name + '-')

        shutil.make_archive(remove_ext(self.zip_path), 'zip',
                            join(self.base_dir))

        sys.stdout.write('{name:<30}{progress:>30}'.format(name=self.name,
                                                           progress='OK'))
        sys.stdout.flush()