我们从Python开源项目中,提取了以下39个代码示例,用于说明如何使用pkg_resources.yield_lines()。
def read(self): """ >>> DepsReader("__requires__=['foo']").read() ['foo'] """ reqs_raw = self._read('__requires__') strings = map(str, pkg_resources.parse_requirements(reqs_raw)) deps = Dependencies(strings) try: deps.index_url = self._read('__index_url__') except Exception: pass try: raw_links = self._read('__dependency_links__') except Exception: pass else: deps.dependency_links = list(pkg_resources.yield_lines(raw_links)) return deps
def get_metadata_lines(self,name): return pkg_resources.yield_lines(self.get_metadata(name))
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)
def get_metadata_lines(self, name): return pkg_resources.yield_lines(self.get_metadata(name))
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
def get_metadata_lines(self,name): return yield_lines(self.get_metadata(name))
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