From 99c165801b25e25806fab86895cccf51df478281 Mon Sep 17 00:00:00 2001 From: "Veronica K. B. Olsen" <1619840+vkbo@users.noreply.github.com> Date: Thu, 31 Oct 2019 16:56:50 +0100 Subject: [PATCH] Let's keep the main launcher novelWriter.py and let setuptools handle the rest --- novelWriter => novelWriter.py | 0 nw/__init__.py | 5 ++++- setup.py | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) rename novelWriter => novelWriter.py (100%) diff --git a/novelWriter b/novelWriter.py similarity index 100% rename from novelWriter rename to novelWriter.py diff --git a/nw/__init__.py b/nw/__init__.py index 809aeb18..dd091a10 100644 --- a/nw/__init__.py +++ b/nw/__init__.py @@ -67,10 +67,13 @@ logger = logging.getLogger(__name__) # Load the main config as a global object CONFIG = Config() -def main(sysArgs): +def main(sysArgs=None): """Parses command line, sets up logging, and launches main GUI. """ + if sysArgs is None: + sysArgs = sys.argv[1:] + # Valid Input Options shortOpt = "hdDqtl:v" longOpt = [ diff --git a/setup.py b/setup.py index 66e3e2d1..9e24b86e 100755 --- a/setup.py +++ b/setup.py @@ -14,7 +14,7 @@ setuptools.setup( long_description_content_type = "text/markdown", license = "GNU General Public License v3", url = "https://github.com/vkbo/novelWriter", - scripts = ["novelWriter"], + entry_points={"console_scripts": ["novelWriter=nw:main"]}, packages = setuptools.find_packages(exclude=["docs","tests","sample"]), include_package_data = True, package_data = {"": ["*.conf"]},