示例#1
0
def copy_supporting_files(start_path, destination):
    for file in list_files(start_path):
        if not (file.startswith("_") or file.startswith(".")):
            print("copying: %s to: %s" % (file, destination))
            copy_file(path.join(start_path, file), path.join(destination, file))

    for dir in list_dirs(start_path):
        if not (dir.startswith("_") or dir.startswith(".")):
            print("copying: %s to: %s" % (dir, destination))
            copy_tree(path.join(start_path, dir), path.join(destination, dir))
示例#2
0
 def prepare(self, values):
     """ apply templates to all the .sb_template files and build the
     fix_perms.sh script from the permissions file"""
     values.update(self.cfg['pxe'])
     utils.rmtree(self.dst)
     utils.copy_tree(self.path, self.dst)
     for root, _, files in os.walk(self.dst):
         for file_name in files:
             if file_name.endswith('.sb_template'):
                 file_name = os.path.join(root, file_name)
                 utils.write_template(values, file_name)
                 utils.file_move(file_name, os.path.splitext(file_name)[0])
示例#3
0
 def prepare(self, values):
     """ apply templates to all the .sb_template files and build the
     fix_perms.sh script from the permissions file"""
     values.update(self.cfg['pxe'])
     utils.rmtree(self.dst)
     utils.copy_tree(self.path, self.dst)
     for root, _, files in os.walk(self.dst):
         for file_name in files:
             if file_name.endswith('.sb_template'):
                 file_name = os.path.join(root, file_name)
                 utils.write_template(values, file_name)
                 utils.file_move(file_name, os.path.splitext(file_name)[0])
示例#4
0
    def gen_task_copy_files(**kw):
        """Copy static files into the output folder.

        required keyword arguments:

        output_folder
        """

        # TODO: make the path for files configurable?
        src = os.path.join("files")
        dst = kw["output_folder"]
        flag = False
        for task in utils.copy_tree(src, dst):
            flag = True
            task["basename"] = "copy_files"
            task["uptodate"] = task.get("uptodate", []) + [config_changed(kw)]
            yield task
        if not flag:
            yield {"basename": "copy_files", "actions": ()}
示例#5
0
文件: nikola.py 项目: svankie/nikola
    def gen_task_copy_files(**kw):
        """Copy static files into the output folder.

        required keyword arguments:

        output_folder
        files_folders
        """

        flag = False
        for src in kw["files_folders"]:
            dst = kw["output_folder"]
            real_dst = os.path.join(dst, kw["files_folders"][src])
            for task in utils.copy_tree(src, real_dst, link_cutoff=dst):
                flag = True
                task["basename"] = "copy_files"
                task["uptodate"] = task.get("uptodate", []) + [config_changed(kw)]
                yield task
        if not flag:
            yield {"basename": "copy_files", "actions": ()}
示例#6
0
文件: nikola.py 项目: svankie/nikola
    def gen_task_copy_assets(**kw):
        """Create tasks to copy the assets of the whole theme chain.

        If a file is present on two themes, use the version
        from the "youngest" theme.

        Required keyword arguments:

        themes
        output_folder

        """
        tasks = {}
        for theme_name in kw["themes"]:
            src = os.path.join(utils.get_theme_path(theme_name), "assets")
            dst = os.path.join(kw["output_folder"], "assets")
            for task in utils.copy_tree(src, dst):
                if task["name"] in tasks:
                    continue
                tasks[task["name"]] = task
                task["uptodate"] = task.get("uptodate", []) + [config_changed(kw)]
                task["basename"] = "copy_assets"
                yield task
示例#7
0
文件: nikola.py 项目: allfayn/nikola
    def gen_task_copy_assets(**kw):
        """Create tasks to copy the assets of the whole theme chain.

        If a file is present on two themes, use the version
        from the "youngest" theme.

        Required keyword arguments:

        themes
        output_folder

        """
        tasks = {}
        for theme_name in kw['themes']:
            src = os.path.join(utils.get_theme_path(theme_name), 'assets')
            dst = os.path.join(kw['output_folder'], 'assets')
            for task in utils.copy_tree(src, dst):
                if task['name'] in tasks:
                    continue
                tasks[task['name']] = task
                task['uptodate'] = task.get('uptodate', []) + \
                    [config_changed(kw)]
                task['basename'] = 'copy_assets'
                yield task
示例#8
0
文件: nikola.py 项目: allfayn/nikola
    def gen_task_copy_files(**kw):
        """Copy static files into the output folder.

        required keyword arguments:

        output_folder
        files_folders
        """

        flag = False
        for src in kw['files_folders']:
            dst = kw['output_folder']

            for task in utils.copy_tree(src, os.path.join(dst, src)):
                flag = True
                task['basename'] = 'copy_files'
                task['uptodate'] = task.get('uptodate', []) +\
                    [config_changed(kw)]
                yield task
        if not flag:
            yield {
                'basename': 'copy_files',
                'actions': (),
            }
示例#9
0
    def gen_task_copy_files(**kw):
        """Copy static files into the output folder.

        required keyword arguments:

        output_folder
        files_folders
        """

        flag = False
        for src in kw['files_folders']:
            dst = kw['output_folder']

            for task in utils.copy_tree(src, os.path.join(dst, src)):
                flag = True
                task['basename'] = 'copy_files'
                task['uptodate'] = task.get('uptodate', []) +\
                    [config_changed(kw)]
                yield task
        if not flag:
            yield {
                'basename': 'copy_files',
                'actions': (),
            }
示例#10
0
    def gen_task_copy_assets(**kw):
        """Create tasks to copy the assets of the whole theme chain.

        If a file is present on two themes, use the version
        from the "youngest" theme.

        Required keyword arguments:

        themes
        output_folder

        """
        tasks = {}
        for theme_name in kw['themes']:
            src = os.path.join(utils.get_theme_path(theme_name), 'assets')
            dst = os.path.join(kw['output_folder'], 'assets')
            for task in utils.copy_tree(src, dst):
                if task['name'] in tasks:
                    continue
                tasks[task['name']] = task
                task['uptodate'] = task.get('uptodate', []) + \
                    [config_changed(kw)]
                task['basename'] = 'copy_assets'
                yield task
示例#11
0
文件: iso.py 项目: favoretti/seedBank
 def add_puppet_manifests(self, fqdn):
     """copy the Puppet manifests to the ISO"""
     path = os.path.join(self.cfg['paths']['temp'], 'seedbank', fqdn,
         'iso/iso/manifests')
     utils.copy_tree(self.cfg['paths']['puppet_manifests'], path)
示例#12
0
文件: iso.py 项目: pathcl/seedBank
 def add_puppet_manifests(self, fqdn):
     """copy the Puppet manifests to the ISO"""
     path = os.path.join(self.cfg['paths']['temp'], 'seedbank', fqdn,
                         'iso/iso/manifests')
     utils.copy_tree(self.cfg['paths']['puppet_manifests'], path)
示例#13
0
def CopyFolder(origin, destination):
    if copy_tree(origin, destination):
        log.warning("Overwriting path : " + destination)
    else:
        log.info("Copying : " + destination)
示例#14
0
def CopyFolder(origin, destination):
    if copy_tree(origin, destination):
        log.warning("Overwriting path : " + destination)
    else:
        log.info("Copying : " + destination)
示例#15
0
 def _install(self, context):
     copy_tree(pj(self.source_path, "bin"),
               pj(self.buildEnv.install_dir, "bin"),
               post_copy_function=add_execution_right)
     copy_tree(pj(self.source_path, "lib"),
               pj(self.buildEnv.install_dir, "lib"))