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"]}, + )