當前位置: 首頁>>代碼示例>>Python>>正文


Python build_py.build_py方法代碼示例

本文整理匯總了Python中distutils.command.build_py.build_py方法的典型用法代碼示例。如果您正苦於以下問題:Python build_py.build_py方法的具體用法?Python build_py.build_py怎麽用?Python build_py.build_py使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在distutils.command.build_py的用法示例。


在下文中一共展示了build_py.build_py方法的11個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: run

# 需要導入模塊: from distutils.command import build_py [as 別名]
# 或者: from distutils.command.build_py import build_py [as 別名]
def run(self):
        """Build modules, packages, and copy data files to build directory"""
        if not self.py_modules and not self.packages:
            return

        if self.py_modules:
            self.build_modules()

        if self.packages:
            self.build_packages()
            self.build_package_data()

        self.run_2to3(self.__updated_files, False)
        self.run_2to3(self.__updated_files, True)
        self.run_2to3(self.__doctests_2to3, True)

        # Only compile actual .py files, using our base class' idea of what our
        # output files are.
        self.byte_compile(orig.build_py.get_outputs(self, include_bytecode=0)) 
開發者ID:jpush,項目名稱:jbox,代碼行數:21,代碼來源:build_py.py

示例2: finalize_options

# 需要導入模塊: from distutils.command import build_py [as 別名]
# 或者: from distutils.command.build_py import build_py [as 別名]
def finalize_options(self):
        orig.build_py.finalize_options(self)
        self.package_data = self.distribution.package_data
        self.exclude_package_data = (self.distribution.exclude_package_data or
                                     {})
        if 'data_files' in self.__dict__:
            del self.__dict__['data_files']
        self.__updated_files = []
        self.__doctests_2to3 = [] 
開發者ID:jpush,項目名稱:jbox,代碼行數:11,代碼來源:build_py.py

示例3: __getattr__

# 需要導入模塊: from distutils.command import build_py [as 別名]
# 或者: from distutils.command.build_py import build_py [as 別名]
def __getattr__(self, attr):
        "lazily compute data files"
        if attr == 'data_files':
            self.data_files = self._get_data_files()
            return self.data_files
        return orig.build_py.__getattr__(self, attr) 
開發者ID:jpush,項目名稱:jbox,代碼行數:8,代碼來源:build_py.py

示例4: build_module

# 需要導入模塊: from distutils.command import build_py [as 別名]
# 或者: from distutils.command.build_py import build_py [as 別名]
def build_module(self, module, module_file, package):
        outfile, copied = orig.build_py.build_module(self, module, module_file,
                                                     package)
        if copied:
            self.__updated_files.append(outfile)
        return outfile, copied 
開發者ID:jpush,項目名稱:jbox,代碼行數:8,代碼來源:build_py.py

示例5: check_package

# 需要導入模塊: from distutils.command import build_py [as 別名]
# 或者: from distutils.command.build_py import build_py [as 別名]
def check_package(self, package, package_dir):
        """Check namespace packages' __init__ for declare_namespace"""
        try:
            return self.packages_checked[package]
        except KeyError:
            pass

        init_py = orig.build_py.check_package(self, package, package_dir)
        self.packages_checked[package] = init_py

        if not init_py or not self.distribution.namespace_packages:
            return init_py

        for pkg in self.distribution.namespace_packages:
            if pkg == package or pkg.startswith(package + '.'):
                break
        else:
            return init_py

        with io.open(init_py, 'rb') as f:
            contents = f.read()
        if b'declare_namespace' not in contents:
            raise distutils.errors.DistutilsError(
                "Namespace package problem: %s is a namespace package, but "
                "its\n__init__.py does not call declare_namespace()! Please "
                'fix it.\n(See the setuptools manual under '
                '"Namespace Packages" for details.)\n"' % (package,)
            )
        return init_py 
開發者ID:jpush,項目名稱:jbox,代碼行數:31,代碼來源:build_py.py

示例6: get_package_dir

# 需要導入模塊: from distutils.command import build_py [as 別名]
# 或者: from distutils.command.build_py import build_py [as 別名]
def get_package_dir(self, package):
        res = orig.build_py.get_package_dir(self, package)
        if self.distribution.src_root is not None:
            return os.path.join(self.distribution.src_root, res)
        return res 
開發者ID:jpush,項目名稱:jbox,代碼行數:7,代碼來源:build_py.py

示例7: build_module

# 需要導入模塊: from distutils.command import build_py [as 別名]
# 或者: from distutils.command.build_py import build_py [as 別名]
def build_module(self, module, module_file, package):
        if six.PY2 and isinstance(package, six.string_types):
            # avoid errors on Python 2 when unicode is passed (#190)
            package = package.split('.')
        outfile, copied = orig.build_py.build_module(self, module, module_file,
                                                     package)
        if copied:
            self.__updated_files.append(outfile)
        return outfile, copied 
開發者ID:sofia-netsurv,項目名稱:python-netsurv,代碼行數:11,代碼來源:build_py.py

示例8: initialize_options

# 需要導入模塊: from distutils.command import build_py [as 別名]
# 或者: from distutils.command.build_py import build_py [as 別名]
def initialize_options(self):
        self.packages_checked = {}
        orig.build_py.initialize_options(self) 
開發者ID:sofia-netsurv,項目名稱:python-netsurv,代碼行數:5,代碼來源:build_py.py

示例9: finalize_options

# 需要導入模塊: from distutils.command import build_py [as 別名]
# 或者: from distutils.command.build_py import build_py [as 別名]
def finalize_options(self):
        orig.build_py.finalize_options(self)
        self.package_data = self.distribution.package_data
        self.exclude_package_data = self.distribution.exclude_package_data or {}
        if 'data_files' in self.__dict__: del self.__dict__['data_files']
        self.__updated_files = []
        self.__doctests_2to3 = [] 
開發者ID:MayOneUS,項目名稱:pledgeservice,代碼行數:9,代碼來源:build_py.py

示例10: __getattr__

# 需要導入模塊: from distutils.command import build_py [as 別名]
# 或者: from distutils.command.build_py import build_py [as 別名]
def __getattr__(self, attr):
        if attr=='data_files':  # lazily compute data files
            self.data_files = files = self._get_data_files()
            return files
        return orig.build_py.__getattr__(self,attr) 
開發者ID:MayOneUS,項目名稱:pledgeservice,代碼行數:7,代碼來源:build_py.py

示例11: build_module

# 需要導入模塊: from distutils.command import build_py [as 別名]
# 或者: from distutils.command.build_py import build_py [as 別名]
def build_module(self, module, module_file, package):
        outfile, copied = orig.build_py.build_module(self, module, module_file, package)
        if copied:
            self.__updated_files.append(outfile)
        return outfile, copied 
開發者ID:MayOneUS,項目名稱:pledgeservice,代碼行數:7,代碼來源:build_py.py


注:本文中的distutils.command.build_py.build_py方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。