Skip to content

Commit

Permalink
- Move version and name to library properties
Browse files Browse the repository at this point in the history
- Add version to gui title & console startup readout
- Add name and version to help readout
  • Loading branch information
Forecaster committed Jul 18, 2021
1 parent 3444821 commit 146cdcd
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
11 changes: 7 additions & 4 deletions df2vtt_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@
import fg_module
import utilib

name = "DungeonFog FG Module Generator"
version = "v1.2"

verbose = False
log_file = False
def vprint(msg):
Expand Down Expand Up @@ -535,11 +538,8 @@ def get_choice_by_name(name: str):
vprint("Skipped cleanup due to arguments")
print(module_id + "." + options['extension'])

name = "DungeonFog FG Module Generator"
version = "v1.2"

def get_argparse():
parser = argparse.ArgumentParser(description="Converts one or more df2vtt files into a Fantasy Grounds module.")
parser = argparse.ArgumentParser(description=name + " " + version + " - Converts one or more df2vtt files into a Fantasy Grounds module.")
parser.add_argument('module_name', metavar='M', type=str, help="The module name as shown within Fantasy Grounds. Also used as the filename.")
parser.add_argument('files', metavar='F', nargs='+', help="One or more paths to df2vtt files to parse into a module.")
parser.add_argument('-a', dest='author', default='DungeonFog', help="Set a custom module author. (Default: DungeonFog)")
Expand Down Expand Up @@ -571,6 +571,9 @@ def do_args(arg_list):
verbose = args.verbose
log_file = args.log_to_file

print("Application starting")
print(name + " " + version)

options = {
"refine_portals": args.refine_portals,
"door_width": args.door_width,
Expand Down
4 changes: 3 additions & 1 deletion parser_gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
import re
import webbrowser

print(parser.name + " " + parser.version)

if len(sys.argv) > 1:
print("Arguments present. Running in command line mode. (Run without arguments to run in GUI mode.)")
parser.do_args(sys.argv)
Expand Down Expand Up @@ -145,7 +147,7 @@ def query_input(query):
]

# Create the Window
window = gui.Window('DungeonFog to Fantasy Grounds Module Generator', layout, finalize=True)
window = gui.Window(parser.name + " " + parser.version, layout, finalize=True)
window["link_about"].set_cursor("hand2")

win_about = None
Expand Down

0 comments on commit 146cdcd

Please sign in to comment.