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."""
|
"""Entry point for qutebrowser. Simply execute qutebrowser."""
|
||||||
|
|
||||||
from qutebrowser.app import QuteBrowser
|
import qutebrowser.app as app
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
|
|
||||||
def main():
|
|
||||||
"""Main entry point for qutebrowser."""
|
|
||||||
app = QuteBrowser()
|
|
||||||
return app.exec_()
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
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
|
from qutebrowser.utils.debug import set_trace # pylint: disable=unused-import
|
||||||
|
|
||||||
|
|
||||||
class QuteBrowser(QApplication):
|
class Application(QApplication):
|
||||||
|
|
||||||
"""Main object for qutebrowser.
|
"""Main application instance.
|
||||||
|
|
||||||
Can be used like this:
|
|
||||||
|
|
||||||
>>> app = QuteBrowser()
|
|
||||||
>>> sys.exit(app.exec_())
|
|
||||||
|
|
||||||
Attributes:
|
Attributes:
|
||||||
mainwindow: The MainWindow QWidget.
|
mainwindow: The MainWindow QWidget.
|
||||||
@ -657,3 +652,9 @@ class QuteBrowser(QApplication):
|
|||||||
"""
|
"""
|
||||||
log.destroy.debug("Shutdown complete, quitting.")
|
log.destroy.debug("Shutdown complete, quitting.")
|
||||||
self.quit()
|
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,
|
include_package_data=True,
|
||||||
package_data={'qutebrowser': ['html/*', 'git-commit-id']},
|
package_data={'qutebrowser': ['html/*', 'git-commit-id']},
|
||||||
entry_points={'gui_scripts':
|
entry_points={'gui_scripts':
|
||||||
['qutebrowser = qutebrowser.__main__:main']},
|
['qutebrowser = qutebrowser.app:main']},
|
||||||
test_suite='qutebrowser.test',
|
test_suite='qutebrowser.test',
|
||||||
zip_safe=True,
|
zip_safe=True,
|
||||||
**setupdata
|
**setupdata
|
||||||
|
Loading…
Reference in New Issue
Block a user