VMM/VMM: applied 'code compression' from v0.6.x(09b7e3fe29b3) to
authorPascal Volk <neverseen@users.sourceforge.net>
Mon, 05 Apr 2010 10:22:51 +0000
changeset 238 8f56166a3283
parent 231 8c4df3dd2d2c
child 239 184970fd7486
VMM/VMM: applied 'code compression' from v0.6.x(09b7e3fe29b3) to VirtualMailManager.domainList().
VirtualMailManager/VirtualMailManager.py
--- a/VirtualMailManager/VirtualMailManager.py	Sun Mar 21 09:17:26 2010 +0000
+++ b/VirtualMailManager/VirtualMailManager.py	Mon Apr 05 10:22:51 2010 +0000
@@ -573,12 +573,7 @@
         if pattern is not None:
             if pattern.startswith('%') or pattern.endswith('%'):
                 like = True
-                if pattern.startswith('%') and pattern.endswith('%'):
-                    domain = pattern[1:-1]
-                elif pattern.startswith('%'):
-                    domain = pattern[1:]
-                elif pattern.endswith('%'):
-                    domain = pattern[:-1]
+                domain = pattern.strip('%')
                 if not re.match(RE_DOMAIN_SRCH, domain):
                     raise VMMException(
                     _(u"The pattern ā€œ%sā€ contains invalid characters.") %