* 'VirtualMailManager/VirtualMailManager.py'
authorPascal Volk <neverseen@users.sourceforge.net>
Sun, 24 Aug 2008 04:57:11 +0000
changeset 62 869de537a020
parent 61 d85482575349
child 63 9b627307f4a8
* 'VirtualMailManager/VirtualMailManager.py' - Made VirtualMailManager.domainInfo() more flexible * 'vmm' - Adjusted to changes in VirtualMailManager's domainInfo() * 'man/de/man1/vmm.1' * 'man/man1/vmm.1' - updated * 'po/de.po' * 'po/vmm.pot' - updated
VirtualMailManager/VirtualMailManager.py
man/de/man1/vmm.1
man/man1/vmm.1
po/de.po
po/vmm.pot
vmm
--- a/VirtualMailManager/VirtualMailManager.py	Sat Aug 23 22:25:21 2008 +0000
+++ b/VirtualMailManager/VirtualMailManager.py	Sun Aug 24 04:57:11 2008 +0000
@@ -479,7 +479,17 @@
         if self.__Cfg.getboolean('domdir', 'delete'):
             self.__domDirDelete(domdir, gid)
 
-    def domainInfo(self, domainname, detailed=None):
+    def domainInfo(self, domainname, details=None):
+        if details not in [None, 'accounts', 'aliasdomains', 'aliases', 'full',
+                'detailed']:
+            raise VMMDomainException(_(u'Invalid argument: »%s«') % details,
+                ERR.INVALID_OPTION)
+        if details == 'detailed':
+            details = 'full'
+            warning = _(u"""\
+The keyword »detailed« is deprecated and will be removed in a future release.
+    Please use the keyword »full« to get full details.""")
+            self.__warnings.append(warning)
         dom = self.__getDomain(domainname)
         dominfo = dom.getInfo()
         if dominfo['domainname'].startswith('xn--'):
@@ -487,14 +497,17 @@
                 % VirtualMailManager.ace2idna(dominfo['domainname'])
         if dominfo['aliases'] is None:
             dominfo['aliases'] = 0
-        if detailed is None:
+        if details is None:
             return dominfo
-        elif detailed == 'detailed':
+        elif details == 'accounts':
+            return (dominfo, dom.getAccounts())
+        elif details == 'aliasdomains':
+            return (dominfo, dom.getAliaseNames())
+        elif details == 'aliases':
+            return (dominfo, dom.getAliases())
+        else:
             return (dominfo, dom.getAliaseNames(), dom.getAccounts(),
                     dom.getAliases())
-        else:
-            raise VMMDomainException(_(u'Invalid argument: »%s«') % detailed,
-                ERR.INVALID_OPTION)
 
     def aliasDomainAdd(self, aliasname, domainname):
         """Adds an alias domain to the domain.
--- a/man/de/man1/vmm.1	Sat Aug 23 22:25:21 2008 +0000
+++ b/man/de/man1/vmm.1	Sun Aug 24 04:57:11 2008 +0000
@@ -1,5 +1,5 @@
 .\" $Id$
-.TH "VMM" "1" "23. Aug 2008" "Pascal Volk"
+.TH "VMM" "1" "24. Aug 2008" "Pascal Volk"
 .SH NAME
 vmm \- Programm für die Kommandozeile, um E-Mail-Domains, -Konten und -Aliase zu
 verwalten.
@@ -127,11 +127,29 @@
         vmm domainadd sales.example.com\fP
 .fi
 .TP
-\fBdomaininfo\fP (\fBdi\fP) \fIDomain\fP [ \fIdetailed\fP ]
+\fBdomaininfo\fP (\fBdi\fP) \fIDomain\fP [ \fIaccounts\fP | \fIaliasdomains\fP\
+ | \fIaliases\fP | \fIfull\fP ]
 Dieser Unterbefehl zeigt Information zur angegeben \fIDomain\fP an.
 .br
-Wurde das optionale Schlüsselwort '\fBdetailed\fP' angegeben, werden zusätzlich
-alle eingerichteten Alias-Domains, Konten und Aliase aufgelistet.
+Um detaillierte Informationen über die \fIDomain\fP zu erhalten, kann eines der
+folgenden Schlüsselwörter angegeben werden:
+.RS
+.PD 0
+.TP
+.B accounts
+um zusätzlich alle existierenden Konten aufzulisten.
+.TP
+.B aliasdomains
+um zusätzlich alle zugeordneten Alias-Domains aufzulisten.
+.TP
+.B aliases
+um zusätzlich alle verfügbaren Alias-Adressen aufzulisten.
+.TP
+.B full
+um alle oben genannten Informationen zusätzlich aufzulisten.
+.PD
+.RE
+.LP
 .PP
 .nf
         Beispiel:
--- a/man/man1/vmm.1	Sat Aug 23 22:25:21 2008 +0000
+++ b/man/man1/vmm.1	Sun Aug 24 04:57:11 2008 +0000
@@ -1,5 +1,5 @@
 .\" $Id$
-.TH "VMM" "1" "23. Aug 2008" "Pascal Volk"
+.TH "VMM" "1" "24. Aug 2008" "Pascal Volk"
 .SH NAME
 vmm \- command line tool to manage email domains/accounts/aliases
 .SH SYNOPSIS
@@ -121,12 +121,29 @@
         vmm domainadd sales.example.com\fP
 .fi
 .TP
-\fBdomaininfo\fP (\fBdi\fP) \fIdomain\fP [ \fIdetailed\fP ]
-This subcommand shows some information about the given domain.
+\fBdomaininfo\fP (\fBdi\fP) \fIdomain\fP [ \fIaccounts\fP | \fIaliasdomains\fP\
+ | \fIaliases\fP | \fIfull\fP ]
+This subcommand shows some information about the given \fIdomain\fP.
 .br
-If the keyword '\fBdetailed\fP' is specified as optional argument, all
-available alias domains, accounts and aliases will be listed.
-.PP
+For a more detailed information about the \fIdomain\fP one of the following
+keywords can be specified:
+.RS
+.PD 0
+.TP
+.B accounts
+in order to list additionally all existing accounts.
+.TP
+.B aliasdomains
+in order to list additionally all assigned alias domains.
+.TP
+.B aliases
+in order to list additionally all available aliases addresses.
+.TP
+.B full
+in order to list additionally all information mentioned above.
+.PD
+.RE
+.LP
 .nf
         Example:
 
@@ -161,7 +178,7 @@
 This subcommand deletes the specified \fIdomain\fP.
 .br
 If there are accounts and/or aliases assigned to the given domain, \fBvmm\fP
-will abort the requested operation and show a error message. If you know, what
+will abort the requested operation and show an error message. If you know, what
 you are doing, you can specify one of the following keywords: '\fBdelalias\fP', '\fBdeluser\fP' or '\fBdelall\fP'.
 .br
 
--- a/po/de.po	Sat Aug 23 22:25:21 2008 +0000
+++ b/po/de.po	Sun Aug 24 04:57:11 2008 +0000
@@ -6,8 +6,8 @@
 msgstr ""
 "Project-Id-Version: vmm 0.5\n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2008-08-22 23:51+0200\n"
-"PO-Revision-Date: 2008-08-23 04:38+0200\n"
+"POT-Creation-Date: 2008-08-24 04:32+0200\n"
+"PO-Revision-Date: 2008-08-24 04:42+0200\n"
 "Last-Translator: Pascal Volk <p.volk@veb-it.de>\n"
 "Language-Team: German\n"
 "MIME-Version: 1.0\n"
@@ -326,17 +326,27 @@
 msgstr "Ungültiges Argument: '%s'"
 
 #: VirtualMailManager/VirtualMailManager.py:466
-#: VirtualMailManager/VirtualMailManager.py:496
+#: VirtualMailManager/VirtualMailManager.py:485
 #, python-format
 msgid "Invalid argument: »%s«"
 msgstr "Ungültiges Argument: »%s«"
 
-#: VirtualMailManager/VirtualMailManager.py:540
+#: VirtualMailManager/VirtualMailManager.py:489
+msgid ""
+"The keyword »detailed« is deprecated and will be removed in a future "
+"release.\n"
+"    Please use the keyword »full« to get full details."
+msgstr ""
+"Das Schlüsselwort »detailed« ist veraltet und wird in einer zukünftigen\n"
+"    Version entfernt werden.\n"
+"    Verwenden Sie bitte das Schlüsselwort »full«, um alle Details zu erhalten."
+
+#: VirtualMailManager/VirtualMailManager.py:553
 #, python-format
 msgid "The pattern »%s« contains invalid characters."
 msgstr "Das Muster »%s« enthält ungültige Zeichen."
 
-#: VirtualMailManager/VirtualMailManager.py:572
+#: VirtualMailManager/VirtualMailManager.py:585
 #, python-format
 msgid ""
 "The account has been successfully deleted from the database.\n"
@@ -349,7 +359,7 @@
 "    »%(directory)s«\n"
 "    Grund: %(raeson)s"
 
-#: VirtualMailManager/VirtualMailManager.py:604
+#: VirtualMailManager/VirtualMailManager.py:617
 msgid "Account doesn't exists"
 msgstr "Der Account existiert nicht"
 
@@ -364,48 +374,48 @@
 "  kurz  lang\n"
 "  Unterbefehl              Objekt            args (* = optional)\n"
 
-#: vmm:75 vmm:86 vmm:422
+#: vmm:76 vmm:87 vmm:431
 msgid "Error"
 msgstr "Fehler"
 
-#: vmm:108
+#: vmm:109
 msgid "information"
 msgstr "Informationen"
 
-#: vmm:118
+#: vmm:119
 msgid "Available"
 msgstr "Verfügbare"
 
-#: vmm:121 vmm:211
+#: vmm:122 vmm:215 vmm:219
 msgid "alias domains"
 msgstr "Alias-Domains"
 
-#: vmm:131 vmm:142 vmm:160
+#: vmm:132 vmm:143 vmm:161
 msgid "\tNone"
 msgstr "\tKeine"
 
-#: vmm:135
+#: vmm:136
 msgid "Alias information"
 msgstr "Alias Informationen"
 
-#: vmm:137
+#: vmm:138
 #, python-format
 msgid "\tMail for %s will be redirected to:"
 msgstr "\tE-Mails für %s werden weitergeleitet an:"
 
-#: vmm:155
+#: vmm:156
 msgid "Available domains"
 msgstr "Verfügbare Domains"
 
-#: vmm:157
+#: vmm:158
 msgid "Matching domains"
 msgstr "Übereinstimmende Domains"
 
-#: vmm:171
+#: vmm:172
 msgid "Alias domain information"
 msgstr "Alias-Domain Informationen"
 
-#: vmm:177
+#: vmm:178
 #, python-format
 msgid ""
 "\tThe alias domain %(alias)s belongs to:\n"
@@ -418,86 +428,90 @@
 msgid "Missing domain name."
 msgstr "Kein Domain-Name angegeben."
 
-#: vmm:207 vmm:210
+#: vmm:207 vmm:211
 msgid "Domain"
 msgstr "Domain"
 
-#: vmm:212
+#: vmm:213 vmm:220
 msgid "accounts"
 msgstr "Accounts"
 
-#: vmm:213
+#: vmm:217 vmm:221
 msgid "aliases"
 msgstr "Aliase"
 
-#: vmm:217
+#: vmm:225
 msgid "Missing domain name and new transport."
 msgstr "Domain-Name und neuer Transport fehlen."
 
-#: vmm:219
+#: vmm:227
 msgid "Missing new transport."
 msgstr "Neuer Transport fehlt."
 
-#: vmm:228
+#: vmm:236
 msgid "Missing alias domain name and target domain name."
 msgstr "Domain-Namen für Alias- und Ziel-Domain fehlen."
 
-#: vmm:230
+#: vmm:238
 msgid "Missing target domain name."
 msgstr "Keine Ziel-Domain angegeben."
 
-#: vmm:236 vmm:242
+#: vmm:244 vmm:250
 msgid "Missing alias domain name."
 msgstr "Keine Alias-Domain angegeben."
 
-#: vmm:248 vmm:257 vmm:263 vmm:287 vmm:295 vmm:303
+#: vmm:256 vmm:265 vmm:271 vmm:295 vmm:303 vmm:311
 msgid "Missing e-mail address."
 msgstr "E-Mail-Adresse fehlt."
 
-#: vmm:271
+#: vmm:279
 msgid "Missing e-mail address and users name."
 msgstr "E-Mail-Adresse und der Name des Benutzers fehlen."
 
-#: vmm:273
+#: vmm:281
 msgid "Missing users name."
 msgstr "Name des Benutzers fehlt."
 
-#: vmm:279
+#: vmm:287
 msgid "Missing e-mail address and transport."
 msgstr "E-Mail-Adresse und Transport fehlen."
 
-#: vmm:281
+#: vmm:289
 msgid "Missing transport."
 msgstr "Transport fehlt."
 
-#: vmm:312
+#: vmm:320
 msgid "Missing alias address and destination."
 msgstr "Alias- und Ziel-Adresse fehlen."
 
-#: vmm:318 vmm:324
+#: vmm:326 vmm:332
 msgid "Missing alias address"
 msgstr "Alias-Adresse fehlt."
 
-#: vmm:332
+#: vmm:340
 msgid "Missing userid"
 msgstr "Keine UID angegeben."
 
-#: vmm:345
+#: vmm:353
 msgid "Warnings:"
 msgstr "Warnungen:"
 
-#: vmm:350
+#: vmm:358
 msgid "version"
 msgstr "Version"
 
-#: vmm:351
+#: vmm:359
 msgid "from"
 msgstr "vom"
 
-#: vmm:417
+#: vmm:361
+msgid "on"
+msgstr ""
+
+#: vmm:426
 msgid "Unknown subcommand"
 msgstr "Unbekannter Unterbefehl"
 
-#: vmm:420
+#: vmm:429
 msgid "Ouch"
 msgstr "Autsch"
--- a/po/vmm.pot	Sat Aug 23 22:25:21 2008 +0000
+++ b/po/vmm.pot	Sun Aug 24 04:57:11 2008 +0000
@@ -8,7 +8,7 @@
 msgstr ""
 "Project-Id-Version: vmm 0.5\n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2008-08-23 00:12+0200\n"
+"POT-Creation-Date: 2008-08-24 04:32+0200\n"
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
 "Language-Team: LANGUAGE <LL@li.org>\n"
@@ -315,17 +315,24 @@
 msgstr ""
 
 #: VirtualMailManager/VirtualMailManager.py:466
-#: VirtualMailManager/VirtualMailManager.py:496
+#: VirtualMailManager/VirtualMailManager.py:485
 #, python-format
 msgid "Invalid argument: »%s«"
 msgstr ""
 
-#: VirtualMailManager/VirtualMailManager.py:540
+#: VirtualMailManager/VirtualMailManager.py:489
+msgid ""
+"The keyword »detailed« is deprecated and will be removed in a future "
+"release.\n"
+"    Please use the keyword »full« to get full details."
+msgstr ""
+
+#: VirtualMailManager/VirtualMailManager.py:553
 #, python-format
 msgid "The pattern »%s« contains invalid characters."
 msgstr ""
 
-#: VirtualMailManager/VirtualMailManager.py:572
+#: VirtualMailManager/VirtualMailManager.py:585
 #, python-format
 msgid ""
 "The account has been successfully deleted from the database.\n"
@@ -334,7 +341,7 @@
 "    Reason: %(raeson)s"
 msgstr ""
 
-#: VirtualMailManager/VirtualMailManager.py:604
+#: VirtualMailManager/VirtualMailManager.py:617
 msgid "Account doesn't exists"
 msgstr ""
 
@@ -346,48 +353,48 @@
 "  subcommand               object            args (* = optional)\n"
 msgstr ""
 
-#: vmm:75 vmm:86 vmm:422
+#: vmm:76 vmm:87 vmm:431
 msgid "Error"
 msgstr ""
 
-#: vmm:108
+#: vmm:109
 msgid "information"
 msgstr ""
 
-#: vmm:118
+#: vmm:119
 msgid "Available"
 msgstr ""
 
-#: vmm:121 vmm:211
+#: vmm:122 vmm:215 vmm:219
 msgid "alias domains"
 msgstr ""
 
-#: vmm:131 vmm:142 vmm:160
+#: vmm:132 vmm:143 vmm:161
 msgid "\tNone"
 msgstr ""
 
-#: vmm:135
+#: vmm:136
 msgid "Alias information"
 msgstr ""
 
-#: vmm:137
+#: vmm:138
 #, python-format
 msgid "\tMail for %s will be redirected to:"
 msgstr ""
 
-#: vmm:155
+#: vmm:156
 msgid "Available domains"
 msgstr ""
 
-#: vmm:157
+#: vmm:158
 msgid "Matching domains"
 msgstr ""
 
-#: vmm:171
+#: vmm:172
 msgid "Alias domain information"
 msgstr ""
 
-#: vmm:177
+#: vmm:178
 #, python-format
 msgid ""
 "\tThe alias domain %(alias)s belongs to:\n"
@@ -398,86 +405,90 @@
 msgid "Missing domain name."
 msgstr ""
 
-#: vmm:207 vmm:210
+#: vmm:207 vmm:211
 msgid "Domain"
 msgstr ""
 
-#: vmm:212
+#: vmm:213 vmm:220
 msgid "accounts"
 msgstr ""
 
-#: vmm:213
+#: vmm:217 vmm:221
 msgid "aliases"
 msgstr ""
 
-#: vmm:217
+#: vmm:225
 msgid "Missing domain name and new transport."
 msgstr ""
 
-#: vmm:219
+#: vmm:227
 msgid "Missing new transport."
 msgstr ""
 
-#: vmm:228
+#: vmm:236
 msgid "Missing alias domain name and target domain name."
 msgstr ""
 
-#: vmm:230
+#: vmm:238
 msgid "Missing target domain name."
 msgstr ""
 
-#: vmm:236 vmm:242
+#: vmm:244 vmm:250
 msgid "Missing alias domain name."
 msgstr ""
 
-#: vmm:248 vmm:257 vmm:263 vmm:287 vmm:295 vmm:303
+#: vmm:256 vmm:265 vmm:271 vmm:295 vmm:303 vmm:311
 msgid "Missing e-mail address."
 msgstr ""
 
-#: vmm:271
+#: vmm:279
 msgid "Missing e-mail address and users name."
 msgstr ""
 
-#: vmm:273
+#: vmm:281
 msgid "Missing users name."
 msgstr ""
 
-#: vmm:279
+#: vmm:287
 msgid "Missing e-mail address and transport."
 msgstr ""
 
-#: vmm:281
+#: vmm:289
 msgid "Missing transport."
 msgstr ""
 
-#: vmm:312
+#: vmm:320
 msgid "Missing alias address and destination."
 msgstr ""
 
-#: vmm:318 vmm:324
+#: vmm:326 vmm:332
 msgid "Missing alias address"
 msgstr ""
 
-#: vmm:332
+#: vmm:340
 msgid "Missing userid"
 msgstr ""
 
-#: vmm:345
+#: vmm:353
 msgid "Warnings:"
 msgstr ""
 
-#: vmm:350
+#: vmm:358
 msgid "version"
 msgstr ""
 
-#: vmm:351
+#: vmm:359
 msgid "from"
 msgstr ""
 
-#: vmm:417
+#: vmm:361
+msgid "on"
+msgstr ""
+
+#: vmm:426
 msgid "Unknown subcommand"
 msgstr ""
 
-#: vmm:420
+#: vmm:429
 msgid "Ouch"
 msgstr ""
--- a/vmm	Sat Aug 23 22:25:21 2008 +0000
+++ b/vmm	Sun Aug 24 04:57:11 2008 +0000
@@ -45,7 +45,8 @@
 
     u_body = """\
   da    domainadd          domain.tld        transport*
-  di    domaininfo         domain.tld        detailed*
+  di    domaininfo         domain.tld        accounts*|aliasdomains*|aliases*
+                                             |full*
   dt    domaintransport    domain.tld        transport force*
   dd    domaindelete       domain.tld        delalias*|deluser*|delall*
   ada   aliasdomainadd     aliasdomain.tld   domain.tld
@@ -205,11 +206,19 @@
     elif argc < 4:
         _printInfo(vmm.domainInfo(argv[2].lower()), _('Domain'))
     else:
-        infos = vmm.domainInfo(argv[2].lower(), argv[3])
+        details = argv[3].lower()
+        infos = vmm.domainInfo(argv[2].lower(), details)
         _printInfo(infos[0], _('Domain'))
-        _printList(infos[1], _('alias domains'))
-        _printList(infos[2], _('accounts'))
-        _printList(infos[3], _('aliases'))
+        if details == 'accounts':
+            _printList(infos[1], _('accounts'))
+        elif details == 'aliasdomains':
+            _printList(infos[1], _('alias domains'))
+        elif details == 'aliases':
+            _printList(infos[1], _('aliases'))
+        else:
+            _printList(infos[1], _('alias domains'))
+            _printList(infos[2], _('accounts'))
+            _printList(infos[3], _('aliases'))
 
 def domain_transport():
     if argc < 3: