[IMP] merge split map and filter into a single listcomp
bzr revid: xmo@openerp.com-20111025111213-6ryfsuv1jzfetxmu
This commit is contained in:
parent
0132b2ebd0
commit
b3803586d3
16
openerp-web
16
openerp-web
|
@ -60,17 +60,11 @@ if __name__ == "__main__":
|
|||
if os.path.exists(path_addons):
|
||||
options.addons_path.append(path_addons)
|
||||
|
||||
def remove_end_slash(text):
|
||||
if text[-1] in '/\\':
|
||||
return text[:-1]
|
||||
return text
|
||||
|
||||
def drop_false_path(path):
|
||||
if os.path.exists(path):
|
||||
return True
|
||||
|
||||
options.addons_path = map(remove_end_slash, options.addons_path)
|
||||
options.addons_path = filter(drop_false_path, options.addons_path)
|
||||
options.addons_path = [
|
||||
path[:-1] if path[-1] in r'\/' else path
|
||||
for path in options.addons_path
|
||||
if os.path.exists(path)
|
||||
]
|
||||
|
||||
for path_addons in options.addons_path:
|
||||
if path_addons not in sys.path:
|
||||
|
|
Loading…
Reference in New Issue