本文整理匯總了Python中pkg_resources.yield_lines方法的典型用法代碼示例。如果您正苦於以下問題:Python pkg_resources.yield_lines方法的具體用法?Python pkg_resources.yield_lines怎麽用?Python pkg_resources.yield_lines使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類pkg_resources
的用法示例。
在下文中一共展示了pkg_resources.yield_lines方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: get_metadata_lines
# 需要導入模塊: import pkg_resources [as 別名]
# 或者: from pkg_resources import yield_lines [as 別名]
def get_metadata_lines(self,name):
return pkg_resources.yield_lines(self.get_metadata(name))
示例2: testYielding
# 需要導入模塊: import pkg_resources [as 別名]
# 或者: from pkg_resources import yield_lines [as 別名]
def testYielding(self):
for inp,out in [
([], []), ('x',['x']), ([[]],[]), (' x\n y', ['x','y']),
(['x\n\n','y'], ['x','y']),
]:
self.assertEqual(list(pkg_resources.yield_lines(inp)),out)
示例3: get_install_requires
# 需要導入模塊: import pkg_resources [as 別名]
# 或者: from pkg_resources import yield_lines [as 別名]
def get_install_requires():
with open('requirements.txt', 'r') as f:
minimal_reqs = list(yield_lines(f.read()))
return minimal_reqs
示例4: get_metadata_lines
# 需要導入模塊: import pkg_resources [as 別名]
# 或者: from pkg_resources import yield_lines [as 別名]
def get_metadata_lines(self, name):
return pkg_resources.yield_lines(self.get_metadata(name))
示例5: testYielding
# 需要導入模塊: import pkg_resources [as 別名]
# 或者: from pkg_resources import yield_lines [as 別名]
def testYielding(self):
for inp, out in [
([], []), ('x', ['x']), ([[]], []), (' x\n y', ['x', 'y']),
(['x\n\n', 'y'], ['x', 'y']),
]:
assert list(pkg_resources.yield_lines(inp)) == out
示例6: get_install_requires
# 需要導入模塊: import pkg_resources [as 別名]
# 或者: from pkg_resources import yield_lines [as 別名]
def get_install_requires():
with open("requirements-minimal.txt", "r") as f:
minimal_reqs = list(yield_lines(f.read()))
return minimal_reqs
示例7: testYielding
# 需要導入模塊: import pkg_resources [as 別名]
# 或者: from pkg_resources import yield_lines [as 別名]
def testYielding(self):
for inp,out in [
([], []), ('x',['x']), ([[]],[]), (' x\n y', ['x','y']),
(['x\n\n','y'], ['x','y']),
]:
assert list(pkg_resources.yield_lines(inp)) == out