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


Python FileList.files方法代码示例

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


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

示例1: test_exclude_pattern

# 需要导入模块: from setuptools.command.egg_info import FileList [as 别名]
# 或者: from setuptools.command.egg_info.FileList import files [as 别名]
    def test_exclude_pattern(self):
        # return False if no match
        file_list = FileList()
        assert not file_list.exclude_pattern('*.py')

        # return True if files match
        file_list = FileList()
        file_list.files = ['a.py', 'b.py']
        assert file_list.exclude_pattern('*.py')

        # test excludes
        file_list = FileList()
        file_list.files = ['a.py', 'a.txt']
        file_list.exclude_pattern('*.py')
        assert file_list.files == ['a.txt']
开发者ID:Postgre,项目名称:HackingTools,代码行数:17,代码来源:test_manifest.py

示例2: test_prune

# 需要导入模块: from setuptools.command.egg_info import FileList [as 别名]
# 或者: from setuptools.command.egg_info.FileList import files [as 别名]
    def test_prune(self):
        ml = make_local_path
        # prune
        file_list = FileList()
        file_list.files = ['a.py', ml('d/b.py'), ml('d/d/e.py'), ml('f/f.py')]

        file_list.process_template_line('prune d')
        file_list.sort()
        assert file_list.files == ['a.py', ml('f/f.py')]
        self.assertNoWarnings()

        file_list.process_template_line('prune e')
        file_list.sort()
        assert file_list.files == ['a.py', ml('f/f.py')]
        self.assertWarnings()
开发者ID:pypa,项目名称:setuptools,代码行数:17,代码来源:test_manifest.py

示例3: test_recursive_exclude

# 需要导入模块: from setuptools.command.egg_info import FileList [as 别名]
# 或者: from setuptools.command.egg_info.FileList import files [as 别名]
    def test_recursive_exclude(self):
        ml = make_local_path
        # recursive-exclude
        file_list = FileList()
        file_list.files = ['a.py', ml('d/b.py'), ml('d/c.txt'), ml('d/d/e.py')]

        file_list.process_template_line('recursive-exclude d *.py')
        file_list.sort()
        assert file_list.files == ['a.py', ml('d/c.txt')]
        self.assertNoWarnings()

        file_list.process_template_line('recursive-exclude e *.py')
        file_list.sort()
        assert file_list.files == ['a.py', ml('d/c.txt')]
        self.assertWarnings()
开发者ID:pypa,项目名称:setuptools,代码行数:17,代码来源:test_manifest.py

示例4: test_global_exclude

# 需要导入模块: from setuptools.command.egg_info import FileList [as 别名]
# 或者: from setuptools.command.egg_info.FileList import files [as 别名]
    def test_global_exclude(self):
        ml = make_local_path
        # global-exclude
        file_list = FileList()
        file_list.files = ['a.py', 'b.txt', ml('d/c.py')]

        file_list.process_template_line('global-exclude *.py')
        file_list.sort()
        assert file_list.files == ['b.txt']
        self.assertNoWarnings()

        file_list.process_template_line('global-exclude *.rb')
        file_list.sort()
        assert file_list.files == ['b.txt']
        self.assertWarnings()
开发者ID:pypa,项目名称:setuptools,代码行数:17,代码来源:test_manifest.py

示例5: test_process_template

# 需要导入模块: from setuptools.command.egg_info import FileList [as 别名]
# 或者: from setuptools.command.egg_info.FileList import files [as 别名]
    def test_process_template(self):
        l = make_local_path
        # invalid lines
        file_list = FileList()
        for action in ('include', 'exclude', 'global-include',
                       'global-exclude', 'recursive-include',
                       'recursive-exclude', 'graft', 'prune', 'blarg'):
            try:
                file_list.process_template_line(action)
            except DistutilsTemplateError:
                pass
            except Exception:
                assert False, "Incorrect error thrown"
            else:
                assert False, "Should have thrown an error"

        # include
        file_list = FileList()
        file_list.set_allfiles(['a.py', 'b.txt', l('d/c.py')])

        file_list.process_template_line('include *.py')
        assert file_list.files == ['a.py']
        self.assertNoWarnings()

        file_list.process_template_line('include *.rb')
        assert file_list.files == ['a.py']
        self.assertWarnings()

        # exclude
        file_list = FileList()
        file_list.files = ['a.py', 'b.txt', l('d/c.py')]

        file_list.process_template_line('exclude *.py')
        assert file_list.files == ['b.txt', l('d/c.py')]
        self.assertNoWarnings()

        file_list.process_template_line('exclude *.rb')
        assert file_list.files == ['b.txt', l('d/c.py')]
        self.assertWarnings()

        # global-include
        file_list = FileList()
        file_list.set_allfiles(['a.py', 'b.txt', l('d/c.py')])

        file_list.process_template_line('global-include *.py')
        assert file_list.files == ['a.py', l('d/c.py')]
        self.assertNoWarnings()

        file_list.process_template_line('global-include *.rb')
        assert file_list.files == ['a.py', l('d/c.py')]
        self.assertWarnings()

        # global-exclude
        file_list = FileList()
        file_list.files = ['a.py', 'b.txt', l('d/c.py')]

        file_list.process_template_line('global-exclude *.py')
        assert file_list.files == ['b.txt']
        self.assertNoWarnings()

        file_list.process_template_line('global-exclude *.rb')
        assert file_list.files == ['b.txt']
        self.assertWarnings()

        # recursive-include
        file_list = FileList()
        file_list.set_allfiles(['a.py', l('d/b.py'), l('d/c.txt'),
                                l('d/d/e.py')])

        file_list.process_template_line('recursive-include d *.py')
        assert file_list.files == [l('d/b.py'), l('d/d/e.py')]
        self.assertNoWarnings()

        file_list.process_template_line('recursive-include e *.py')
        assert file_list.files == [l('d/b.py'), l('d/d/e.py')]
        self.assertWarnings()

        # recursive-exclude
        file_list = FileList()
        file_list.files = ['a.py', l('d/b.py'), l('d/c.txt'), l('d/d/e.py')]

        file_list.process_template_line('recursive-exclude d *.py')
        assert file_list.files == ['a.py', l('d/c.txt')]
        self.assertNoWarnings()

        file_list.process_template_line('recursive-exclude e *.py')
        assert file_list.files == ['a.py', l('d/c.txt')]
        self.assertWarnings()

        # graft
        file_list = FileList()
        file_list.set_allfiles(['a.py', l('d/b.py'), l('d/d/e.py'),
                                l('f/f.py')])

        file_list.process_template_line('graft d')
        assert file_list.files == [l('d/b.py'), l('d/d/e.py')]
        self.assertNoWarnings()

        file_list.process_template_line('graft e')
        assert file_list.files == [l('d/b.py'), l('d/d/e.py')]
#.........这里部分代码省略.........
开发者ID:Postgre,项目名称:HackingTools,代码行数:103,代码来源:test_manifest.py


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