remove unnecessary brackets
This commit is contained in:
parent
f1a43f1101
commit
3dd50f363d
11 changed files with 13 additions and 12 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -287,7 +287,7 @@ class BackendCfg(QDialog):
|
|||
backend.license,
|
||||
(unicode(self.tr('<b>Website</b>: %s<br />')) % 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()
|
||||
|
|
|
|||
|
|
@ -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):
|
||||
|
|
|
|||
|
|
@ -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 = {}
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue