diff --git a/qutebrowser/__main__.py b/qutebrowser/__main__.py index 6a668121b..f9feb06d0 100644 --- a/qutebrowser/__main__.py +++ b/qutebrowser/__main__.py @@ -19,15 +19,9 @@ """Entry point for qutebrowser. Simply execute qutebrowser.""" -from qutebrowser.app import QuteBrowser +import qutebrowser.app as app import sys -def main(): - """Main entry point for qutebrowser.""" - app = QuteBrowser() - return app.exec_() - - if __name__ == '__main__': - sys.exit(main()) + sys.exit(app.main()) diff --git a/qutebrowser/app.py b/qutebrowser/app.py index 702a6f39c..00339ae16 100644 --- a/qutebrowser/app.py +++ b/qutebrowser/app.py @@ -70,14 +70,9 @@ from qutebrowser.utils.readline import ReadlineBridge from qutebrowser.utils.debug import set_trace # pylint: disable=unused-import -class QuteBrowser(QApplication): +class Application(QApplication): - """Main object for qutebrowser. - - Can be used like this: - - >>> app = QuteBrowser() - >>> sys.exit(app.exec_()) + """Main application instance. Attributes: mainwindow: The MainWindow QWidget. @@ -657,3 +652,9 @@ class QuteBrowser(QApplication): """ log.destroy.debug("Shutdown complete, quitting.") self.quit() + + +def main(): + """Main entry point for qutebrowser.""" + app = Application() + return app.exec_() diff --git a/setup.py b/setup.py index 889f293a8..b89c9340c 100644 --- a/setup.py +++ b/setup.py @@ -41,7 +41,7 @@ try: include_package_data=True, package_data={'qutebrowser': ['html/*', 'git-commit-id']}, entry_points={'gui_scripts': - ['qutebrowser = qutebrowser.__main__:main']}, + ['qutebrowser = qutebrowser.app:main']}, test_suite='qutebrowser.test', zip_safe=True, **setupdata