From 92e7577fcd1688d67ac32e1fd4b087a8bf5e0293 Mon Sep 17 00:00:00 2001 From: Marcel Schmalzl Date: Thu, 19 Sep 2019 10:43:56 +0200 Subject: [PATCH] Updated version number format; cleaned up code; minor changes --- Emma.py | 19 ++++++++----------- Emma/__init__.py | 3 ++- Emma/emma.py | 3 ++- Emma/emma_deltas.py | 2 +- Emma/emma_vis.py | 3 ++- Emma/shared_libs/stringConstants.py | 13 ------------- 6 files changed, 15 insertions(+), 28 deletions(-) diff --git a/Emma.py b/Emma.py index 5797155..2708045 100644 --- a/Emma.py +++ b/Emma.py @@ -17,11 +17,8 @@ """ import argparse -import sys -import os - -# sys.path.append(os.path.abspath("Emma")) +import Emma import Emma.emma import Emma.emma_vis import Emma.emma_deltas @@ -45,23 +42,23 @@ def initParser(): "--version", help="Display the version number.", action="version", - version="%(prog)s, Version: " + EMMA_VERSION + version="%(prog)s, Version: " + Emma.EMMA_VERSION ) subparser = topLevelParser.add_subparsers(dest="_invoked_emma_module") # Use `dest` to introduce a variable in order to check which sub parser was invoked subparser.add_parser( - SUBPARSER_STRINGS.ANALYSER, # Sub parser name which will be written in `invoked_emma_module` + Emma.SUBPARSER_STRINGS.ANALYSER, # Sub parser name which will be written in `invoked_emma_module` parents=[Emma.emma.initParser()], help="Emma Analyser", conflict_handler="resolve", # Since there are conflicting help messages of the top level and sub parsersr ) subparser.add_parser( - SUBPARSER_STRINGS.VISUALISER, + Emma.SUBPARSER_STRINGS.VISUALISER, parents=[Emma.emma_vis.initParser()], help="Emma Visualiser", conflict_handler="resolve", # Since there are conflicting help messages of the top level and sub parsersr ) subparser.add_parser( - SUBPARSER_STRINGS.DELTAS, + Emma.SUBPARSER_STRINGS.DELTAS, parents=[Emma.emma_deltas.initParser()], help="Emma Deltas", conflict_handler="resolve", # Since there are conflicting help messages of the top level and sub parsersr @@ -79,9 +76,9 @@ def main(arguments=""): parsedArguments = Emma.shared_libs.emma_helper.parseGivenArgStrOrStdIn(arguments, parser) emmaModuleLUT = { - SUBPARSER_STRINGS.ANALYSER: Emma.emma.main, - SUBPARSER_STRINGS.VISUALISER: Emma.emma_vis.main, - SUBPARSER_STRINGS.DELTAS: Emma.emma_deltas.main + Emma.SUBPARSER_STRINGS.ANALYSER: Emma.emma.main, + Emma.SUBPARSER_STRINGS.VISUALISER: Emma.emma_vis.main, + Emma.SUBPARSER_STRINGS.DELTAS: Emma.emma_deltas.main } # Display the top level help message if no argument is given diff --git a/Emma/__init__.py b/Emma/__init__.py index 62abef7..ade7f74 100644 --- a/Emma/__init__.py +++ b/Emma/__init__.py @@ -24,7 +24,8 @@ class SUBPARSER_STRINGS: VERSION_MAJOR = "3" VERSION_MINOR = "1" -EMMA_VERSION = ".".join([VERSION_MAJOR, VERSION_MINOR]) +VERSION_PATCH = "1" +EMMA_VERSION = ".".join([VERSION_MAJOR, VERSION_MINOR, VERSION_PATCH]) EMMA_VISUALISER_VERSION = EMMA_VERSION EMMA_DELTAS_VERSION = EMMA_VERSION diff --git a/Emma/emma.py b/Emma/emma.py index b62e59d..9270afe 100644 --- a/Emma/emma.py +++ b/Emma/emma.py @@ -24,6 +24,7 @@ from pypiscout.SCout_Logger import Logger as sc +import Emma from Emma.shared_libs.stringConstants import * # pylint: disable=unused-wildcard-import,wildcard-import import Emma.shared_libs.emma_helper import Emma.emma_libs.memoryManager @@ -71,7 +72,7 @@ def initParser(): "--version", help="Display the version number.", action="version", - version="%(prog)s, Version: " + EMMA_VERSION + version="%(prog)s, Version: " + Emma.EMMA_VERSION ) parser.add_argument( "--verbosity", diff --git a/Emma/emma_deltas.py b/Emma/emma_deltas.py index b3df5b5..8349619 100644 --- a/Emma/emma_deltas.py +++ b/Emma/emma_deltas.py @@ -50,7 +50,7 @@ def initParser(): "--version", help="Display the version number.", action="version", - version="%(prog)s, Version: " + EMMA_DELTAS_VERSION + version="%(prog)s, Version: " + Emma.EMMA_DELTAS_VERSION ) parser.add_argument( "--infiles", diff --git a/Emma/emma_vis.py b/Emma/emma_vis.py index 2042d48..4651d3b 100644 --- a/Emma/emma_vis.py +++ b/Emma/emma_vis.py @@ -28,6 +28,7 @@ from pypiscout.SCout_Logger import Logger as sc +import Emma from Emma.shared_libs.stringConstants import * # pylint: disable=unused-wildcard-import,wildcard-import import Emma.shared_libs.emma_helper import Emma.emma_vis_libs.dataVisualiserSections @@ -146,7 +147,7 @@ def initParser(): "--version", help="Display the version number.", action="version", - version="%(prog)s, Version: " + EMMA_VISUALISER_VERSION + version="%(prog)s, Version: " + Emma.EMMA_VISUALISER_VERSION ) parser.add_argument( "--projectDir", diff --git a/Emma/shared_libs/stringConstants.py b/Emma/shared_libs/stringConstants.py index 28b583a..360c773 100644 --- a/Emma/shared_libs/stringConstants.py +++ b/Emma/shared_libs/stringConstants.py @@ -18,20 +18,7 @@ # Emma Memory and Mapfile Analyser - string constants -VERSION_MAJOR = "3" -VERSION_MINOR = "1" -EMMA_VERSION = ".".join([VERSION_MAJOR, VERSION_MINOR]) -EMMA_VISUALISER_VERSION = EMMA_VERSION -EMMA_DELTAS_VERSION = EMMA_VERSION -PYTHON_REQ_VERSION = ">=3.6" - -# ########################## - -class SUBPARSER_STRINGS: - ANALYSER: str = "a" - VISUALISER: str = "v" - DELTAS: str = "d" ADDR_END_DEC = "addrEndDec" ADDR_END_HEX = "addrEndHex" ADDR_END_HEX_ORIGINAL = "addrEndHexOriginal"