summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEmmanuel Gil Peyrot <linkmauve@linkmauve.fr>2016-04-01 03:34:32 +0100
committerEmmanuel Gil Peyrot <linkmauve@linkmauve.fr>2016-06-12 15:31:15 +0100
commitfba820e87952461b62cec075432e401ffca1012d (patch)
tree38c9f11441a430d09bc1346c63737fcb8fc51dcc
parent293d2637d11490e16e5e4d5faf1c60046ef7ead5 (diff)
downloadpoezio-fba820e87952461b62cec075432e401ffca1012d.tar.gz
poezio-fba820e87952461b62cec075432e401ffca1012d.tar.bz2
poezio-fba820e87952461b62cec075432e401ffca1012d.tar.xz
poezio-fba820e87952461b62cec075432e401ffca1012d.zip
Convert some genexprs into regular list comprehension.
-rw-r--r--poezio/core/core.py4
-rw-r--r--poezio/plugin_manager.py4
-rw-r--r--poezio/xhtml.py4
3 files changed, 6 insertions, 6 deletions
diff --git a/poezio/core/core.py b/poezio/core/core.py
index 70f18867..384ffab2 100644
--- a/poezio/core/core.py
+++ b/poezio/core/core.py
@@ -382,7 +382,7 @@ class Core(object):
Remove all gaptabs if switching from gaps to nogaps.
"""
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):
"""
@@ -960,7 +960,7 @@ class Core(object):
"Get all the tabs of a type"
if cls is None:
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):
"""
diff --git a/poezio/plugin_manager.py b/poezio/plugin_manager.py
index 549753a9..d7097de0 100644
--- a/poezio/plugin_manager.py
+++ b/poezio/plugin_manager.py
@@ -262,7 +262,7 @@ class PluginManager(object):
else:
self.core.xmpp.del_event_handler(event_name, handler)
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):
"""
@@ -279,7 +279,7 @@ class PluginManager(object):
pass
except OSError as e:
self.core.information('Completion failed: %s' % e, 'Error')
- return
+ return False
plugins_files = [name[:-3] for name in names if name.endswith('.py')
and name != '__init__.py' and not name.startswith('.')]
plugins_files.sort()
diff --git a/poezio/xhtml.py b/poezio/xhtml.py
index b84ce943..ef2334fb 100644
--- a/poezio/xhtml.py
+++ b/poezio/xhtml.py
@@ -396,8 +396,8 @@ class XHTMLHandler(sax.ContentHandler):
if name == 'a':
self.pop_formatting()
# do not display the link twice
- text_elements = filter(lambda x: not x.startswith('\x19'),
- self.builder[self.a_start:])
+ text_elements = [x for x in self.builder[self.a_start:]
+ if not x.startswith('\x19')]
link_text = ''.join(text_elements).strip()
if 'href' in attrs and attrs['href'] != link_text:
builder.append(' (%s)' % trim(attrs['href']))