Convert some genexprs into regular list comprehension.
This commit is contained in:
parent
293d2637d1
commit
fba820e879
3 changed files with 6 additions and 6 deletions
|
@ -382,7 +382,7 @@ class Core(object):
|
||||||
Remove all gaptabs if switching from gaps to nogaps.
|
Remove all gaptabs if switching from gaps to nogaps.
|
||||||
"""
|
"""
|
||||||
if value.lower() == "false":
|
if value.lower() == "false":
|
||||||
self.tabs = list(tab for tab in self.tabs if tab)
|
self.tabs = [tab for tab in self.tabs if tab]
|
||||||
|
|
||||||
def on_request_receipts_config_change(self, option, value):
|
def on_request_receipts_config_change(self, option, value):
|
||||||
"""
|
"""
|
||||||
|
@ -960,7 +960,7 @@ class Core(object):
|
||||||
"Get all the tabs of a type"
|
"Get all the tabs of a type"
|
||||||
if cls is None:
|
if cls is None:
|
||||||
cls = tabs.Tab
|
cls = tabs.Tab
|
||||||
return filter(lambda tab: isinstance(tab, cls), self.tabs)
|
return [tab for tab in self.tabs if isinstance(tab, cls)]
|
||||||
|
|
||||||
def current_tab(self):
|
def current_tab(self):
|
||||||
"""
|
"""
|
||||||
|
|
|
@ -262,7 +262,7 @@ class PluginManager(object):
|
||||||
else:
|
else:
|
||||||
self.core.xmpp.del_event_handler(event_name, handler)
|
self.core.xmpp.del_event_handler(event_name, handler)
|
||||||
eh = self.event_handlers[module_name]
|
eh = self.event_handlers[module_name]
|
||||||
eh = list(filter(lambda e: e != (event_name, handler), eh))
|
eh = [e for e in eh if e != (event_name, handler)]
|
||||||
|
|
||||||
def completion_load(self, the_input):
|
def completion_load(self, the_input):
|
||||||
"""
|
"""
|
||||||
|
@ -279,7 +279,7 @@ class PluginManager(object):
|
||||||
pass
|
pass
|
||||||
except OSError as e:
|
except OSError as e:
|
||||||
self.core.information('Completion failed: %s' % e, 'Error')
|
self.core.information('Completion failed: %s' % e, 'Error')
|
||||||
return
|
return False
|
||||||
plugins_files = [name[:-3] for name in names if name.endswith('.py')
|
plugins_files = [name[:-3] for name in names if name.endswith('.py')
|
||||||
and name != '__init__.py' and not name.startswith('.')]
|
and name != '__init__.py' and not name.startswith('.')]
|
||||||
plugins_files.sort()
|
plugins_files.sort()
|
||||||
|
|
|
@ -396,8 +396,8 @@ class XHTMLHandler(sax.ContentHandler):
|
||||||
if name == 'a':
|
if name == 'a':
|
||||||
self.pop_formatting()
|
self.pop_formatting()
|
||||||
# do not display the link twice
|
# do not display the link twice
|
||||||
text_elements = filter(lambda x: not x.startswith('\x19'),
|
text_elements = [x for x in self.builder[self.a_start:]
|
||||||
self.builder[self.a_start:])
|
if not x.startswith('\x19')]
|
||||||
link_text = ''.join(text_elements).strip()
|
link_text = ''.join(text_elements).strip()
|
||||||
if 'href' in attrs and attrs['href'] != link_text:
|
if 'href' in attrs and attrs['href'] != link_text:
|
||||||
builder.append(' (%s)' % trim(attrs['href']))
|
builder.append(' (%s)' % trim(attrs['href']))
|
||||||
|
|
Loading…
Reference in a new issue