From ddef29599f9e416c6e28cb8eeb3bb0bc399b62fc Mon Sep 17 00:00:00 2001 From: Bastian Germann Date: Thu, 9 May 2019 00:06:09 +0200 Subject: [PATCH 1/4] Use start script __main__.py which enables 'python -m openlp' --- run_openlp.py => openlp/__main__.py | 0 setup.py | 3 +-- tests/functional/openlp_core/ui/test_mainwindow.py | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) rename run_openlp.py => openlp/__main__.py (100%) diff --git a/run_openlp.py b/openlp/__main__.py similarity index 100% rename from run_openlp.py rename to openlp/__main__.py diff --git a/setup.py b/setup.py index 90cef4885..85b55ff9c 100644 --- a/setup.py +++ b/setup.py @@ -161,7 +161,6 @@ using a computer and a data projector.""", 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', @@ -207,5 +206,5 @@ using a computer and a data projector.""", 'python-xlib; platform_system=="Linux"' ], test_suite='nose2.collector.collector', - entry_points={'gui_scripts': ['openlp = run_openlp:start']} + entry_points={'gui_scripts': ['openlp = openlp.__main__:start']} ) diff --git a/tests/functional/openlp_core/ui/test_mainwindow.py b/tests/functional/openlp_core/ui/test_mainwindow.py index 817e2272e..78f1757da 100644 --- a/tests/functional/openlp_core/ui/test_mainwindow.py +++ b/tests/functional/openlp_core/ui/test_mainwindow.py @@ -107,7 +107,7 @@ class TestMainWindow(TestCase, TestMixin): 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) From 7f54074285397f84c3b14fe634aed1a1be05a85f Mon Sep 17 00:00:00 2001 From: Bastian Germann Date: Sun, 9 Jun 2019 18:06:24 +0200 Subject: [PATCH 2/4] Readd the run_openlp.py --- run_openlp.py | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100755 run_openlp.py diff --git a/run_openlp.py b/run_openlp.py new file mode 100755 index 000000000..b75e3a6b6 --- /dev/null +++ b/run_openlp.py @@ -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 . # +########################################################################## +""" +A compatibility entrypoint for OpenLP +""" +from openlp import __main__ + +if __name__ == '__main__': + __main__.start() From edbf816e7997146fe3d098307fbab10940ab657c Mon Sep 17 00:00:00 2001 From: Bastian Germann Date: Sat, 7 Sep 2019 00:25:26 +0200 Subject: [PATCH 3/4] Drop shebang from __main__ --- openlp/__main__.py | 1 - 1 file changed, 1 deletion(-) mode change 100755 => 100644 openlp/__main__.py diff --git a/openlp/__main__.py b/openlp/__main__.py old mode 100755 new mode 100644 index 880cabbe9..6607de4de --- a/openlp/__main__.py +++ b/openlp/__main__.py @@ -1,4 +1,3 @@ -#!/usr/bin/env python3 # -*- coding: utf-8 -*- # vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4 From 9bb757fd4f755422c9d8b1524591eb2ee1ab4d44 Mon Sep 17 00:00:00 2001 From: Bastian Germann Date: Sat, 7 Sep 2019 00:30:57 +0200 Subject: [PATCH 4/4] Revert changing test on run_openlp.py --- tests/functional/openlp_core/ui/test_mainwindow.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/functional/openlp_core/ui/test_mainwindow.py b/tests/functional/openlp_core/ui/test_mainwindow.py index 78f1757da..817e2272e 100644 --- a/tests/functional/openlp_core/ui/test_mainwindow.py +++ b/tests/functional/openlp_core/ui/test_mainwindow.py @@ -107,7 +107,7 @@ class TestMainWindow(TestCase, TestMixin): Test that passing a non service file does nothing. """ # GIVEN a non service file as an argument to openlp - service = 'setup.py' + service = 'run_openlp.py' # WHEN the argument is processed self.main_window.open_cmd_line_files(service)