diff --git a/scripts/boobank-munin b/scripts/boobank-munin
index 936e9391..92697a3a 100755
--- a/scripts/boobank-munin
+++ b/scripts/boobank-munin
@@ -149,7 +149,7 @@ class BoobankMuninPlugin(object):
except KeyError:
pass
else:
- accounts = reversed([a for b, a in self.weboob.do('iter_accounts')])
+ accounts = reversed(a for b, a in self.weboob.do('iter_accounts'))
first = True
for account in accounts:
diff --git a/tools/make_man.py b/tools/make_man.py
index 43697434..673fa396 100755
--- a/tools/make_man.py
+++ b/tools/make_man.py
@@ -75,7 +75,7 @@ class ManpageHelpFormatter(optparse.HelpFormatter):
def format_option_strings(self, option):
opts = optparse.HelpFormatter.format_option_strings(self, option).split(", ")
- return ".TP\n"+", ".join(["\\fB%s\\fR" % opt for opt in opts])
+ return ".TP\n"+", ".join("\\fB%s\\fR" % opt for opt in opts)
def main():
diff --git a/weboob/applications/havesex/havesex.py b/weboob/applications/havesex/havesex.py
index d4ae149e..3abf42b6 100644
--- a/weboob/applications/havesex/havesex.py
+++ b/weboob/applications/havesex/havesex.py
@@ -40,7 +40,7 @@ class ProfileFormatter(IFormatter):
result += self.print_node(sub, level+1)
else:
if isinstance(node.value, (tuple,list)):
- value = ','.join([unicode(v) for v in node.value])
+ value = ','.join(unicode(v) for v in node.value)
else:
value = node.value
result += u'\t' * level + u'%-20s %s\n' % (node.label + ':', value)
diff --git a/weboob/applications/qhavesex/contacts.py b/weboob/applications/qhavesex/contacts.py
index fe24e0e6..77f3abaa 100644
--- a/weboob/applications/qhavesex/contacts.py
+++ b/weboob/applications/qhavesex/contacts.py
@@ -266,10 +266,10 @@ class ContactProfile(QWidget):
for sub in node.value:
self.process_node(sub, value)
elif isinstance(node.value, list):
- value = QLabel('
'.join([unicode(s) for s in node.value]))
+ value = QLabel('
'.join(unicode(s) for s in node.value))
value.setWordWrap(True)
elif isinstance(node.value, tuple):
- value = QLabel(', '.join([unicode(s) for s in node.value]))
+ value = QLabel(', '.join(unicode(s) for s in node.value))
value.setWordWrap(True)
elif isinstance(node.value, (basestring,int,long,float)):
value = QLabel(unicode(node.value))
diff --git a/weboob/applications/webcontentedit/webcontentedit.py b/weboob/applications/webcontentedit/webcontentedit.py
index 93c1316b..78ab6d36 100644
--- a/weboob/applications/webcontentedit/webcontentedit.py
+++ b/weboob/applications/webcontentedit/webcontentedit.py
@@ -88,7 +88,7 @@ class WebContentEdit(ReplApplication):
print 'No changes. Abort.'
return
- print 'Contents changed:\n%s' % ('\n'.join([' * %s' % content.id for content in contents]))
+ print 'Contents changed:\n%s' % ('\n'.join(' * %s' % content.id for content in contents))
message = self.ask('Enter a commit message', default='')
diff --git a/weboob/backends/aum/pages/profile.py b/weboob/backends/aum/pages/profile.py
index d0e779e8..60029290 100644
--- a/weboob/backends/aum/pages/profile.py
+++ b/weboob/backends/aum/pages/profile.py
@@ -433,7 +433,7 @@ class ProfilePage(PageBase):
for key, value in d.items():
key = '%s:' % key
if isinstance(value, list):
- body += u'\t\t%-15s %s\n' % (key, u', '.join([unicode(s) for s in value]))
+ body += u'\t\t%-15s %s\n' % (key, u', '.join(unicode(s) for s in value))
elif isinstance(value, float):
body += u'\t\t%-15s %.2f\n' % (key, value)
else:
diff --git a/weboob/tools/application/formatters/csv.py b/weboob/tools/application/formatters/csv.py
index c542ecb2..290646b2 100644
--- a/weboob/tools/application/formatters/csv.py
+++ b/weboob/tools/application/formatters/csv.py
@@ -36,5 +36,5 @@ class CSVFormatter(IFormatter):
if self.count == 0:
result += self.field_separator.join(item.iterkeys()) + '\n'
self.count += 1
- result += self.field_separator.join([unicode(v) for v in item.itervalues()])
+ result += self.field_separator.join(unicode(v) for v in item.itervalues())
return result
diff --git a/weboob/tools/application/qt/backendcfg.py b/weboob/tools/application/qt/backendcfg.py
index 990ef5d3..913eee60 100644
--- a/weboob/tools/application/qt/backendcfg.py
+++ b/weboob/tools/application/qt/backendcfg.py
@@ -287,7 +287,7 @@ class BackendCfg(QDialog):
backend.license,
(unicode(self.tr('Website: %s
')) % backend.website) if backend.website else '',
backend.description,
- ', '.join(sorted([cap.__name__.replace('ICap', '') for cap in backend.iter_caps()]))))
+ ', '.join(sorted(cap.__name__.replace('ICap', '') for cap in backend.iter_caps()))))
if backend.has_caps(ICapAccount) and self.ui.nameEdit.isEnabled() and backend.klass.ACCOUNT_REGISTER_PROPERTIES is not None:
self.ui.registerButton.show()
diff --git a/weboob/tools/application/repl.py b/weboob/tools/application/repl.py
index aa024b5d..8106fba3 100644
--- a/weboob/tools/application/repl.py
+++ b/weboob/tools/application/repl.py
@@ -353,7 +353,7 @@ class ReplApplication(Cmd, BaseApplication):
raise NotEnoughArguments('Command needs %d arguments' % req_n)
if len(args) < nb:
- args += tuple([None for i in xrange(nb - len(args))])
+ args += tuple(None for i in xrange(nb - len(args)))
return args
def postcmd(self, stop, line):
diff --git a/weboob/tools/backend.py b/weboob/tools/backend.py
index 364ae94b..97d0f878 100644
--- a/weboob/tools/backend.py
+++ b/weboob/tools/backend.py
@@ -106,7 +106,7 @@ class BaseBackend(object):
self.lock = RLock()
# Private fields (which start with '_')
- self._private_config = dict([(key, value) for key, value in config.iteritems() if key.startswith('_')])
+ self._private_config = dict((key, value) for key, value in config.iteritems() if key.startswith('_'))
# Configuration of backend
self.config = {}
diff --git a/weboob/tools/value.py b/weboob/tools/value.py
index 6e5659c6..fb3d2a7e 100644
--- a/weboob/tools/value.py
+++ b/weboob/tools/value.py
@@ -52,7 +52,8 @@ class Value(object):
if self.regexp is not None and not re.match(self.regexp, unicode(v)):
raise ValueError('Value "%s" does not match regexp "%s"' % (v, self.regexp))
if self.choices is not None and not v in self.choices.iterkeys():
- raise ValueError('Value "%s" is not in list: %s' % (v, ', '.join([unicode(s) for s in self.choices.iterkeys()])))
+ raise ValueError('Value "%s" is not in list: %s' % (
+ v, ', '.join(unicode(s) for s in self.choices.iterkeys())))
def set_value(self, v):
self.check_valid(v)