Merge branch 'alpha-fixes1' into 'master'

Fixes for the first Alpha:

Closes #354

See merge request openlp/openlp!111
This commit is contained in:
Raoul Snyman 2019-12-24 04:04:16 +00:00
commit 74a207e135
6 changed files with 13 additions and 12 deletions

View File

@ -74,4 +74,4 @@ class SingleColumnTableWidget(QtWidgets.QTableWidget):
self.resizeRowsToContents() self.resizeRowsToContents()
__all__ = ['AlertLocation', 'DisplayControllerType', 'HideMode', 'SingleColumnTableWidget'] __all__ = ['DisplayControllerType', 'HideMode', 'SingleColumnTableWidget']

View File

@ -147,7 +147,7 @@ class VlcPlayer(MediaPlayer):
""" """
return get_vlc() is not None return get_vlc() is not None
def load(self, controller, output_display, file): def load(self, controller, output_display, file=None):
""" """
Load a video into VLC Load a video into VLC

View File

@ -80,7 +80,7 @@ class VersionWorker(ThreadWorker):
**Rules around versions and version files:** **Rules around versions and version files:**
* If a version number has a build (i.e. -bzr1234), then it is a nightly. * If a version number has a revision hash (i.e. g9034d140b), then it is a nightly.
* If a version number's minor version is an odd number, it is a development release. * If a version number's minor version is an odd number, it is a development release.
* If a version number's minor version is an even number, it is a stable release. * If a version number's minor version is an even number, it is a stable release.
""" """
@ -143,7 +143,9 @@ def get_version():
""" """
Returns the application version of the running instance of OpenLP:: Returns the application version of the running instance of OpenLP::
{'full': '1.9.4-bzr1249', 'version': '1.9.4', 'build': 'bzr1249'} {'full': '2.9.0.dev2963+97ba02d1f', 'version': '2.9.0', 'build': '97ba02d1f'}
or
{'full': '2.9.0', 'version': '2.9.0', 'build': None}
""" """
global APPLICATION_VERSION global APPLICATION_VERSION
if APPLICATION_VERSION: if APPLICATION_VERSION:
@ -154,11 +156,11 @@ def get_version():
except OSError: except OSError:
log.exception('Error in version file.') log.exception('Error in version file.')
full_version = '0.0.0' full_version = '0.0.0'
bits = full_version.split('-') bits = full_version.split('.dev')
APPLICATION_VERSION = { APPLICATION_VERSION = {
'full': full_version, 'full': full_version,
'version': bits[0], 'version': bits[0],
'build': bits[1] if len(bits) > 1 else None 'build': full_version.split('+')[1] if '+' in full_version else None
} }
if APPLICATION_VERSION['build']: if APPLICATION_VERSION['build']:
log.info('OpenLP version {version} build {build}'.format(version=APPLICATION_VERSION['version'], log.info('OpenLP version {version} build {build}'.format(version=APPLICATION_VERSION['version'],

View File

@ -81,7 +81,7 @@ class SelectPlanForm(QtWidgets.QDialog, Ui_SelectPlanDialog):
self.on_plan_selection_combobox_changed() self.on_plan_selection_combobox_changed()
# Set the 2 lists of themes # Set the 2 lists of themes
theme_manager = Registry().get('theme_manager') theme_manager = Registry().get('theme_manager')
for theme in theme_manager.get_themes(): for theme in theme_manager.get_theme_names():
self.song_theme_selection_combo_box.addItem(theme) self.song_theme_selection_combo_box.addItem(theme)
self.slide_theme_selection_combo_box.addItem(theme) self.slide_theme_selection_combo_box.addItem(theme)

View File

@ -21,8 +21,7 @@
import logging import logging
import re import re
from lxml import objectify from lxml import objectify, etree
from lxml.etree import Error, LxmlError
from openlp.core.common import normalize_str from openlp.core.common import normalize_str
from openlp.core.common.i18n import translate from openlp.core.common.i18n import translate
@ -130,7 +129,7 @@ class OpenSongImport(SongImport):
self.set_defaults() self.set_defaults()
try: try:
tree = objectify.parse(file) tree = objectify.parse(file)
except (Error, LxmlError): except (etree.Error, etree.LxmlError):
self.log_error(file.name, SongStrings.XMLSyntaxError) self.log_error(file.name, SongStrings.XMLSyntaxError)
log.exception('Error parsing XML') log.exception('Error parsing XML')
return return

View File

@ -75,8 +75,8 @@ class TestSelectPlanForm(TestCase, TestMixin):
self.form.planning_center_api.airplane_mode = True self.form.planning_center_api.airplane_mode = True
self.form.planning_center_api.airplane_mode_directory = TEST_PATH self.form.planning_center_api.airplane_mode_directory = TEST_PATH
self.theme_manager = ThemeManager(None) self.theme_manager = ThemeManager(None)
self.theme_manager.get_themes = MagicMock() self.theme_manager.get_theme_names = MagicMock()
self.theme_manager.get_themes.return_value = ['themeA', 'themeB'] self.theme_manager.get_theme_names.return_value = ['themeA', 'themeB']
def tearDown(self): def tearDown(self):
""" """