Bastian Germann has proposed merging lp:~bastian-germann/openlp/main into lp:openlp.
Commit message: Use start script __main__.py which enables 'python -m openlp' Requested reviews: Raoul Snyman (raoul-snyman) For more details, see: https://code.launchpad.net/~bastian-germann/openlp/main/+merge/368590 The situation with OpenLP exporting two packages (openlp and run_openlp) is unpythonic. There is an obvious fix for that: using __main__.py. A neat side effect: It enables starting OpenLP via 'python -m openlp'. As packages will have to be touched anyway because the start script was renamed to run_openlp.py during the current development cycle we should take the chance and do it the right way. -- Your team OpenLP Core is subscribed to branch lp:openlp.
=== renamed file 'run_openlp.py' => 'openlp/__main__.py' === added file 'run_openlp.py' --- run_openlp.py 1970-01-01 00:00:00 +0000 +++ run_openlp.py 2019-06-09 16:23:31 +0000 @@ -0,0 +1,29 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- +# vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4 + +########################################################################## +# OpenLP - Open Source Lyrics Projection # +# ---------------------------------------------------------------------- # +# Copyright (c) 2008-2019 OpenLP Developers # +# ---------------------------------------------------------------------- # +# This program is free software: you can redistribute it and/or modify # +# it under the terms of the GNU General Public License as published by # +# the Free Software Foundation, either version 3 of the License, or # +# (at your option) any later version. # +# # +# This program is distributed in the hope that it will be useful, # +# but WITHOUT ANY WARRANTY; without even the implied warranty of # +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # +# GNU General Public License for more details. # +# # +# You should have received a copy of the GNU General Public License # +# along with this program. If not, see <https://www.gnu.org/licenses/>. # +########################################################################## +""" +A compatibility entrypoint for OpenLP +""" +from openlp import __main__ + +if __name__ == '__main__': + __main__.start() === modified file 'setup.py' --- setup.py 2019-05-25 14:43:43 +0000 +++ setup.py 2019-06-09 16:23:31 +0000 @@ -161,7 +161,6 @@ url='https://openlp.org/', license='GPL-3.0-or-later', packages=find_packages(exclude=['ez_setup', 'tests*']), - py_modules=['run_openlp'], include_package_data=True, zip_safe=False, python_requires='>=3.6', @@ -208,5 +207,5 @@ 'python-xlib; platform_system=="Linux"' ], setup_requires=['pytest-runner'], - entry_points={'gui_scripts': ['openlp = run_openlp:start']} + entry_points={'gui_scripts': ['openlp = openlp.__main__:start']} ) === modified file 'tests/functional/openlp_core/ui/test_mainwindow.py' --- tests/functional/openlp_core/ui/test_mainwindow.py 2019-05-22 16:47:20 +0000 +++ tests/functional/openlp_core/ui/test_mainwindow.py 2019-06-09 16:23:31 +0000 @@ -107,7 +107,7 @@ Test that passing a non service file does nothing. """ # GIVEN a non service file as an argument to openlp - service = 'run_openlp.py' + service = 'setup.py' # WHEN the argument is processed self.main_window.open_cmd_line_files(service)
_______________________________________________ Mailing list: https://launchpad.net/~openlp-core Post to : [email protected] Unsubscribe : https://launchpad.net/~openlp-core More help : https://help.launchpad.net/ListHelp

