本文整理汇总了Python中setuptools.command.easy_install.PthDistributions类的典型用法代码示例。如果您正苦于以下问题:Python PthDistributions类的具体用法?Python PthDistributions怎么用?Python PthDistributions使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了PthDistributions类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_add_from_cwd_site_sets_dirty
def test_add_from_cwd_site_sets_dirty(self):
'''a pth file manager should set dirty
if a distribution is in site but also the cwd
'''
pth = PthDistributions('does-not_exist', [os.getcwd()])
self.assertTrue(not pth.dirty)
pth.add(PRDistribution(os.getcwd()))
self.assertTrue(pth.dirty)
示例2: test_add_from_site_is_ignored
def test_add_from_site_is_ignored(self):
location = '/test/location/does-not-have-to-exist'
# PthDistributions expects all locations to be normalized
location = pkg_resources.normalize_path(location)
pth = PthDistributions('does-not_exist', [location, ])
assert not pth.dirty
pth.add(PRDistribution(location))
assert not pth.dirty
示例3: test_add_from_cwd_site_sets_dirty
def test_add_from_cwd_site_sets_dirty(self):
"""a pth file manager should set dirty
if a distribution is in site but also the cwd
"""
pth = PthDistributions("does-not_exist", [os.getcwd()])
self.assert_(not pth.dirty)
pth.add(PRDistribution(os.getcwd()))
self.assert_(pth.dirty)
示例4: test_add_from_site_is_ignored
def test_add_from_site_is_ignored(self):
if os.name != 'nt':
location = '/test/location/does-not-have-to-exist'
else:
location = 'c:\\does_not_exist'
pth = PthDistributions('does-not_exist', [location, ])
self.assertTrue(not pth.dirty)
pth.add(PRDistribution(location))
self.assertTrue(not pth.dirty)
示例5: test_add_from_site_is_ignored
def test_add_from_site_is_ignored(self):
if os.name != "nt":
location = "/test/location/does-not-have-to-exist"
else:
location = "c:\\does_not_exist"
pth = PthDistributions("does-not_exist", [location])
self.assert_(not pth.dirty)
pth.add(PRDistribution(location))
self.assert_(not pth.dirty)
示例6: len
#[email protected]@
import sys
from setuptools.command.easy_install import PthDistributions
from pkg_resources import find_distributions
usage = "@[email protected] [ register | unregister ] egg\n"
if len(sys.argv) != 3 or sys.argv[1] not in ("register", "unregister"):
sys.stderr.write(usage)
sys.exit(1)
pth = PthDistributions("@[email protected]/easy-install.pth")
distrib = find_distributions(sys.argv[2], True).next()
if sys.argv[1] == "register":
pth.add(distrib)
elif sys.argv[1] == "unregister":
pth.remove(distrib)
pth.save()
示例7: test_add_from_site_is_ignored
def test_add_from_site_is_ignored(self):
pth = PthDistributions('does-not_exist', ['/test/location/does-not-have-to-exist'])
self.assert_(not pth.dirty)
pth.add(PRDistribution('/test/location/does-not-have-to-exist'))
self.assert_(not pth.dirty)