]> Frank Brehm's Git Trees - pixelpark/pp-admin-tools.git/commitdiff
Minor changes
authorFrank Brehm <frank@brehm-online.com>
Tue, 29 Mar 2022 16:44:16 +0000 (18:44 +0200)
committerFrank Brehm <frank@brehm-online.com>
Tue, 29 Mar 2022 16:44:16 +0000 (18:44 +0200)
lib/pp_admintools/mail_app.py

index 0f7074811d2b220c3a183144682b914c14c7ed78..a7fdb0ec99c9661e8791844c6b7e19597905c61c 100644 (file)
@@ -22,6 +22,7 @@ import smtplib
 
 # Own modules
 from . import __version__ as GLOBAL_VERSION
+from . import MAX_PORT_NUMBER
 
 from fb_tools.common import pp
 
@@ -33,12 +34,14 @@ from fb_tools.xlate import format_list
 
 from .xlate import XLATOR
 
+from .argparse_actions import PortOptionAction
+
 from .mail_config import MailConfiguration
-from .mail_config import VALID_MAIL_METHODS, MAX_PORT_NUMBER
+from .mail_config import VALID_MAIL_METHODS
 
 from .mailaddress import MailAddress
 
-__version__ = '0.2.2'
+__version__ = '0.2.3'
 LOG = logging.getLogger(__name__)
 
 _ = XLATOR.gettext
@@ -67,6 +70,8 @@ class BaseMailApplication(FbConfigApplication):
         super(BaseMailApplication, self).__init__(
             appname=appname, verbose=verbose, version=version, base_dir=base_dir,
             description=description, cfg_class=cfg_class, initialized=False,
+            argparse_epilog=argparse_epilog, argparse_prefix_chars=argparse_prefix_chars,
+            env_prefix=env_prefix,
         )
 
     # -------------------------------------------------------------------------
@@ -244,7 +249,8 @@ class BaseMailApplication(FbConfigApplication):
 
         mail_group.add_argument(
             '--smtp-port',
-            metavar=_("PORT"), type=int, dest='smtp_port',
+            metavar=_("PORT"), type=int, dest='smtp_port', what="SMTP",
+            action=PortOptionAction,
             help=_(
                 "The port to use for submitting generated by this script if "
                 "the mail method of this script is 'smtp'. Default: {}.").format(