當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。