Add a main function to app.py
This commit is contained in:
parent
346ef4ac3d
commit
57d261ee85
@ -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())
|
||||
|
@ -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_()
|
||||
|
2
setup.py
2
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
|
||||
|
Loading…
Reference in New Issue
Block a user