From d75e4093f03f5c592d5975484ed32d7b032513d4 Mon Sep 17 00:00:00 2001 From: Klaus Wakonig Date: Fri, 13 Jan 2023 10:50:22 +0100 Subject: [PATCH] feat: added grum cli --- grum.py | 20 ++------------------ grum/cli/__init__.py | 1 + grum/cli/grum.py | 20 ++++++++++++++++++++ setup.py | 5 ++++- 4 files changed, 27 insertions(+), 19 deletions(-) mode change 100755 => 100644 grum.py create mode 100644 grum/cli/__init__.py create mode 100755 grum/cli/grum.py diff --git a/grum.py b/grum.py old mode 100755 new mode 100644 index ab409f5..c713c49 --- a/grum.py +++ b/grum.py @@ -1,19 +1,3 @@ -#!/usr/bin/env python - -import sys -from PyQt5.QtWidgets import QApplication - -from grum import ctrl_c -from grum import theme -from grum.mainwin import MainWindow - - -app = QApplication(sys.argv) -theme.apply(app) -ctrl_c.setup(app) -mw = MainWindow() -mw.show() -sys.exit(app.exec()) - - +from grum.cli import main +main() diff --git a/grum/cli/__init__.py b/grum/cli/__init__.py new file mode 100644 index 0000000..26a800a --- /dev/null +++ b/grum/cli/__init__.py @@ -0,0 +1 @@ +from .grum import main diff --git a/grum/cli/grum.py b/grum/cli/grum.py new file mode 100755 index 0000000..f66279e --- /dev/null +++ b/grum/cli/grum.py @@ -0,0 +1,20 @@ +#!/usr/bin/env python + +import sys + +from PyQt5.QtWidgets import QApplication + +from grum import ctrl_c, theme +from grum.mainwin import MainWindow + + +def main(): + app = QApplication(sys.argv) + theme.apply(app) + ctrl_c.setup(app) + mw = MainWindow() + mw.show() + sys.exit(app.exec()) + + + diff --git a/setup.py b/setup.py index ae37d03..e37e43c 100644 --- a/setup.py +++ b/setup.py @@ -1,4 +1,7 @@ from setuptools import setup if __name__ == "__main__": - setup(install_requires=["pyqt5", "pyqtgraph"]) + setup( + install_requires=["pyqt5", "pyqtgraph"], + entry_points={"console_scripts": ["grum=grum.cli:main"]}, + )