Skip to content

Commit

Permalink
[FEAT] possibility to verbose output with -v in CLI and GUI
Browse files Browse the repository at this point in the history
  • Loading branch information
treee111 committed Nov 12, 2022
1 parent d9893d7 commit 9075b43
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
8 changes: 8 additions & 0 deletions wahoomc/input.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@ def process_call_of_the_tool():
# zip the country (and country-maps) folder
options_args.add_argument('-z', '--zip', action='store_true',
help="zip the country (and country-maps) folder")
options_args.add_argument('-v', '--verbose', action='store_true',
help="output debug logger messages")

args = parser_top.parse_args()

Expand Down Expand Up @@ -107,6 +109,8 @@ def process_call_of_the_tool():
o_input_data.save_cruiser = args.cruiser
o_input_data.zip_folder = args.zip

o_input_data.verbose = args.verbose

return o_input_data


Expand Down Expand Up @@ -152,6 +156,7 @@ def __init__(self):
self.geofabrik_tiles = False

self.zip_folder = False
self.verbose = False

def is_required_input_given_or_exit(self, issue_message):
"""
Expand Down Expand Up @@ -256,6 +261,7 @@ def handle_create_map(self, event): # pylint: disable=unused-argument

self.o_input_data.save_cruiser = tab2.first.checkb_save_cruiser_val.get()
self.o_input_data.zip_folder = tab2.first.checkb_zip_folder_val.get()
self.o_input_data.verbose = tab2.first.checkb_verbose_val.get()

# get text without \n in the end
self.o_input_data.tag_wahoo_xml = tab2.second.input_tag_wahoo_xml.get()
Expand Down Expand Up @@ -407,3 +413,5 @@ def __init__(self, parent, oInputData):
"Save uncompressed maps for Cruiser", 2)
self.checkb_zip_folder_val = create_checkbox(self, oInputData.zip_folder,
"Zip folder with generated files", 3)
self.checkb_verbose_val = create_checkbox(self, oInputData.verbose,
"output debug logger messages", 4)
3 changes: 3 additions & 0 deletions wahoomc/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ def run():
# handle GUI and CLI processing via one function and different cli-calls
o_input_data = process_call_of_the_tool()

if o_input_data.verbose:
logging.getLogger().setLevel(logging.DEBUG)

# Is there something to do?
o_input_data.is_required_input_given_or_exit(issue_message=True)

Expand Down

0 comments on commit 9075b43

Please sign in to comment.