Skip to content

Commit

Permalink
Updated version number format; cleaned up code; minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Marcel Schmalzl authored and Marcel Schmalzl committed Sep 19, 2019
1 parent a45c7e6 commit 92e7577
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 28 deletions.
19 changes: 8 additions & 11 deletions Emma.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
3 changes: 2 additions & 1 deletion Emma/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
3 changes: 2 additions & 1 deletion Emma/emma.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion Emma/emma_deltas.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
3 changes: 2 additions & 1 deletion Emma/emma_vis.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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",
Expand Down
13 changes: 0 additions & 13 deletions Emma/shared_libs/stringConstants.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 92e7577

Please sign in to comment.