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


Python Package.open方法代码示例

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


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

示例1: build_tests

# 需要导入模块: from package import Package [as 别名]
# 或者: from package.Package import open [as 别名]
    def build_tests(self):
        package = self.package
        package_root = os.getcwd()
        self.build_package(package, package_root)

        download_dependencies(package.test_dependencies)
        dependencies = []
        for dependency in package.test_dependencies:
            path = path_for_dependency(dependency)

            os.chdir(path)
            sub_package = Package.open()
            os.chdir(os.path.join('..', '..'))

            self.build_package(sub_package, path)
            dependencies.append(sub_package)
        dependencies.append(package)

        for dependency in package.dependencies:
            path = path_for_dependency(dependency)

            os.chdir(path)
            sub_package = Package.open()
            os.chdir(os.path.join('..', '..'))

            dependencies.append(sub_package)

        sources = collect_sources(os.path.join(package_root, 'Tests'))

        has_main = len([s for s in sources if s.endswith('/main.swift')]) > 0
        if has_main:
            self.build_cli(package.name + 'Tests', sources, dependencies)
        else:
            raise Exception('Tests is missing a main.swift')
开发者ID:kylef,项目名称:swim,代码行数:36,代码来源:builder.py

示例2: Run

# 需要导入模块: from package import Package [as 别名]
# 或者: from package.Package import open [as 别名]
    def Run(self):
        """Run the application ...

        We first need to read in all of our package.* files.
        Then we simply write them out with the correct method.
        We pass a flag to check for installed packages.

        """
        files_list = [
            "/etc/portage/package.use",
            "/etc/portage/package.unmask",
            "/etc/portage/package.mask",
            "/etc/portage/package.keywords",
            "/etc/portage/package.license"
            ]
        for name in files_list:
            if not os.access(name, os.F_OK): continue
            file = Package(name, self._destructive, self._sort, self._debug)
            file.open()
            if self._pretend: 
                output.verbose("%s:", name)
                output.verbose(file.__unicode__())
            else: file.write(self._reorganize)
            file.close()
开发者ID:Arnox,项目名称:pclean,代码行数:26,代码来源:pclean.py

示例3: build_package

# 需要导入模块: from package import Package [as 别名]
# 或者: from package.Package import open [as 别名]
    def build_package(self, package, package_root):
        download_dependencies(package.dependencies)
        dependencies = []
        for dependency in package.dependencies:
            path = path_for_dependency(dependency)

            os.chdir(path)
            sub_package = Package.open()
            os.chdir(os.path.join('..', '..'))

            self.build_package(sub_package, path)
            dependencies.append(sub_package)


        sources = collect_sources(os.path.join(package_root, 'Sources'))

        has_main = len([s for s in sources if s.endswith('/main.swift')]) > 0
        if has_main:
            self.build_cli(package.name, sources, dependencies)
        else:
            self.build_library(package.name, sources, dependencies)
开发者ID:kylef,项目名称:swim,代码行数:23,代码来源:builder.py


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