diff --git a/gwaripper/cli.py b/gwaripper/cli.py index a9307f8..6352b08 100755 --- a/gwaripper/cli.py +++ b/gwaripper/cli.py @@ -37,6 +37,8 @@ def main(): epilog="NOTE: arguments that are shared over all subcommands need to be put in front of the " "subcommand itself: e.g. gwaripper --ignore-banned links URL URL ...") + parser.add_argument('--version', action='store_true', + help="Print the GWARipper version") parser.add_argument('--ignore-banned', action='store_true', help="Ignores banned tags in titles and in link text!") parser.add_argument('--download-duplicates', action='store_true', @@ -274,6 +276,10 @@ def main(): # subparser that was selected args = parser.parse_args() + if args.version: + print(GWARipper.VERSION) + return + if root_dir: setup_cacerts() diff --git a/gwaripper/gwaripper.py b/gwaripper/gwaripper.py index c53eb53..2adf23c 100755 --- a/gwaripper/gwaripper.py +++ b/gwaripper/gwaripper.py @@ -112,6 +112,8 @@ class GWARipper: Uses config.get_root() as base path for writing and reading files """ + VERSION: Final[str] = "0.9.1" + headers: ClassVar[Dict[str, str]] = { 'User-Agent': 'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:12.0) Gecko/20100101 Firefox/12.0' diff --git a/gwaripper_webGUI/start_webgui.py b/gwaripper_webGUI/start_webgui.py index a7c726e..b42ac67 100755 --- a/gwaripper_webGUI/start_webgui.py +++ b/gwaripper_webGUI/start_webgui.py @@ -30,7 +30,7 @@ def main(args: Optional[List[str]] = None): if 'open' in args: app.run(threaded=True, host='0.0.0.0', port=port) else: - app.run(threaded=True, port=port) + app.run(threaded=True, port=port, debug=True) if __name__ == "__main__": diff --git a/setup.py b/setup.py index 2ff1d3b..799b0ae 100755 --- a/setup.py +++ b/setup.py @@ -1,6 +1,8 @@ import setuptools import os +from gwaripper.gwaripper import GWARipper + with open("README.md", "r", encoding="UTF-8") as fh: long_description = fh.read() @@ -19,7 +21,7 @@ setuptools.setup( name="GWARipper", - version="0.9.0", + version=GWARipper.VERSION, description="A script that downloads audio files from the gonewildaudio subreddit.", long_description=long_description, long_description_content_type="text/markdown", @@ -45,7 +47,7 @@ # copied into the package package_data={ 'gwaripper_webGUI': webgui_data, - 'gwaripper': 'migrations/*.py', + 'gwaripper': ['migrations/*.py'], }, entry_points={ 'console_scripts': [