当前位置: 首页>>代码示例>>Python>>正文


Python util.change_root方法代码示例

本文整理汇总了Python中distutils.util.change_root方法的典型用法代码示例。如果您正苦于以下问题:Python util.change_root方法的具体用法?Python util.change_root怎么用?Python util.change_root使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在distutils.util的用法示例。


在下文中一共展示了util.change_root方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: run

# 需要导入模块: from distutils import util [as 别名]
# 或者: from distutils.util import change_root [as 别名]
def run(self):
        self.mkpath(self.install_dir)
        for f in self.data_files:
            if isinstance(f, str):
                # it's a simple file, so copy it
                f = convert_path(f)
                if self.warn_dir:
                    self.warn("setup script did not provide a directory for "
                              "'%s' -- installing right in '%s'" %
                              (f, self.install_dir))
                (out, _) = self.copy_file(f, self.install_dir)
                self.outfiles.append(out)
            else:
                # it's a tuple with path to install to and a list of files
                dir = convert_path(f[0])
                if not os.path.isabs(dir):
                    dir = os.path.join(self.install_dir, dir)
                elif self.root:
                    dir = change_root(self.root, dir)
                self.mkpath(dir)

                if f[1] == []:
                    # If there are no files listed, the user must be
                    # trying to create an empty directory, so add the
                    # directory to the list of output files.
                    self.outfiles.append(dir)
                else:
                    # Copy files, adding them to the list of output files.
                    for data in f[1]:
                        data = convert_path(data)
                        (out, _) = self.copy_file(data, dir)
                        self.outfiles.append(out) 
开发者ID:glmcdona,项目名称:meddle,代码行数:34,代码来源:install_data.py

示例2: change_roots

# 需要导入模块: from distutils import util [as 别名]
# 或者: from distutils.util import change_root [as 别名]
def change_roots (self, *names):
        for name in names:
            attr = "install_" + name
            setattr(self, attr, change_root(self.root, getattr(self, attr))) 
开发者ID:glmcdona,项目名称:meddle,代码行数:6,代码来源:install.py

示例3: change_roots

# 需要导入模块: from distutils import util [as 别名]
# 或者: from distutils.util import change_root [as 别名]
def change_roots(self, *names):
        """Change the install directories pointed by name using root."""
        for name in names:
            attr = "install_" + name
            setattr(self, attr, change_root(self.root, getattr(self, attr))) 
开发者ID:Microvellum,项目名称:Fluid-Designer,代码行数:7,代码来源:install.py

示例4: finalize_options

# 需要导入模块: from distutils import util [as 别名]
# 或者: from distutils.util import change_root [as 别名]
def finalize_options(self):
        """Finalize options"""
        self.set_undefined_options('install',
                                   ('root', 'root'),
                                   )
        if not self.prefix:
            self.prefix = '/usr/share/man'

        if self.root:
            self.prefix = change_root(self.root, self.prefix) 
开发者ID:mysql,项目名称:mysql-utilities,代码行数:12,代码来源:package.py

示例5: finalize_options

# 需要导入模块: from distutils import util [as 别名]
# 或者: from distutils.util import change_root [as 别名]
def finalize_options(self):
        """Finalize options"""
        self.set_undefined_options('install',
                                   ('root', 'root'),
                                   ('record', 'record'))

        if not self.prefix:
            self.prefix = '/usr/share/man'

        if self.root:
            self.prefix = change_root(self.root, self.prefix) 
开发者ID:mysql,项目名称:mysql-utilities,代码行数:13,代码来源:setup.py

示例6: run

# 需要导入模块: from distutils import util [as 别名]
# 或者: from distutils.util import change_root [as 别名]
def run (self):
        self.mkpath(self.install_dir)
        for f in self.data_files:
            if type(f) is StringType:
                # it's a simple file, so copy it
                f = convert_path(f)
                if self.warn_dir:
                    self.warn("setup script did not provide a directory for "
                              "'%s' -- installing right in '%s'" %
                              (f, self.install_dir))
                (out, _) = self.copy_file(f, self.install_dir)
                self.outfiles.append(out)
            else:
                # it's a tuple with path to install to and a list of files
                dir = convert_path(f[0])
                if not os.path.isabs(dir):
                    dir = os.path.join(self.install_dir, dir)
                elif self.root:
                    dir = change_root(self.root, dir)
                self.mkpath(dir)

                if f[1] == []:
                    # If there are no files listed, the user must be
                    # trying to create an empty directory, so add the
                    # directory to the list of output files.
                    self.outfiles.append(dir)
                else:
                    # Copy files, adding them to the list of output files.
                    for data in f[1]:
                        data = convert_path(data)
                        (out, _) = self.copy_file(data, dir)
                        self.outfiles.append(out) 
开发者ID:ofermend,项目名称:medicare-demo,代码行数:34,代码来源:install_data.py

示例7: change_roots

# 需要导入模块: from distutils import util [as 别名]
# 或者: from distutils.util import change_root [as 别名]
def change_roots (self, *names):
        for name in names:
            attr = "install_" + name
            setattr(self, attr, change_root(self.root, getattr(self, attr)))


    # -- Command execution methods ------------------------------------- 
开发者ID:ofermend,项目名称:medicare-demo,代码行数:9,代码来源:install.py


注:本文中的distutils.util.change_root方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。