This list is closed, nobody may subscribe to it.
| 2009 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(2) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2010 |
Jan
(18) |
Feb
(43) |
Mar
(11) |
Apr
(50) |
May
(10) |
Jun
|
Jul
(39) |
Aug
(30) |
Sep
|
Oct
|
Nov
|
Dec
|
| 2011 |
Jan
(14) |
Feb
(43) |
Mar
(2) |
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
|
Sep
(4) |
Oct
(12) |
Nov
(45) |
Dec
(3) |
| 2012 |
Jan
|
Feb
|
Mar
(2) |
Apr
(65) |
May
(2) |
Jun
(19) |
Jul
(6) |
Aug
(19) |
Sep
(23) |
Oct
(11) |
Nov
(21) |
Dec
(16) |
| 2013 |
Jan
(21) |
Feb
(2) |
Mar
(2) |
Apr
|
May
|
Jun
(2) |
Jul
|
Aug
(2) |
Sep
|
Oct
|
Nov
|
Dec
|
| 2014 |
Jan
(4) |
Feb
(34) |
Mar
(10) |
Apr
|
May
|
Jun
(10) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
|
|
|
|
|
|
|
1
(1) |
|
2
(2) |
3
(1) |
4
|
5
|
6
|
7
|
8
(1) |
|
9
(3) |
10
|
11
|
12
|
13
|
14
|
15
|
|
16
|
17
|
18
|
19
|
20
|
21
(1) |
22
|
|
23
|
24
|
25
|
26
|
27
|
28
|
29
|
|
30
(7) |
31
|
|
|
|
|
|
|
From: <nev...@us...> - 2012-12-30 18:14:50
|
details: http://hg.localdomain.org/vmm/rev/a9d86ccac044 changeset: 671:a9d86ccac044 user: Pascal Volk date: Sun Dec 30 18:13:56 2012 +0000 description: VMM/*: Post-2to3 fix. Updated some error messages/comments. Replaced `long' by `int' - part II. diffstat: VirtualMailManager/domain.py | 2 +- VirtualMailManager/serviceset.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diffs (24 lines): diff -r f374ef062c94 -r a9d86ccac044 VirtualMailManager/domain.py --- a/VirtualMailManager/domain.py Sun Dec 30 18:08:23 2012 +0000 +++ b/VirtualMailManager/domain.py Sun Dec 30 18:13:56 2012 +0000 @@ -149,7 +149,7 @@ `column` : basestring Name of the table column. Currently: qid, ssid and tid - `value` : long + `value` : int The referenced key `force` : bool reset existing users. Default: `False` diff -r f374ef062c94 -r a9d86ccac044 VirtualMailManager/serviceset.py --- a/VirtualMailManager/serviceset.py Sun Dec 30 18:08:23 2012 +0000 +++ b/VirtualMailManager/serviceset.py Sun Dec 30 18:13:56 2012 +0000 @@ -19,7 +19,7 @@ Each ServiceSet object provides following - read only - attributes: - `ssid` : long + `ssid` : int The id of the service set `smtp` : bool Boolean flag for service smtp |
|
From: <nev...@us...> - 2012-12-30 18:08:48
|
details: http://hg.localdomain.org/vmm/rev/f374ef062c94 changeset: 670:f374ef062c94 user: Pascal Volk date: Sun Dec 30 18:08:23 2012 +0000 description: VMM/*: Post-2to3 fix. Updated some error messages/comments. Replaced `long' by `int' (or integer). diffstat: VirtualMailManager/account.py | 6 +++--- VirtualMailManager/common.py | 10 +++++----- VirtualMailManager/config.py | 2 +- VirtualMailManager/handler.py | 6 +++--- VirtualMailManager/quotalimit.py | 2 +- VirtualMailManager/transport.py | 2 +- 6 files changed, 14 insertions(+), 14 deletions(-) diffs (131 lines): diff -r d765a878f0fc -r f374ef062c94 VirtualMailManager/account.py --- a/VirtualMailManager/account.py Sun Dec 30 16:41:19 2012 +0000 +++ b/VirtualMailManager/account.py Sun Dec 30 18:08:23 2012 +0000 @@ -133,7 +133,7 @@ `column` : basestring Name of the table column. Currently: qid, ssid and tid - `value` : long + `value` : int The referenced key """ if column not in ('qid', 'ssid', 'tid'): @@ -460,7 +460,7 @@ Argument: - `uid` : long + `uid` : int The Account unique ID. `dbh` : pyPgSQL.PgSQL.Connection a database connection for the database access. @@ -468,7 +468,7 @@ try: uid = int(uid) except ValueError: - raise AErr(_('UID must be an int/long.'), INVALID_ARGUMENT) + raise AErr(_('UID must be an integer.'), INVALID_ARGUMENT) if uid < 1: raise AErr(_('UID must be greater than 0.'), INVALID_ARGUMENT) dbc = dbh.cursor() diff -r d765a878f0fc -r f374ef062c94 VirtualMailManager/common.py --- a/VirtualMailManager/common.py Sun Dec 30 16:41:19 2012 +0000 +++ b/VirtualMailManager/common.py Sun Dec 30 18:08:23 2012 +0000 @@ -74,9 +74,9 @@ try: size = int(size) except ValueError: - raise TypeError("'size' must be a positive long or int.") + raise TypeError("'size' must be a positive integer.") if size < 0: - raise ValueError("'size' must be a positive long or int.") + raise ValueError("'size' must be a positive integer.") if size < 1024: return str(size) # TP: abbreviations of gibibyte, tebibyte kibibyte and mebibyte @@ -92,7 +92,7 @@ def size_in_bytes(size): - """Converts the string `size` to a long (size in bytes). + """Converts the string `size` to an integer (size in bytes). The string `size` can be suffixed with *b* (bytes), *k* (kilobytes), *M* (megabytes) or *G* (gigabytes). @@ -183,14 +183,14 @@ def version_str(version): """Converts a Dovecot version previously converted with version_hex back to a string. - Raises a `TypeError` if *version* is not an int/long. + Raises a `TypeError` if *version* is not an integer. Raises a `ValueError` if *version* is an incorrect int version. """ global _version_cache if version in _version_cache: return _version_cache[version] if not isinstance(version, int): - raise TypeError('Argument is not a int/long: %r', version) + raise TypeError('Argument is not a integer: %r', version) major = (version >> 28) & 0xFF minor = (version >> 20) & 0xFF patch = (version >> 12) & 0xFF diff -r d765a878f0fc -r f374ef062c94 VirtualMailManager/config.py --- a/VirtualMailManager/config.py Sun Dec 30 16:41:19 2012 +0000 +++ b/VirtualMailManager/config.py Sun Dec 30 18:08:23 2012 +0000 @@ -406,7 +406,7 @@ def get_in_bytes(self, section, option): """Converts the size value (e.g.: 1024k) from the *option*'s - value to a long""" + value to a integer""" return size_in_bytes(self.get(section, option)) def str(self, section, option): diff -r d765a878f0fc -r f374ef062c94 VirtualMailManager/handler.py --- a/VirtualMailManager/handler.py Sun Dec 30 16:41:19 2012 +0000 +++ b/VirtualMailManager/handler.py Sun Dec 30 18:08:23 2012 +0000 @@ -345,9 +345,9 @@ `domdir` : basestring The directory of the domain the user belongs to (commonly AccountObj.domain.directory) - `uid` : int/long + `uid` : int The user's UID (commonly AccountObj.uid) - `gid` : int/long + `gid` : int The user's GID (commonly AccountObj.gid) """ assert all(isinstance(xid, int) for xid in (uid, gid)) and \ @@ -382,7 +382,7 @@ `domdir` : basestring The domain's directory (commonly DomainObj.directory) - `gid` : int/long + `gid` : int The domain's GID (commonly DomainObj.gid) """ assert isinstance(domdir, str) and isinstance(gid, int) diff -r d765a878f0fc -r f374ef062c94 VirtualMailManager/quotalimit.py --- a/VirtualMailManager/quotalimit.py Sun Dec 30 16:41:19 2012 +0000 +++ b/VirtualMailManager/quotalimit.py Sun Dec 30 18:08:23 2012 +0000 @@ -32,7 +32,7 @@ `qid` : int The id of a quota limit - `bytes` : long + `bytes` : int The quota limit in bytes. `messages` : int The quota limit in number of messages diff -r d765a878f0fc -r f374ef062c94 VirtualMailManager/transport.py --- a/VirtualMailManager/transport.py Sun Dec 30 16:41:19 2012 +0000 +++ b/VirtualMailManager/transport.py Sun Dec 30 18:08:23 2012 +0000 @@ -24,7 +24,7 @@ Keyword arguments: dbh -- a pyPgSQL.PgSQL.connection - tid -- the id of a transport (int/long) + tid -- the id of a transport (int) transport -- the value of the transport (str) """ |
|
From: <nev...@us...> - 2012-12-30 16:41:31
|
details: http://hg.localdomain.org/vmm/rev/d765a878f0fc changeset: 669:d765a878f0fc user: Pascal Volk date: Sun Dec 30 16:41:19 2012 +0000 description: VMM/cli/clihelp: Removed module clihelp. It's no longer needed. Online help is included in the subcommand module. diffstat: VirtualMailManager/cli/clihelp.py | 261 -------------------------------------- 1 files changed, 0 insertions(+), 261 deletions(-) diffs (265 lines): diff -r b4396a78c996 -r d765a878f0fc VirtualMailManager/cli/clihelp.py --- a/VirtualMailManager/cli/clihelp.py Sun Dec 30 16:16:09 2012 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,261 +0,0 @@ -# -*- coding: UTF-8 -*- -# Copyright (c) 2012, Pascal Volk -# See COPYING for distribution information. -""" - VirtualMailManager.cli.vmmhelp - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - - Virtual Mail Manager's command line help. -""" - -_ = lambda msg: msg - -help_msgs = { -# TP: There are some words enclosed within angle brackets '<'word'>'. They -# are used to indicate replaceable arguments. Please do not translate them. -# -# The descriptions of subcommands may contain the both keywords 'domain' -# and 'force', enclosed within single quotes. Please keep them as they are. -# - # TP: description of subcommand configget - 'configget': (_("""This subcommand is used to display the actual value -of the given configuration <option>."""),), - # TP: description of subcommand configset - 'configset': (_("""Use this subcommand to set or update a single -configuration option's value. <option> is the configuration option, <value> -is the <option>'s new value."""), -_("""Note: This subcommand will create a new vmm.cfg without any comments. -Your current configuration file will be backed as vmm.cfg.bak."""),), - # TP: description of subcommand configure - 'configure': (_("""Starts the interactive configuration for all -configuration sections."""), -_("""In this process the currently set value of each option will be displayed -in square brackets. If no value is configured, the default value of each -option will be displayed in square brackets. Press the return key, to accept -the displayed value."""), -_("""If the optional argument <section> is given, only the configuration -options from the given section will be displayed and will be configurable. -The following sections are available: -"""), -""" account, bin, database, domain, mailbox, misc""", -_("""All configuration options are described in vmm.cfg(5)."""), -_("""Note: This subcommand will create a new vmm.cfg without any comments. -Your current configuration file will be backed as vmm.cfg.bak."""),), - # TP: description of subcommand getuser - 'getuser': (_("""If only the <uid> is available, for example from process -list, the subcommand getuser will show the user's address."""),), - # TP: description of subcommand listaddresses - 'listaddresses': (_("""This command lists all defined addresses. -Addresses belonging to alias-domains are prefixed with a '-', addresses of -regular domains with a '+'. Additionally, the letters 'u', 'a', and 'r' -indicate the type of each address: user, alias and relocated respectively. -The output can be limited with an optional <pattern>."""), -_("""To perform a wild card search, the % character can be used at the start -and/or the end of the <pattern>."""),), - # TP: description of subcommand listaliases - 'listaliases': (_("""This command lists all defined aliases. Aliases -belonging to alias-domains are prefixed with a '-', addresses of regular -domains with a '+'. The output can be limited with an optional <pattern>."""), -_("""To perform a wild card search, the % character can be used at the start -and/or the end of the <pattern>."""),), - # TP: description of subcommand listdomains - 'listdomains': (_("""This subcommand lists all available domains. All -domain names will be prefixed either with `[+]', if the domain is a primary -domain, or with `[-]', if it is an alias domain name. The output can be -limited with an optional <pattern>."""), -_("""To perform a wild card search, the % character can be used at the start -and/or the end of the <pattern>."""),), - # TP: description of subcommand listpwschemes - 'listpwschemes': (_("""This subcommand lists all password schemes which -could be used in the vmm.cfg as value of the misc.password_scheme option. -The output varies, depending on the used Dovecot version and the system's -libc."""), -_("""When your Dovecot installation isn't too old, you will see additionally -a few usable encoding suffixes. One of them can be appended to the password -scheme."""),), - # TP: description of subcommand listrelocated - 'listrelocated': (_("""This command lists all defined relocated addresses. -Relocated entries belonging to alias-domains are prefixed with a '-', addresses -of regular domains with a '+'. The output can be limited with an optional -<pattern>."""), -_("""To perform a wild card search, the % character can be used at the start -and/or the end of the <pattern>."""),), - # TP: description of subcommand listusers - 'listusers': (_("""This command lists all user accounts. User accounts -belonging to alias-domains are prefixed with a '-', addresses of regular -domains with a '+'. The output can be limited with an optional <pattern>."""), -_("""To perform a wild card search, the % character can be used at the start -and/or the end of the pattern."""),), - # TP: description of subcommand version - 'version': (_("""Prints vmm's version and copyright information to stdout. -After this vmm exits."""),), - # TP: description of subcommand domainadd - 'domainadd': (_("""Adds the new domain into the database and creates the -domain directory."""), -_("""If the optional argument <transport> is given, it will override the -default transport (domain.transport) from vmm.cfg. The specified <transport> -will be the default transport for all new accounts in this domain."""), -_("""Configuration-related behavior:"""), -""" * domain.auto_postmaster""", -_("""When that option is set to true (default) vmm will automatically create -the postmaster account for the new domain and prompt for postmaster@<fqdn>'s -password."""), -""" * account.random_password""", -_("""When the value of that option is also set to true, vmm will automatically -create the postmaster account for the new domain and print the generated -postmaster password to stdout."""),), - # TP: description of subcommand domaindelete - 'domaindelete': (_("""This subcommand deletes the domain specified by -<fqdn>."""), -_("""If there are accounts, aliases and/or relocated users assigned to the -given domain, vmm will abort the requested operation and show an error -message. If you know, what you are doing, you can specify the optional keyword -'force'."""), -_("""If you really always know what you are doing, edit your vmm.cfg and set -the option domain.force_deletion to true."""),), - # TP: description of subcommand domaininfo - 'domaininfo': (_("""This subcommand shows some information about the -given domain."""), -_("""For a more detailed information about the domain the optional argument -<details> can be specified. A possible <details> value can be one of the -following six keywords:"""), -""" accounts, aliasdomains, aliases, catchall, relocated, full""",), - # TP: description of subcommand domainquota - 'domainquota': (_("""This subcommand is used to configure a new quota -limit for the accounts of the domain - not for the domain itself."""), -_("""The default quota limit for accounts is defined in the vmm.cfg -(domain.quota_bytes and domain.quota_messages)."""), -_("""The new quota limit will affect only those accounts for which the limit -has not been overridden. If you want to restore the default to all accounts, -you may pass the keyword 'force'. When the argument <messages> was omitted the -default number of messages 0 (zero) will be applied."""),), - # TP: description of subcommand domainservices - 'domainservices': (_("""To define which services could be used by the -users of the domain — with the given <fqdn> — use this subcommand."""), -_("""Each specified <service> will be enabled/usable. All other services -will be deactivated/unusable. Possible <service> names are:"""), -""" imap, pop3, sieve, smtp""", -_("""The new service set will affect only those accounts for which the set has -not been overridden. If you want to restore the default to all accounts, you -may pass the keyword 'force'."""),), - # TP: description of subcommand domaintransport - 'domaintransport': (_("""A new transport for the indicated domain can be -set with this subcommand."""), -_("""The new transport will affect only those accounts for which the transport -has not been overridden. If you want to restore the default to all accounts, -you may pass the keyword 'force'."""),), - # TP: description of subcommand domainnote - 'domainnote': (_("""With this subcommand, it is possible to attach a -note to the specified domain. Without an argument, an existing note is -removed."""),), - # TP: description of subcommand aliasdomainadd - 'aliasdomainadd': (_("""This subcommand adds the new alias domain -(<fqdn>) to the destination <domain> that should be aliased."""),), - # TP: description of subcommand aliasdomaindelete - 'aliasdomaindelete': (_("""Use this subcommand if the alias domain -<fqdn> should be removed."""),), - # TP: description of subcommand aliasdomaininfo - 'aliasdomaininfo': (_("""This subcommand shows to which domain the alias -domain <fqdn> is assigned to."""),), - # TP: description of subcommand aliasdomainswitch - 'aliasdomainswitch': (_("""If the destination of the existing alias -domain <fqdn> should be switched to another <destination> use this -subcommand."""),), - # TP: description of subcommand useradd - 'useradd': (_("""Use this subcommand to create a new e-mail account for -the given <address>."""), -_("""If the <password> is not provided, vmm will prompt for it interactively. -When no <password> is provided and account.random_password is set to true, vmm -will generate a random password and print it to stdout after the account has -been created."""),), - # TP: description of subcommand userdelete - 'userdelete': (_("""Use this subcommand to delete the account with the -given <address>."""), -_("""If there are one or more aliases with an identical destination address, -vmm will abort the requested operation and show an error message. To prevent -this, specify the optional keyword 'force'."""),), - # TP: description of subcommand userinfo - 'userinfo': (_("""This subcommand displays some information about the -account specified by <address>."""), -_("""If the optional argument <details> is given some more information will be -displayed. Possible values for <details> are:"""), -""" aliases, du. full""",), - # TP: description of subcommand username - 'username': (_("""The user's real <name> can be set/updated with this -subcommand."""), -_("""If no <name> is given, the value stored for the account is erased."""), -), - # TP: description of subcommand userpassword - 'userpassword': (_("""The password of an account can be updated with this -subcommand."""), -_("""If no <password> was provided, vmm will prompt for it interactively."""), -), - # TP: description of subcommand usernote - 'usernote': (_("""With this subcommand, it is possible to attach a note -to the specified account. Without an argument, an existing note is -removed."""),), - # TP: description of subcommand userquota - 'userquota': (_("""This subcommand is used to set a new quota limit for -the given account."""), -_("""When the argument <messages> was omitted the default number of messages -0 (zero) will be applied."""), -_("""Instead of <storage> pass the keyword 'domain' to remove the -account-specific override, causing the domain's value to be in effect."""),), - # TP: description of subcommand userservices - 'userservices': (_("""To grant a user access to the specified services, -use this command."""), -_("""All omitted services will be deactivated/unusable for the user with the -given <address>."""), -_("""Instead of <service> pass 'domain' to remove the account-specific -override, causing the domain's value to be in effect."""),), - # TP: description of subcommand usertransport - 'usertransport': (_("""A different <transport> for an account can be -specified with this subcommand."""), -_("""Instead of <transport> pass 'domain' to remove the account-specific -override, causing the domain's value to be in effect."""),), - # TP: description of subcommand aliasadd - 'aliasadd': (_("""This subcommand is used to create a new alias -<address> with one or more <destination> addresses."""), -_("""Within the destination address, the placeholders '%n', '%d', and '%=' -will be replaced by the local part, the domain, or the email address with '@' -replaced by '=' respectively. In combination with alias domains, this enables -domain-specific destinations."""),), - # TP: description of subcommand aliasdelete - 'aliasdelete': (_("""This subcommand is used to delete one or multiple -<destination>s from the alias with the given <address>."""), -_("""When no <destination> address was specified the alias with all its -destinations will be deleted."""),), - # TP: description of subcommand aliasinfo - 'aliasinfo': (_("""Information about the alias with the given <address> -can be displayed with this subcommand."""),), - # TP: description of subcommand relocatedadd - 'relocatedadd': (_("""A new relocated user can be created with this -subcommand."""), -_("""<address> is the user's ex-email address, for example -b....@ex..., and <newaddress> points to the new email address where -the user can be reached."""),), - # TP: description of subcommand relocatedinfo - 'relocatedinfo': (_("""This subcommand shows the new address of the -relocated user with the given <address>."""),), - # TP: description of subcommand relocateddelete - 'relocateddelete': (_("""Use this subcommand in order to delete the -relocated user with the given <address>."""),), - # TP: description of subcommand catchalladd - 'catchalladd': (_("""This subcommand allows to specify destination -addresses for a domain, which shall receive mail addressed to unknown -local-parts within that domain. Those catch-all aliases hence "catch all" mail -to any address in the domain (unless a more specific alias, mailbox or -relocated user exists)."""), -_("""WARNING: Catch-all addresses can cause mail server flooding because -spammers like to deliver mail to all possible combinations of names, e.g. -to all addresses between ab...@ex... and zz...@ex...."""),), - # TP: description of subcommand catchallinfo - 'catchallinfo': (_("""This subcommand displays information about catch-all -aliases defined for the domain <fqdn>."""),), - # TP: description of subcommand catchalldelete - 'catchalldelete': (_("""With this subcommand, catch-all aliases defined -for a domain can be removed, either all of them, or those <destination>s which -were specified explicitly."""),), -} - -del _ |
|
From: <nev...@us...> - 2012-12-30 16:16:34
|
details: http://hg.localdomain.org/vmm/rev/b4396a78c996 changeset: 668:b4396a78c996 user: Pascal Volk date: Sun Dec 30 16:16:09 2012 +0000 description: VMM/cli: Small cleanup. diffstat: VirtualMailManager/cli/__init__.py | 3 +-- 1 files changed, 1 insertions(+), 2 deletions(-) diffs (17 lines): diff -r 502561385ddf -r b4396a78c996 VirtualMailManager/cli/__init__.py --- a/VirtualMailManager/cli/__init__.py Sun Dec 30 16:15:13 2012 +0000 +++ b/VirtualMailManager/cli/__init__.py Sun Dec 30 16:16:09 2012 +0000 @@ -19,12 +19,11 @@ from VirtualMailManager.errors import VMMError -__all__ = ('prog', 'get_winsize', 'read_pass', 'w_err', 'w_std') +__all__ = ('get_winsize', 'read_pass', 'w_err', 'w_std') _ = lambda msg: msg _std_write = os.sys.stdout.write _err_write = os.sys.stderr.write -prog = os.path.basename(os.sys.argv[0]) def w_std(*args): |
|
From: <nev...@us...> - 2012-12-30 16:15:33
|
details: http://hg.localdomain.org/vmm/rev/502561385ddf changeset: 667:502561385ddf user: Pascal Volk date: Sun Dec 30 16:15:13 2012 +0000 description: VMM/constants: Removed constants, which are obsolete now. diffstat: VirtualMailManager/constants.py | 2 -- 1 files changed, 0 insertions(+), 2 deletions(-) diffs (12 lines): diff -r 50148adebee9 -r 502561385ddf VirtualMailManager/constants.py --- a/VirtualMailManager/constants.py Sun Dec 30 16:12:18 2012 +0000 +++ b/VirtualMailManager/constants.py Sun Dec 30 16:15:13 2012 +0000 @@ -32,8 +32,6 @@ # exit codes EX_SUCCESS = 0 -EX_MISSING_ARGS = 1 -EX_UNKNOWN_COMMAND = 2 EX_USER_INTERRUPT = 3 |
|
From: <nev...@us...> - 2012-12-30 16:12:35
|
details: http://hg.localdomain.org/vmm/rev/50148adebee9 changeset: 666:50148adebee9 user: Pascal Volk date: Sun Dec 30 16:12:18 2012 +0000 description: VMM/cli/main: Adjusted to new argparse functionality. diffstat: VirtualMailManager/cli/main.py | 31 ++++++++----------------------- vmm | 2 +- 2 files changed, 9 insertions(+), 24 deletions(-) diffs (59 lines): diff -r 33d15936b53a -r 50148adebee9 VirtualMailManager/cli/main.py --- a/VirtualMailManager/cli/main.py Sun Dec 30 16:10:29 2012 +0000 +++ b/VirtualMailManager/cli/main.py Sun Dec 30 16:12:18 2012 +0000 @@ -14,10 +14,9 @@ from VirtualMailManager.config import BadOptionError, ConfigValueError from VirtualMailManager.cli import w_err from VirtualMailManager.cli.handler import CliHandler -from VirtualMailManager.constants import DATABASE_ERROR, EX_MISSING_ARGS, \ - EX_SUCCESS, EX_UNKNOWN_COMMAND, EX_USER_INTERRUPT, INVALID_ARGUMENT -from VirtualMailManager.cli.subcommands import RunContext, cmd_map, \ - update_cmd_map, usage +from VirtualMailManager.constants import DATABASE_ERROR, EX_SUCCESS, \ + EX_USER_INTERRUPT, INVALID_ARGUMENT +from VirtualMailManager.cli.subcommands import RunContext, setup_parser _ = lambda msg: msg @@ -35,27 +34,13 @@ return handler -def run(argv): - update_cmd_map() - if len(argv) < 2: - usage(EX_MISSING_ARGS, _("You must specify a subcommand at least.")) - - sub_cmd = argv[1].lower() - if sub_cmd in cmd_map: - cmd_func = cmd_map[sub_cmd].func - else: - for cmd in cmd_map.values(): - if cmd.alias == sub_cmd: - cmd_func = cmd.func - sub_cmd = cmd.name - break - else: - usage(EX_UNKNOWN_COMMAND, _("Unknown subcommand: '%s'") % sub_cmd) - +def run(): + parser = setup_parser() + args = parser.parse_args() handler = _get_handler() - run_ctx = RunContext(argv, handler, sub_cmd) + run_ctx = RunContext(args, handler) try: - cmd_func(run_ctx) + args.func(run_ctx) except (EOFError, KeyboardInterrupt): # TP: We have to cry, because root has killed/interrupted vmm # with Ctrl+C or Ctrl+D. diff -r 33d15936b53a -r 50148adebee9 vmm --- a/vmm Sun Dec 30 16:10:29 2012 +0000 +++ b/vmm Sun Dec 30 16:12:18 2012 +0000 @@ -15,4 +15,4 @@ # Otherwise just remove /usr/local/sbin from sys.path sys.path.remove(sys.path[0]) from VirtualMailManager.cli.main import run - sys.exit(run(sys.argv)) + sys.exit(run()) |
|
From: <nev...@us...> - 2012-12-30 16:10:46
|
details: http://hg.localdomain.org/vmm/rev/33d15936b53a changeset: 665:33d15936b53a user: Pascal Volk date: Sun Dec 30 16:10:29 2012 +0000 description: VMM/cli/subcommands: Switched argument parsing over to argparse. diffstat: VirtualMailManager/cli/subcommands.py | 1257 +++++++++++++++++--------------- 1 files changed, 679 insertions(+), 578 deletions(-) diffs (truncated from 1530 to 300 lines): diff -r b5cc967a45ad -r 33d15936b53a VirtualMailManager/cli/subcommands.py --- a/VirtualMailManager/cli/subcommands.py Fri Dec 21 12:28:56 2012 +0000 +++ b/VirtualMailManager/cli/subcommands.py Sun Dec 30 16:10:29 2012 +0000 @@ -9,150 +9,83 @@ """ import locale -import os +import platform +from argparse import Action, ArgumentParser, ArgumentTypeError, \ + RawDescriptionHelpFormatter from textwrap import TextWrapper from time import strftime, strptime from VirtualMailManager import ENCODING -from VirtualMailManager.cli import get_winsize, prog, w_err, w_std -from VirtualMailManager.cli.clihelp import help_msgs +from VirtualMailManager.cli import get_winsize, w_err, w_std from VirtualMailManager.common import human_size, size_in_bytes, \ version_str, format_domain_default from VirtualMailManager.constants import __copyright__, __date__, \ __version__, ACCOUNT_EXISTS, ALIAS_EXISTS, ALIASDOMAIN_ISDOMAIN, \ - DOMAIN_ALIAS_EXISTS, INVALID_ARGUMENT, EX_MISSING_ARGS, \ - RELOCATED_EXISTS, TYPE_ACCOUNT, TYPE_ALIAS, TYPE_RELOCATED + DOMAIN_ALIAS_EXISTS, INVALID_ARGUMENT, RELOCATED_EXISTS, TYPE_ACCOUNT, \ + TYPE_ALIAS, TYPE_RELOCATED from VirtualMailManager.errors import VMMError from VirtualMailManager.password import list_schemes from VirtualMailManager.serviceset import SERVICES __all__ = ( - 'Command', 'RunContext', 'cmd_map', 'usage', 'alias_add', 'alias_delete', - 'alias_info', 'aliasdomain_add', 'aliasdomain_delete', 'aliasdomain_info', - 'aliasdomain_switch', 'catchall_add', 'catchall_info', 'catchall_delete', - 'config_get', 'config_set', 'configure', - 'domain_add', 'domain_delete', 'domain_info', 'domain_quota', - 'domain_services', 'domain_transport', 'domain_note', 'get_user', 'help_', - 'list_domains', 'list_pwschemes', 'list_users', 'list_aliases', - 'list_relocated', 'list_addresses', 'relocated_add', 'relocated_delete', - 'relocated_info', 'user_add', 'user_delete', 'user_info', 'user_name', - 'user_password', 'user_quota', 'user_services', 'user_transport', - 'user_note', 'version', + 'RunContext', 'alias_add', 'alias_delete', 'alias_info', 'aliasdomain_add', + 'aliasdomain_delete', 'aliasdomain_info', 'aliasdomain_switch', + 'catchall_add', 'catchall_delete', 'catchall_info', 'config_get', + 'config_set', 'configure', 'domain_add', 'domain_delete', 'domain_info', + 'domain_note', 'domain_quota', 'domain_services', 'domain_transport', + 'get_user', 'list_addresses', 'list_aliases', 'list_domains', + 'list_pwschemes', 'list_relocated', 'list_users', 'relocated_add', + 'relocated_delete', 'relocated_info', 'setup_parser', 'user_add', + 'user_delete', 'user_info', 'user_name', 'user_note', 'user_password', + 'user_quota', 'user_services', 'user_transport', ) +WS_ROWS = get_winsize()[1] - 2 + _ = lambda msg: msg -txt_wrpr = TextWrapper(width=get_winsize()[1] - 1) -cmd_map = {} - - -class Command(object): - """Container class for command information.""" - __slots__ = ('name', 'alias', 'func', 'args', 'descr') - FMT_HLP_USAGE = """ -usage: %(prog)s %(name)s %(args)s - %(prog)s %(alias)s %(args)s -""" - - def __init__(self, name, alias, func, args, descr): - """Create a new Command instance. - - Arguments: - - `name` : str - the command name, e.g. ``addalias`` - `alias` : str - the command's short alias, e.g. ``aa`` - `func` : callable - the function to handle the command - `args` : str - argument placeholders, e.g. ``aliasaddress`` - `descr` : str - short description of the command - """ - self.name = name - self.alias = alias - self.func = func - self.args = args - self.descr = descr - - @property - def usage(self): - """the command's usage info.""" - return '%s %s %s' % (prog, self.name, self.args) - - def help_(self): - """Print the Command's help message to stdout.""" - old_ii = txt_wrpr.initial_indent - old_si = txt_wrpr.subsequent_indent - - txt_wrpr.subsequent_indent = (len(self.name) + 2) * ' ' - w_std(txt_wrpr.fill('%s: %s' % (self.name, self.descr))) - - info = Command.FMT_HLP_USAGE % dict(alias=self.alias, args=self.args, - name=self.name, prog=prog) - w_std(info) - - txt_wrpr.initial_indent = txt_wrpr.subsequent_indent = ' ' - try: - [w_std(txt_wrpr.fill(_(para)) + '\n') for para - in help_msgs[self.name]] - except KeyError: - w_err(1, _("Subcommand '%s' is not yet documented." % self.name), - 'see also: vmm(1)') +txt_wrpr = TextWrapper(width=WS_ROWS) class RunContext(object): """Contains all information necessary to run a subcommand.""" - __slots__ = ('argc', 'args', 'cget', 'hdlr', 'scmd') + __slots__ = ('args', 'cget', 'hdlr') plan_a_b = _('Plan A failed ... trying Plan B: %(subcommand)s %(object)s') - def __init__(self, argv, handler, command): + def __init__(self, args, handler): """Create a new RunContext""" - self.argc = len(argv) - self.args = argv[:] # will be moved to argparse + self.args = args self.cget = handler.cfg_dget self.hdlr = handler - self.scmd = command def alias_add(ctx): """create a new alias e-mail address""" - if ctx.argc < 3: - usage(EX_MISSING_ARGS, _('Missing alias address and destination.'), - ctx.scmd) - elif ctx.argc < 4: - usage(EX_MISSING_ARGS, _('Missing destination address.'), ctx.scmd) - ctx.hdlr.alias_add(ctx.args[2].lower(), *ctx.args[3:]) + ctx.hdlr.alias_add(ctx.args.address.lower(), *ctx.args.destination) def alias_delete(ctx): """delete the specified alias e-mail address or one of its destinations""" - if ctx.argc < 3: - usage(EX_MISSING_ARGS, _('Missing alias address.'), ctx.scmd) - elif ctx.argc < 4: - ctx.hdlr.alias_delete(ctx.args[2].lower()) - else: - ctx.hdlr.alias_delete(ctx.args[2].lower(), ctx.args[3:]) + destination = ctx.args.destination if ctx.args.destination else None + ctx.hdlr.alias_delete(ctx.args.address.lower(), destination) def alias_info(ctx): """show the destination(s) of the specified alias""" - if ctx.argc < 3: - usage(EX_MISSING_ARGS, _('Missing alias address.'), ctx.scmd) - address = ctx.args[2].lower() + address = ctx.args.address.lower() try: _print_aliase_info(address, ctx.hdlr.alias_info(address)) except VMMError as err: if err.code is ACCOUNT_EXISTS: w_err(0, ctx.plan_a_b % {'subcommand': 'userinfo', 'object': address}) - ctx.scmd = ctx.args[1] = 'userinfo' + ctx.args.scmd = 'userinfo' + ctx.args.details = None user_info(ctx) elif err.code is RELOCATED_EXISTS: w_err(0, ctx.plan_a_b % {'subcommand': 'relocatedinfo', 'object': address}) - ctx.scmd = ctx.args[1] = 'relocatedinfo' + ctx.args.scmd = 'relocatedinfo' relocated_info(ctx) else: raise @@ -160,33 +93,25 @@ def aliasdomain_add(ctx): """create a new alias for an existing domain""" - if ctx.argc < 3: - usage(EX_MISSING_ARGS, _('Missing alias domain name and destination ' - 'domain name.'), ctx.scmd) - elif ctx.argc < 4: - usage(EX_MISSING_ARGS, _('Missing destination domain name.'), - ctx.scmd) - ctx.hdlr.aliasdomain_add(ctx.args[2].lower(), ctx.args[3].lower()) + ctx.hdlr.aliasdomain_add(ctx.args.fqdn.lower(), + ctx.args.destination.lower()) def aliasdomain_delete(ctx): """delete the specified alias domain""" - if ctx.argc < 3: - usage(EX_MISSING_ARGS, _('Missing alias domain name.'), ctx.scmd) - ctx.hdlr.aliasdomain_delete(ctx.args[2].lower()) + ctx.hdlr.aliasdomain_delete(ctx.args.fqdn.lower()) def aliasdomain_info(ctx): """show the destination of the given alias domain""" - if ctx.argc < 3: - usage(EX_MISSING_ARGS, _('Missing alias domain name.'), ctx.scmd) + fqdn = ctx.args.fqdn.lower() try: - _print_aliasdomain_info(ctx.hdlr.aliasdomain_info(ctx.args[2].lower())) + _print_aliasdomain_info(ctx.hdlr.aliasdomain_info(fqdn)) except VMMError as err: if err.code is ALIASDOMAIN_ISDOMAIN: w_err(0, ctx.plan_a_b % {'subcommand': 'domaininfo', - 'object': ctx.args[2].lower()}) - ctx.scmd = ctx.args[1] = 'domaininfo' + 'object': fqdn}) + ctx.args.scmd = 'domaininfo' domain_info(ctx) else: raise @@ -194,125 +119,79 @@ def aliasdomain_switch(ctx): """assign the given alias domain to an other domain""" - if ctx.argc < 3: - usage(EX_MISSING_ARGS, _('Missing alias domain name and destination ' - 'domain name.'), ctx.scmd) - elif ctx.argc < 4: - usage(EX_MISSING_ARGS, _('Missing destination domain name.'), - ctx.scmd) - ctx.hdlr.aliasdomain_switch(ctx.args[2].lower(), ctx.args[3].lower()) + ctx.hdlr.aliasdomain_switch(ctx.args.fqdn.lower(), + ctx.args.destination.lower()) def catchall_add(ctx): """create a new catchall alias e-mail address""" - if ctx.argc < 3: - usage(EX_MISSING_ARGS, _('Missing domain and destination.'), - ctx.scmd) - elif ctx.argc < 4: - usage(EX_MISSING_ARGS, _('Missing destination address.'), ctx.scmd) - ctx.hdlr.catchall_add(ctx.args[2].lower(), *ctx.args[3:]) + ctx.hdlr.catchall_add(ctx.args.fqdn.lower(), *ctx.args.destination) def catchall_delete(ctx): """delete the specified destination or all of the catchall destination""" - if ctx.argc < 3: - usage(EX_MISSING_ARGS, _('Missing domain name.'), ctx.scmd) - elif ctx.argc < 4: - ctx.hdlr.catchall_delete(ctx.args[2].lower()) - else: - ctx.hdlr.catchall_delete(ctx.args[2].lower(), ctx.args[3:]) + destination = ctx.args.destination if ctx.args.destination else None + ctx.hdlr.catchall_delete(ctx.args.fqdn.lower(), destination) def catchall_info(ctx): """show the catchall destination(s) of the specified domain""" - if ctx.argc < 3: - usage(EX_MISSING_ARGS, _('Missing domain name.'), ctx.scmd) - address = ctx.args[2].lower() + address = ctx.args.fqdn.lower() _print_catchall_info(address, ctx.hdlr.catchall_info(address)) def config_get(ctx): """show the actual value of the configuration option""" - if ctx.argc < 3: - usage(EX_MISSING_ARGS, _("Missing option name."), ctx.scmd) - noop = lambda option: option opt_formater = { 'misc.dovecot_version': version_str, 'domain.quota_bytes': human_size, } - option = ctx.args[2].lower() + option = ctx.args.option.lower() w_std('%s = %s' % (option, opt_formater.get(option, noop)(ctx.cget(option)))) def config_set(ctx): """set a new value for the configuration option""" - if ctx.argc < 3: - usage(EX_MISSING_ARGS, _('Missing option and new value.'), ctx.scmd) - if ctx.argc < 4: - usage(EX_MISSING_ARGS, _('Missing new configuration value.'), - ctx.scmd) - ctx.hdlr.cfg_set(ctx.args[2].lower(), ctx.args[3]) + ctx.hdlr.cfg_set(ctx.args.option.lower(), ctx.args.value) def configure(ctx): |
|
From: <nev...@us...> - 2012-12-21 12:29:24
|
details: http://hg.localdomain.org/vmm/rev/b5cc967a45ad changeset: 664:b5cc967a45ad user: Pascal Volk date: Fri Dec 21 12:28:56 2012 +0000 description: VMM/password: Added scheme CLEAR. diffstat: VirtualMailManager/password.py | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diffs (11 lines): diff -r de435d1aa1c0 -r b5cc967a45ad VirtualMailManager/password.py --- a/VirtualMailManager/password.py Sun Dec 09 17:34:10 2012 +0000 +++ b/VirtualMailManager/password.py Fri Dec 21 12:28:56 2012 +0000 @@ -295,6 +295,7 @@ return _format_digest(digest, scheme, encoding) _scheme_info = { + 'CLEAR': (_clear_hash, 0x2010df00), 'CLEARTEXT': (_clear_hash, 0x10000f00), 'CRAM-MD5': (_dovecotpw, 0x10000f00), 'CRYPT': (_crypt_hash, 0x10000f00), |
|
From: <nev...@us...> - 2012-12-09 17:35:23
|
details: http://hg.localdomain.org/vmm/rev/de435d1aa1c0 changeset: 663:de435d1aa1c0 user: Pascal Volk date: Sun Dec 09 17:34:10 2012 +0000 description: VMM/cli: Deleted unnecessary encode()s from read_pass. diffstat: VirtualMailManager/cli/__init__.py | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diffs (15 lines): diff -r 9ec7770193ad -r de435d1aa1c0 VirtualMailManager/cli/__init__.py --- a/VirtualMailManager/cli/__init__.py Sun Dec 09 15:03:33 2012 +0000 +++ b/VirtualMailManager/cli/__init__.py Sun Dec 09 17:34:10 2012 +0000 @@ -79,9 +79,9 @@ Throws a VMMError after the third failure. """ # TP: Please preserve the trailing space. - readp_msg0 = _('Enter new password: ').encode(ENCODING, 'replace') + readp_msg0 = _('Enter new password: ') # TP: Please preserve the trailing space. - readp_msg1 = _('Retype new password: ').encode(ENCODING, 'replace') + readp_msg1 = _('Retype new password: ') mismatched = True failures = 0 while mismatched: |
|
From: <nev...@us...> - 2012-12-09 15:03:48
|
details: http://hg.localdomain.org/vmm/rev/9ec7770193ad changeset: 662:9ec7770193ad user: Pascal Volk date: Sun Dec 09 15:03:33 2012 +0000 description: merged changes from default(29295afafa91) diffstat: VirtualMailManager/account.py | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diffs (12 lines): diff -r 0bce7e1d1349 -r 9ec7770193ad VirtualMailManager/account.py --- a/VirtualMailManager/account.py Sat Dec 08 14:48:30 2012 +0000 +++ b/VirtualMailManager/account.py Sun Dec 09 15:03:33 2012 +0000 @@ -429,7 +429,7 @@ self._chk_state() dbc = self._dbh.cursor() if force: - dbc.execute('DELETE FROM users WHERE uid = %s', (self._uid),) + dbc.execute('DELETE FROM users WHERE uid = %s', (self._uid,)) # delete also all aliases where the destination address is the same # as for this account. dbc.execute("DELETE FROM alias WHERE destination = %s", |
|
From: <nev...@us...> - 2012-12-09 15:01:01
|
details: http://hg.localdomain.org/vmm/rev/29295afafa91 changeset: 661:29295afafa91 user: Pascal Volk date: Sun Dec 09 14:59:46 2012 +0000 description: VMM/account: Fixed a typo in Account.delete(). Due to a wrong placed comma `userdelete … force' ended in a TypeError. diffstat: VirtualMailManager/account.py | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diffs (12 lines): diff -r 86c2ed36aba8 -r 29295afafa91 VirtualMailManager/account.py --- a/VirtualMailManager/account.py Wed Nov 21 12:53:56 2012 +0000 +++ b/VirtualMailManager/account.py Sun Dec 09 14:59:46 2012 +0000 @@ -440,7 +440,7 @@ self._chk_state() dbc = self._dbh.cursor() if force: - dbc.execute('DELETE FROM users WHERE uid = %s', (self._uid),) + dbc.execute('DELETE FROM users WHERE uid = %s', (self._uid,)) # delete also all aliases where the destination address is the same # as for this account. dbc.execute("DELETE FROM alias WHERE destination = %s", |
|
From: <nev...@us...> - 2012-12-08 14:49:44
|
details: http://hg.localdomain.org/vmm/rev/0bce7e1d1349 changeset: 660:0bce7e1d1349 user: Pascal Volk date: Sat Dec 08 14:48:30 2012 +0000 description: VMM/mailbox: Decode error messages from doveadm. Those errors occur only with the dbox mailbox format when the mailbox.folders contains non-ASCII mailbox names. diffstat: VirtualMailManager/mailbox.py | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diffs (20 lines): diff -r a6b6b0937cae -r 0bce7e1d1349 VirtualMailManager/mailbox.py --- a/VirtualMailManager/mailbox.py Mon Dec 03 19:19:52 2012 +0000 +++ b/VirtualMailManager/mailbox.py Sat Dec 08 14:48:30 2012 +0000 @@ -14,6 +14,7 @@ from binascii import a2b_base64, b2a_base64 from subprocess import Popen, PIPE +from VirtualMailManager import ENCODING from VirtualMailManager.account import Account from VirtualMailManager.common import lisdir from VirtualMailManager.errors import VMMError @@ -257,7 +258,7 @@ stderr = process.communicate()[1] if process.returncode: e_msg = _('Failed to create mailboxes: %r\n') % mailboxes - raise VMMError(e_msg + stderr.strip().decode(), VMM_ERROR) + raise VMMError(e_msg + stderr.strip().decode(ENCODING), VMM_ERROR) def create(self): """Create a dbox INBOX""" |
|
From: <nev...@us...> - 2012-12-03 19:20:41
|
details: http://hg.localdomain.org/vmm/rev/a6b6b0937cae changeset: 659:a6b6b0937cae user: Pascal Volk date: Mon Dec 03 19:19:52 2012 +0000 description: VMM/cli/config: … encode/decode … diffstat: VirtualMailManager/cli/config.py | 11 +++++++---- 1 files changed, 7 insertions(+), 4 deletions(-) diffs (35 lines): diff -r ad967c4b7fe5 -r a6b6b0937cae VirtualMailManager/cli/config.py --- a/VirtualMailManager/cli/config.py Sun Dec 02 15:51:17 2012 +0000 +++ b/VirtualMailManager/cli/config.py Mon Dec 03 19:19:52 2012 +0000 @@ -10,6 +10,7 @@ from configparser import RawConfigParser from shutil import copy2 +from string import Template from VirtualMailManager import ENCODING from VirtualMailManager.config import Config, ConfigValueError, LazyConfig @@ -29,8 +30,8 @@ def configure(self, sections): """Interactive method for configuring all options of the given iterable ``sections`` object.""" - input_fmt = _('Enter new value for option %(option)s ' - '[%(current_value)s]: ') + input_tpl = Template(_('Enter new value for option $option ' + '[$current_value]: ')) failures = 0 w_std(_('Using configuration file: %s\n') % self._cfg_filename) @@ -39,8 +40,10 @@ for opt, val in self.items(section): failures = 0 while True: - newval = input(input_fmt.encode(ENCODING, 'replace') % - {'option': opt, 'current_value': val}) + if isinstance(val, str): + val = val.encode(ENCODING, 'replace').decode(ENCODING) + newval = input(input_tpl.substitute(option=opt, + current_value=val)) if newval and newval != val: try: LazyConfig.set(self, '%s.%s' % (section, opt), |
|
From: <nev...@us...> - 2012-12-02 15:52:24
|
details: http://hg.localdomain.org/vmm/rev/ad967c4b7fe5 changeset: 658:ad967c4b7fe5 user: Pascal Volk date: Sun Dec 02 15:51:17 2012 +0000 description: VMM{/cli}/config: Explicitly pass utf-8 as the encoding to open(). diffstat: VirtualMailManager/cli/config.py | 2 +- VirtualMailManager/config.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diffs (24 lines): diff -r 6515e3b88dec -r ad967c4b7fe5 VirtualMailManager/cli/config.py --- a/VirtualMailManager/cli/config.py Sun Dec 02 14:54:24 2012 +0000 +++ b/VirtualMailManager/cli/config.py Sun Dec 02 15:51:17 2012 +0000 @@ -89,7 +89,7 @@ def _save_changes(self): """Writes changes to the configuration file.""" copy2(self._cfg_filename, self._cfg_filename + '.bak') - with open(self._cfg_filename, 'w') as self._cfg_file: + with open(self._cfg_filename, 'w', encoding='utf-8') as self._cfg_file: self.write(self._cfg_file) del _ diff -r 6515e3b88dec -r ad967c4b7fe5 VirtualMailManager/config.py --- a/VirtualMailManager/config.py Sun Dec 02 14:54:24 2012 +0000 +++ b/VirtualMailManager/config.py Sun Dec 02 15:51:17 2012 +0000 @@ -358,7 +358,7 @@ Raises a ConfigError if the configuration syntax is invalid. """ - with open(self._cfg_filename, 'r') as self._cfg_file: + with open(self._cfg_filename, 'r', encoding='utf-8') as self._cfg_file: try: self.readfp(self._cfg_file) except (MissingSectionHeaderError, ParsingError) as err: |
|
From: <nev...@us...> - 2012-12-02 14:56:09
|
details: http://hg.localdomain.org/vmm/rev/6515e3b88dec changeset: 657:6515e3b88dec user: Pascal Volk date: Sun Dec 02 14:54:24 2012 +0000 description: VMM/cli/subcommands: Fixed some encode/decode issues. diffstat: VirtualMailManager/cli/subcommands.py | 11 ++++++----- 1 files changed, 6 insertions(+), 5 deletions(-) diffs (42 lines): diff -r 4bbca60e0ba4 -r 6515e3b88dec VirtualMailManager/cli/subcommands.py --- a/VirtualMailManager/cli/subcommands.py Sat Dec 01 17:25:11 2012 +0000 +++ b/VirtualMailManager/cli/subcommands.py Sun Dec 02 14:54:24 2012 +0000 @@ -326,8 +326,7 @@ else: info[0]['bytes'] = human_size(info[0]['bytes']) info[0]['messages'] = locale.format('%d', info[0]['messages'], - True).decode(ENCODING, - 'replace') + True) info[0]['quota limit/user'] = q_limit % info[0] _print_info(ctx, info[0], _('Domain')) if details == 'accounts': @@ -997,7 +996,8 @@ if not domain.startswith('xn--'): w_std('\t%s' % domain) else: - w_std('\t%s (%s)' % (domain, domain.decode('idna'))) + w_std('\t%s (%s)' % (domain, + domain.encode('utf-8').decode('idna'))) print() else: w_std(_('\tNone'), '') @@ -1032,7 +1032,7 @@ def _format_domain(domain, main=True): """format (prefix/convert) the domain name.""" if domain.startswith('xn--'): - domain = '%s (%s)' % (domain, domain.decode('idna')) + domain = '%s (%s)' % (domain, domain.encode('utf-8').decode('idna')) if main: return '\t[+] %s' % domain return '\t[-] %s' % domain @@ -1102,7 +1102,8 @@ title = _('Alias domain information') for key in ('alias', 'domain'): if info[key].startswith('xn--'): - info[key] = '%s (%s)' % (info[key], info[key].decode('idna')) + info[key] = '%s (%s)' % (info[key], + info[key].encode(ENCODING).decode('idna')) w_std(title, '-' * len(title), _('\tThe alias domain %(alias)s belongs to:\n\t * %(domain)s') % info, '') |
|
From: <nev...@us...> - 2012-12-01 17:26:45
|
details: http://hg.localdomain.org/vmm/rev/4bbca60e0ba4 changeset: 656:4bbca60e0ba4 user: Pascal Volk date: Sat Dec 01 17:25:11 2012 +0000 description: VMM/cli/subcommands: Print usable password schemes in sorted order. diffstat: VirtualMailManager/cli/subcommands.py | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diffs (12 lines): diff -r 2bf68600e914 -r 4bbca60e0ba4 VirtualMailManager/cli/subcommands.py --- a/VirtualMailManager/cli/subcommands.py Mon Nov 26 22:07:20 2012 +0000 +++ b/VirtualMailManager/cli/subcommands.py Sat Dec 01 17:25:11 2012 +0000 @@ -507,7 +507,7 @@ for key, value in zip(keys, list_schemes()): w_std(key, len(key) * '-') - w_std('\n'.join(txt_wrpr.wrap(' '.join(value))), '') + w_std('\n'.join(txt_wrpr.wrap(' '.join(sorted(value)))), '') txt_wrpr.initial_indent, txt_wrpr.subsequent_indent = old_ii, old_si txt_wrpr.width = txt_wrpr.width + 8 |