From de0a97da7e7dc1086182250667126c44b11ee40d Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Sun, 11 Nov 2012 11:27:57 -0500 Subject: [PATCH] helpers: wrap long lines to avoid pylint C0301 --- pym/gentoolkit/helpers.py | 33 +++++++++++++++++++++++++-------- 1 file changed, 25 insertions(+), 8 deletions(-) diff --git a/pym/gentoolkit/helpers.py b/pym/gentoolkit/helpers.py index ba8661d..a87b9f2 100644 --- a/pym/gentoolkit/helpers.py +++ b/pym/gentoolkit/helpers.py @@ -388,11 +388,16 @@ def get_cpvs(predicate=None, include_installed=True): """ if predicate: - all_cps = iter(x for x in portage.db[portage.root]["porttree"].dbapi.cp_all() if predicate(x)) + all_cps = iter( + x for x + in portage.db[portage.root]["porttree"].dbapi.cp_all() + if predicate(x)) else: all_cps = portage.db[portage.root]["porttree"].dbapi.cp_all() - all_cpvs = chain.from_iterable(portage.db[portage.root]["porttree"].dbapi.cp_list(x) for x in all_cps) + all_cpvs = chain.from_iterable( + portage.db[portage.root]["porttree"].dbapi.cp_list(x) + for x in all_cps) all_installed_cpvs = set(get_installed_cpvs(predicate)) if include_installed: @@ -424,11 +429,17 @@ def get_installed_cpvs(predicate=None): """ if predicate: - installed_cps = iter(x for x in portage.db[portage.root]["vartree"].dbapi.cp_all() if predicate(x)) + installed_cps = iter( + x for x + in portage.db[portage.root]["vartree"].dbapi.cp_all() + if predicate(x)) else: - installed_cps = portage.db[portage.root]["vartree"].dbapi.cp_all() + installed_cps = ( + portage.db[portage.root]["vartree"].dbapi.cp_all()) - for cpv in chain.from_iterable(portage.db[portage.root]["vartree"].dbapi.cp_list(x) for x in installed_cps): + for cpv in chain.from_iterable( + portage.db[portage.root]["vartree"].dbapi.cp_list(x) + for x in installed_cps): yield cpv @@ -443,11 +454,17 @@ def get_bintree_cpvs(predicate=None): """ if predicate: - installed_cps = iter(x for x in portage.db[portage.root]["bintree"].dbapi.cp_all() if predicate(x)) + installed_cps = iter( + x for x + in portage.db[portage.root]["bintree"].dbapi.cp_all() + if predicate(x)) else: - installed_cps = portage.db[portage.root]["bintree"].dbapi.cp_all() + installed_cps = ( + portage.db[portage.root]["bintree"].dbapi.cp_all()) - for cpv in chain.from_iterable(portage.db[portage.root]["bintree"].dbapi.cp_list(x) for x in installed_cps): + for cpv in chain.from_iterable( + portage.db[portage.root]["bintree"].dbapi.cp_list(x) + for x in installed_cps): yield cpv -- 2.26.2