Proper replacement for portage.dep.strip_empty() with list comprehension, pep8fix

This commit is contained in:
Bernd May 2015-05-17 22:48:10 +02:00 committed by Justin Findlay
parent 2851a5cf13
commit 7576872280

View file

@ -227,7 +227,7 @@ def _merge_flags(new_flags, old_flags=None, conf='any'):
old_flags = []
args = [old_flags, new_flags]
if conf == 'accept_keywords':
tmp = new_flags+ \
tmp = new_flags + \
[i for i in old_flags if _check_accept_keywords(new_flags, i)]
else:
tmp = portage.flatten(args)
@ -274,7 +274,7 @@ def append_to_package_conf(conf, atom='', flags=None, string='', overwrite=False
new_flags = list(flags)
else:
atom = string.strip().split()[0]
new_flags = filter(None,string.strip().split(' '))[1:]
new_flags = [flag for flag in string.strip().split(' ') if flag][1:]
if '/' not in atom:
atom = _p_to_cp(atom)
string = '{0} {1}'.format(atom, ' '.join(new_flags))