From 896c38cd3ad9a2635c340d3f00c4f55068e735ca Mon Sep 17 00:00:00 2001 From: Frank Brehm Date: Thu, 13 Sep 2018 15:53:49 +0200 Subject: [PATCH] Output version on starting application --- lib/cr_vmware_tpl/__init__.py | 2 +- lib/cr_vmware_tpl/app.py | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/lib/cr_vmware_tpl/__init__.py b/lib/cr_vmware_tpl/__init__.py index 3934b42..771370f 100644 --- a/lib/cr_vmware_tpl/__init__.py +++ b/lib/cr_vmware_tpl/__init__.py @@ -1,6 +1,6 @@ #!/bin/env python3 # -*- coding: utf-8 -*- -__version__ = '0.1.1' +__version__ = '0.1.2' # vim: ts=4 et list diff --git a/lib/cr_vmware_tpl/app.py b/lib/cr_vmware_tpl/app.py index 55e3691..0e5128b 100644 --- a/lib/cr_vmware_tpl/app.py +++ b/lib/cr_vmware_tpl/app.py @@ -21,6 +21,8 @@ import getpass # Third party modules # Own modules +from . import __version__ as GLOBAL_VERSION + from .errors import PpAppError from .common import terminal_can_colors @@ -34,7 +36,7 @@ from .config import CrTplConfiguration from .handler import ExpectedHandlerError, CrTplHandler -__version__ = '0.6.2' +__version__ = '0.6.3' LOG = logging.getLogger(__name__) @@ -49,7 +51,7 @@ class CrTplApplication(PpBaseObject): # ------------------------------------------------------------------------- def __init__( - self, appname=None, verbose=0, version=__version__, base_dir=None, + self, appname=None, verbose=0, version=GLOBAL_VERSION, base_dir=None, initialized=False, usage=None, description=None, argparse_epilog=None, argparse_prefix_chars='-', env_prefix=None): @@ -440,7 +442,8 @@ class CrTplApplication(PpBaseObject): """ - LOG.info("Starting ...") + LOG.info("Starting {a!r}, version {!v} ...".format( + a=self.appname, v=self.version)) try: ret = self.handler() -- 2.39.5