# HG changeset patch
# User Tobias Berling <mail@tobiasberling.de>
# Date 1270421098 0
# Node ID 09b7e3fe29b39670c6373bd75851adb3767d1ff7
# Parent  084331dd1e4c6ed1c4589a7f2d6147045483245f
VMM/Handler: compressed Handler.domainList() and replaced ā€œ%sā€ with '%s' in
error message.

diff -r 084331dd1e4c -r 09b7e3fe29b3 VirtualMailManager/Handler.py
--- a/VirtualMailManager/Handler.py	Sun Apr 04 08:16:46 2010 +0000
+++ b/VirtualMailManager/Handler.py	Sun Apr 04 22:44:58 2010 +0000
@@ -516,15 +516,10 @@
         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 VMMError(
-                    _(u"The pattern ā€œ%sā€ contains invalid characters.") %
+                    _(u"The pattern '%s' contains invalid characters.") %
                     pattern, ERR.DOMAIN_INVALID)
         self.__dbConnect()
         return search(self._dbh, pattern=pattern, like=like)