Small optimizations in Account.getAliases() and Alias.getInfo().
--- a/VirtualMailManager/Account.py Sat Sep 05 18:01:04 2009 +0000
+++ b/VirtualMailManager/Account.py Sat Sep 05 18:46:33 2009 +0000
@@ -210,8 +210,7 @@
dbc.close()
aliases = []
if len(addresses) > 0:
- for alias in addresses:
- aliases.append(alias[0])
+ aliases = [alias[0] for alias in addresses]
return aliases
def delete(self, delalias):
--- a/VirtualMailManager/Alias.py Sat Sep 05 18:01:04 2009 +0000
+++ b/VirtualMailManager/Alias.py Sat Sep 05 18:46:33 2009 +0000
@@ -96,9 +96,7 @@
destinations = dbc.fetchall()
dbc.close()
if len(destinations) > 0:
- targets = []
- for destination in destinations:
- targets.append(destination[0])
+ targets = [destination[0] for destination in destinations]
return targets
else:
raise VMMAE(_(u"The alias ā%sā doesn't exists.") % self._addr,