# HG changeset patch
# User Pascal Volk <neverseen@users.sourceforge.net>
# Date 1272916806 0
# Node ID d30a94f5aef58f6b32da5db5e783309319449854
# Parent  ec19668282460b1fe7ded80e14e17461704d5e6f
VMM/Handler: import the errors before raising them.
Rephrased the 'permission error' message.

diff -r ec1966828246 -r d30a94f5aef5 VirtualMailManager/Handler.py
--- a/VirtualMailManager/Handler.py	Mon May 03 08:25:26 2010 +0000
+++ b/VirtualMailManager/Handler.py	Mon May 03 20:00:06 2010 +0000
@@ -28,7 +28,8 @@
 from VirtualMailManager.Config import Config as Cfg
 from VirtualMailManager.Domain import Domain, ace2idna, get_gid
 from VirtualMailManager.EmailAddress import EmailAddress
-from VirtualMailManager.errors import VMMError, DomainError
+from VirtualMailManager.errors import \
+     DomainError, NotRootError, PermissionError, VMMError
 from VirtualMailManager.Relocated import Relocated
 from VirtualMailManager.Transport import Transport
 
@@ -94,11 +95,11 @@
         fstat = os.stat(self._cfgFileName)
         fmode = int(oct(fstat.st_mode & 0777))
         if fmode % 100 and fstat.st_uid != fstat.st_gid or \
-            fmode % 10 and fstat.st_uid == fstat.st_gid:
-                raise PermissionError(_(
-                    u'fix permissions (%(perms)s) for ā€œ%(file)sā€\n\
-`chmod 0600 %(file)s` would be great.') % {'file':
-                    self._cfgFileName, 'perms': fmode}, ERR.CONF_WRONGPERM)
+           fmode % 10 and fstat.st_uid == fstat.st_gid:
+            raise PermissionError(_(u"wrong permissions for '%(file)s': \
+%(perms)s\n`chmod 0600 %(file)s` would be great.") %
+                                  {'file': self._cfgFileName, 'perms': fmode},
+                                  ERR.CONF_WRONGPERM)
         else:
             return True