* VirtualMailManager/Account.py:
authorPascal Volk <neverseen@users.sourceforge.net>
Wed, 09 Jan 2008 14:47:30 +0000
changeset 3 a9b44e04bf01
parent 2 9b39f828aa8a
child 4 f3c30b7421b9
* VirtualMailManager/Account.py: * VirtualMailManager/Alias.py: * VirtualMailManager/Domain.py: * VirtualMailManager/VirtualMailManager.py: * vmm: Replaced email with e-mail. Corrected opening/closing quotation marks («word» -> »word«). * VirtualMailManager/VirtualMailManager.py: Renamed VirtualMailManager.__chkEmailadress to VirtualMailManager.__chkEmailAddress. * ChangeLog: Added to repository.
ChangeLog
VirtualMailManager/Account.py
VirtualMailManager/Alias.py
VirtualMailManager/Domain.py
VirtualMailManager/VirtualMailManager.py
vmm
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ChangeLog	Wed Jan 09 14:47:30 2008 +0000
@@ -0,0 +1,26 @@
+=== 0.0.0 ===
+2008-01-09  Pascal Volk  <neverseen@users.sourceforge.net>
+
+	* VirtualMailManager/Account.py:
+	* VirtualMailManager/Alias.py:
+	* VirtualMailManager/Domain.py:
+	* VirtualMailManager/VirtualMailManager.py:
+	* vmm: Replaced email with e-mail.
+	Corrected opening/closing quotation marks («word» -> »word«).
+
+	* VirtualMailManager/VirtualMailManager.py: Renamed
+	VirtualMailManager.__chkEmailadress to
+	VirtualMailManager.__chkEmailAddress.
+
+	* ChangeLog: Added to repository.
+
+=== 0.3.1 ===
+2008-01-08  Pascal Volk  <neverseen@users.sourceforge.net>
+
+	* vmm (getVMM): Fixed names names of excepted errors.
+
+	* VirtualMailManager/VirtualMailManager.py (VirtualMailManager.__init__):
+	activated check for missing sections/options
+
+	* vmm-0.3.1.tar.bz2: It's really bzip2 compressed. ;-)
+
--- a/VirtualMailManager/Account.py	Tue Jan 08 21:35:40 2008 +0000
+++ b/VirtualMailManager/Account.py	Wed Jan 09 14:47:30 2008 +0000
@@ -4,7 +4,7 @@
 # See COPYING for distribution information.
 # $Id$
 
-"""Virtual Mail Manager's Account class to manage email accounts."""
+"""Virtual Mail Manager's Account class to manage e-mail accounts."""
 
 __author__ = 'Pascal Volk <p.volk@veb-it.de>'
 __version__ = 'rev '+'$Rev$'.split()[1]
@@ -15,7 +15,7 @@
 import constants.ERROR as ERR
 
 class Account:
-    """Class to manage email accounts."""
+    """Class to manage e-mail accounts."""
     def __init__(self, dbh, basedir, address, password=None):
         self._dbh = dbh
         self._base = basedir
@@ -31,7 +31,7 @@
         self._exists()
         if self._isAlias():
             raise VMMAccountException(
-            ('There is already an alias with address «%s»' % address,
+            ('There is already an alias with address »%s«' % address,
                 ERR.ALIAS_EXISTS))
 
     def _exists(self):
@@ -63,7 +63,7 @@
         self._gid = dom.getID()
         self._base = dom.getDir()
         if self._gid == 0:
-            raise VMMAccountException(("Domain %s doesn't exist." % d,
+            raise VMMAccountException(("Domain »%s« doesn't exist." % d,
                 ERR.NO_SUCH_DOMAIN))
 
     def _setID(self):
--- a/VirtualMailManager/Alias.py	Tue Jan 08 21:35:40 2008 +0000
+++ b/VirtualMailManager/Alias.py	Wed Jan 09 14:47:30 2008 +0000
@@ -4,7 +4,7 @@
 # See COPYING for distribution information.
 # $Id$
 
-"""Virtual Mail Manager's Alias class to manage email aliases."""
+"""Virtual Mail Manager's Alias class to manage e-mail aliases."""
 
 __author__ = 'Pascal Volk <p.volk@veb-it.de>'
 __version__ = 'rev '+'$Rev$'.split()[1]
@@ -15,7 +15,7 @@
 import constants.ERROR as ERR
 
 class Alias:
-    """Class to manage email accounts."""
+    """Class to manage e-mail accounts."""
     def __init__(self, dbh, address, basedir, destination=None):
         if address == destination:
             raise VMMAliasException(('Address and destination are identical.',
@@ -31,7 +31,7 @@
             self._exists()
         if self._isAccount():
             raise VMMAliasException(
-            ('There is already an account with address «%s»' % self._addr,
+            ('There is already an account with address »%s«' % self._addr,
                 ERR.ACCOUNT_EXISTS))
 
     def _exists(self):
@@ -62,7 +62,7 @@
         dom = Domain(self._dbh, d, basedir)
         self._gid = dom.getID()
         if self._gid == 0:
-            raise VMMAliasException(("Domain «%s» doesn't exist." % d,
+            raise VMMAliasException(("Domain »%s« doesn't exist." % d,
                 ERR.NO_SUCH_DOMAIN))
 
     def save(self):
--- a/VirtualMailManager/Domain.py	Tue Jan 08 21:35:40 2008 +0000
+++ b/VirtualMailManager/Domain.py	Wed Jan 09 14:47:30 2008 +0000
@@ -4,7 +4,7 @@
 # See COPYING for distribution information.
 # $Id$
 
-"""Virtual Mail Manager's Domain class to manage email domains."""
+"""Virtual Mail Manager's Domain class to manage e-mail domains."""
 
 __author__ = 'Pascal Volk <p.volk@veb-it.de>'
 __version__ = 'rev '+'$Rev$'.split()[1]
@@ -18,7 +18,7 @@
 MAILDIR_CHARS = '0123456789abcdefghijklmnopqrstuvwxyz'
 
 class Domain:
-    """Class to manage email domains."""
+    """Class to manage e-mail domains."""
     def __init__(self, dbh, domainname, basedir, transport=None):
         """Creates a new Domain instance.
         
--- a/VirtualMailManager/VirtualMailManager.py	Tue Jan 08 21:35:40 2008 +0000
+++ b/VirtualMailManager/VirtualMailManager.py	Wed Jan 09 14:47:30 2008 +0000
@@ -42,8 +42,8 @@
         Throws a VMMNotRootException if your uid is greater 0.
         """
         self.__cfgFileName = '/usr/local/etc/vmm.cfg'
-        self.__permWarnMsg = "fix permissions for '"+self.__cfgFileName \
-            +"'.\n`chmod 0600 "+self.__cfgFileName+"` would be great.\n"
+        self.__permWarnMsg = "fix permissions for '%s'\n`chmod 0600 %s` would\
+ be great." % (self.__cfgFileName, self.__cfgFileName)
         self.__warnings = []
         self.__Cfg = None
         self.__dbh = None
@@ -114,17 +114,17 @@
             raise VMMException((str(e), ERR.DATABASE_ERROR))
 
     def __chkLocalpart(self, localpart):
-        """Validates the local part of an email address.
+        """Validates the local part of an e-mail address.
         
         Keyword arguments:
-        localpart -- the email address that should be validated (str)
+        localpart -- the e-mail address that should be validated (str)
         """
         if len(localpart) > 64:
             raise VMMException(('The local part is too long',
                 ERR.LOCALPART_TOO_LONG))
         if re.compile(RE_LOCALPART).search(localpart):
             raise VMMException((
-                'The local part «%s» contains invalid characters.' % localpart,
+                'The local part »%s« contains invalid characters.' % localpart,
                 ERR.LOCALPART_INVALID))
         return localpart
 
@@ -155,7 +155,7 @@
         return '.'.join(tmp)
 
     def __chkDomainname(self, domainname):
-        """Validates the domain name of an email address.
+        """Validates the domain name of an e-mail address.
         
         Keyword arguments:
         domainname -- the domain name that should be validated
@@ -170,21 +170,21 @@
                 ERR.DOMAIN_INVALID))
         return domainname
 
-    def __chkEmailadress(self, address):
+    def __chkEmailAddress(self, address):
         try:
             localpart, domain = address.split('@')
         except ValueError:
-            raise VMMException(("Missing '@' sign in emailaddress «%s»." %
+            raise VMMException(("Missing '@' sign in e-mail address »%s«." %
                 address, ERR.INVALID_ADDRESS))
         except AttributeError:
-            raise VMMException(("'%s' looks not like an email address." %
+            raise VMMException(("»%s« looks not like an e-mail address." %
                 address, ERR.INVALID_ADDRESS))
         domain = self.__chkDomainname(domain)
         localpart = self.__chkLocalpart(localpart)
         return '%s@%s' % (localpart, domain)
 
     def __getAccount(self, address, password=None):
-        address = self.__chkEmailadress(address)
+        address = self.__chkEmailAddress(address)
         self.__dbConnect()
         if not password is None:
             password = self.__pwhash(password)
@@ -192,10 +192,10 @@
                 password)
 
     def __getAlias(self, address, destination=None):
-        address = self.__chkEmailadress(address)
+        address = self.__chkEmailAddress(address)
         if not destination is None:
             if destination.count('@'):
-                destination = self.__chkEmailadress(destination)
+                destination = self.__chkEmailAddress(destination)
             else:
                 destination = self.__chkLocalpart(destination)
         self.__dbConnect()
@@ -339,7 +339,7 @@
             if not section:
                 self.__Cfg.configure(self.__cfgSections)
             elif section not in self.__cfgSections:
-                raise VMMException(("Invalid section: «%s»" % section,
+                raise VMMException(("Invalid section: »%s«" % section,
                     ERR.INVALID_SECTION))
             else:
                 self.__Cfg.configure([section])
@@ -357,7 +357,7 @@
 
     def domain_delete(self, domainname, force=None):
         if not force is None and force not in ['deluser','delalias','delall']:
-            raise VMMDomainException(('Invalid option: «%s»' % force,
+            raise VMMDomainException(('Invalid argument: «%s»' % force,
                 ERR.INVALID_OPTION))
         dom = self.__getDomain(domainname)
         gid = dom.getID()
@@ -386,7 +386,7 @@
         elif detailed == 'detailed':
             return dominfo, dom.getAccounts(), dom.getAliases()
         else:
-            raise VMMDomainException(('Invalid option: «%s»' % detailed,
+            raise VMMDomainException(('Invalid argument: »%s«' % detailed,
                 ERR.INVALID_OPTION))
 
     def user_add(self, emailaddress, password):
--- a/vmm	Tue Jan 08 21:35:40 2008 +0000
+++ b/vmm	Wed Jan 09 14:47:30 2008 +0000
@@ -155,7 +155,7 @@
 def user_add():
     global argc
     if argc < 3:
-        usage(EXIT.MISSING_ARGS, 'Missing email address.')
+        usage(EXIT.MISSING_ARGS, 'Missing e-mail address.')
     elif argc < 4:
         password = _readpass()
     else:
@@ -165,14 +165,14 @@
 def user_delete():
     global argc
     if argc < 3:
-        usage(EXIT.MISSING_ARGS, 'Missing email address.')
+        usage(EXIT.MISSING_ARGS, 'Missing e-mail address.')
     else:
         vmm.user_delete(sys.argv[2].lower())
 
 def user_info():
     global argc
     if argc < 3:
-        usage(EXIT.MISSING_ARGS, 'Missing email address.')
+        usage(EXIT.MISSING_ARGS, 'Missing e-mail address.')
     elif argc < 4:
         _printInfo(vmm.user_info(sys.argv[2].lower()), 'Account')
     else:
@@ -181,7 +181,7 @@
 def user_name():
     global argc
     if argc < 3:
-        usage(EXIT.MISSING_ARGS, 'Missing email address and users name.')
+        usage(EXIT.MISSING_ARGS, 'Missing e-mail address and users name.')
     if argc < 4:
         usage(EXIT.MISSING_ARGS, 'Missing users name.')
     else:
@@ -190,21 +190,21 @@
 def user_enable():
     global argc
     if argc < 3:
-        usage(EXIT.MISSING_ARGS, 'Missing email address.')
+        usage(EXIT.MISSING_ARGS, 'Missing e-mail address.')
     else:
         vmm.user_enable(sys.argv[2].lower())
 
 def user_disable():
     global argc
     if argc < 3:
-        usage(EXIT.MISSING_ARGS, 'Missing email address.')
+        usage(EXIT.MISSING_ARGS, 'Missing e-mail address.')
     else:
         vmm.user_disable(sys.argv[2].lower())
 
 def user_password():
     global argc
     if argc < 3:
-        usage(EXIT.MISSING_ARGS, 'Missing email address.')
+        usage(EXIT.MISSING_ARGS, 'Missing e-mail address.')
     elif argc < 4:
         password = _readpass()
     else: