Merge lp:~ic90/openlp/animated-alerts into lp:~openlp-dev/openlp/webengine-migrate

Proposed by Nico Opiyo
Status: Superseded
Proposed branch: lp:~ic90/openlp/animated-alerts
Merge into: lp:~openlp-dev/openlp/webengine-migrate
Diff against target: 58182 lines (+20914/-24777)
539 files modified
.bzrignore (+29/-36)
LICENSE (+624/-289)
copyright.txt (+18/-18)
nose2.cfg (+0/-27)
openlp/__init__.py (+18/-18)
openlp/core/__init__.py (+18/-18)
openlp/core/api/__init__.py (+18/-18)
openlp/core/api/deploy.py (+21/-21)
openlp/core/api/endpoint/__init__.py (+18/-18)
openlp/core/api/endpoint/controller.py (+19/-19)
openlp/core/api/endpoint/core.py (+18/-18)
openlp/core/api/endpoint/pluginhelpers.py (+18/-18)
openlp/core/api/endpoint/remote.py (+18/-18)
openlp/core/api/endpoint/service.py (+18/-18)
openlp/core/api/http/__init__.py (+18/-18)
openlp/core/api/http/endpoint.py (+18/-18)
openlp/core/api/http/errors.py (+18/-18)
openlp/core/api/http/server.py (+18/-18)
openlp/core/api/http/wsgiapp.py (+18/-18)
openlp/core/api/poll.py (+18/-18)
openlp/core/api/tab.py (+18/-18)
openlp/core/api/websockets.py (+18/-18)
openlp/core/app.py (+60/-36)
openlp/core/common/__init__.py (+29/-29)
openlp/core/common/actions.py (+18/-18)
openlp/core/common/applocation.py (+25/-24)
openlp/core/common/db.py (+18/-18)
openlp/core/common/httputils.py (+77/-23)
openlp/core/common/i18n.py (+20/-19)
openlp/core/common/json.py (+157/-39)
openlp/core/common/mixins.py (+18/-18)
openlp/core/common/path.py (+26/-133)
openlp/core/common/registry.py (+19/-19)
openlp/core/common/settings.py (+41/-33)
openlp/core/display/__init__.py (+18/-18)
openlp/core/display/html/display.css (+80/-0)
openlp/core/display/html/display.html (+10/-5)
openlp/core/display/html/display.js (+245/-32)
openlp/core/display/html/reveal.js (+761/-310)
openlp/core/display/render.py (+91/-47)
openlp/core/display/screens.py (+18/-18)
openlp/core/display/webengine.py (+18/-18)
openlp/core/display/window.py (+39/-36)
openlp/core/lib/__init__.py (+83/-31)
openlp/core/lib/db.py (+44/-43)
openlp/core/lib/exceptions.py (+18/-18)
openlp/core/lib/formattingtags.py (+18/-18)
openlp/core/lib/imagemanager.py (+18/-18)
openlp/core/lib/json/__init__.py (+18/-18)
openlp/core/lib/mediamanageritem.py (+34/-35)
openlp/core/lib/plugin.py (+18/-18)
openlp/core/lib/pluginmanager.py (+18/-18)
openlp/core/lib/serviceitem.py (+33/-29)
openlp/core/lib/settingstab.py (+18/-18)
openlp/core/lib/theme.py (+34/-28)
openlp/core/lib/ui.py (+18/-18)
openlp/core/loader.py (+18/-18)
openlp/core/projectors/__init__.py (+18/-18)
openlp/core/projectors/constants.py (+29/-19)
openlp/core/projectors/db.py (+25/-19)
openlp/core/projectors/editform.py (+20/-18)
openlp/core/projectors/manager.py (+29/-45)
openlp/core/projectors/pjlink.py (+184/-613)
openlp/core/projectors/pjlinkcommands.py (+554/-0)
openlp/core/projectors/sourceselectform.py (+18/-18)
openlp/core/projectors/tab.py (+18/-18)
openlp/core/projectors/upgrade.py (+18/-18)
openlp/core/resources.py (+18/-18)
openlp/core/server.py (+21/-19)
openlp/core/state.py (+18/-18)
openlp/core/threading.py (+20/-20)
openlp/core/ui/__init__.py (+19/-19)
openlp/core/ui/aboutdialog.py (+18/-18)
openlp/core/ui/aboutform.py (+18/-18)
openlp/core/ui/advancedtab.py (+30/-23)
openlp/core/ui/exceptiondialog.py (+21/-21)
openlp/core/ui/exceptionform.py (+32/-25)
openlp/core/ui/filerenamedialog.py (+18/-18)
openlp/core/ui/filerenameform.py (+18/-18)
openlp/core/ui/firsttimeform.py (+220/-296)
openlp/core/ui/firsttimelanguagedialog.py (+18/-18)
openlp/core/ui/firsttimelanguageform.py (+18/-18)
openlp/core/ui/firsttimewizard.py (+132/-96)
openlp/core/ui/formattingtagcontroller.py (+19/-19)
openlp/core/ui/formattingtagdialog.py (+18/-18)
openlp/core/ui/formattingtagform.py (+18/-18)
openlp/core/ui/generaltab.py (+20/-39)
openlp/core/ui/icons.py (+28/-22)
openlp/core/ui/mainwindow.py (+35/-33)
openlp/core/ui/media/__init__.py (+32/-18)
openlp/core/ui/media/endpoint.py (+18/-18)
openlp/core/ui/media/mediacontroller.py (+121/-228)
openlp/core/ui/media/mediaplayer.py (+26/-32)
openlp/core/ui/media/mediatab.py (+151/-0)
openlp/core/ui/media/playertab.py (+0/-269)
openlp/core/ui/media/systemplayer.py (+0/-332)
openlp/core/ui/media/vendor/__init__.py (+0/-25)
openlp/core/ui/media/vendor/vlc.py (+0/-8775)
openlp/core/ui/media/vlcplayer.py (+152/-216)
openlp/core/ui/plugindialog.py (+18/-18)
openlp/core/ui/pluginform.py (+18/-18)
openlp/core/ui/printservicedialog.py (+18/-18)
openlp/core/ui/printserviceform.py (+23/-23)
openlp/core/ui/screenstab.py (+19/-19)
openlp/core/ui/serviceitemeditdialog.py (+18/-18)
openlp/core/ui/serviceitemeditform.py (+18/-18)
openlp/core/ui/servicemanager.py (+82/-58)
openlp/core/ui/servicenoteform.py (+18/-18)
openlp/core/ui/settingsdialog.py (+18/-18)
openlp/core/ui/settingsform.py (+23/-23)
openlp/core/ui/shortcutlistdialog.py (+18/-18)
openlp/core/ui/shortcutlistform.py (+18/-18)
openlp/core/ui/slidecontroller.py (+138/-35)
openlp/core/ui/splashscreen.py (+18/-18)
openlp/core/ui/starttimedialog.py (+18/-18)
openlp/core/ui/starttimeform.py (+18/-18)
openlp/core/ui/style.py (+18/-18)
openlp/core/ui/themeform.py (+45/-40)
openlp/core/ui/themelayoutdialog.py (+18/-18)
openlp/core/ui/themelayoutform.py (+18/-18)
openlp/core/ui/thememanager.py (+57/-63)
openlp/core/ui/themestab.py (+19/-19)
openlp/core/ui/themewizard.py (+30/-29)
openlp/core/version.py (+19/-19)
openlp/core/widgets/__init__.py (+18/-18)
openlp/core/widgets/buttons.py (+18/-18)
openlp/core/widgets/dialogs.py (+26/-26)
openlp/core/widgets/docks.py (+18/-18)
openlp/core/widgets/edits.py (+25/-24)
openlp/core/widgets/enums.py (+18/-18)
openlp/core/widgets/layouts.py (+19/-19)
openlp/core/widgets/toolbar.py (+18/-18)
openlp/core/widgets/views.py (+30/-26)
openlp/core/widgets/widgets.py (+48/-20)
openlp/core/widgets/wizard.py (+19/-59)
openlp/plugins/__init__.py (+18/-18)
openlp/plugins/alerts/__init__.py (+18/-18)
openlp/plugins/alerts/alertsplugin.py (+21/-19)
openlp/plugins/alerts/endpoint.py (+18/-18)
openlp/plugins/alerts/forms/__init__.py (+18/-18)
openlp/plugins/alerts/forms/alertdialog.py (+18/-18)
openlp/plugins/alerts/forms/alertform.py (+18/-18)
openlp/plugins/alerts/lib/__init__.py (+18/-18)
openlp/plugins/alerts/lib/alertsmanager.py (+51/-21)
openlp/plugins/alerts/lib/alertstab.py (+87/-35)
openlp/plugins/alerts/lib/db.py (+18/-18)
openlp/plugins/bibles/__init__.py (+18/-18)
openlp/plugins/bibles/bibleplugin.py (+18/-18)
openlp/plugins/bibles/endpoint.py (+18/-18)
openlp/plugins/bibles/forms/__init__.py (+18/-18)
openlp/plugins/bibles/forms/bibleimportform.py (+20/-20)
openlp/plugins/bibles/forms/booknamedialog.py (+18/-18)
openlp/plugins/bibles/forms/booknameform.py (+18/-18)
openlp/plugins/bibles/forms/editbibledialog.py (+18/-18)
openlp/plugins/bibles/forms/editbibleform.py (+18/-18)
openlp/plugins/bibles/forms/languagedialog.py (+18/-18)
openlp/plugins/bibles/forms/languageform.py (+18/-18)
openlp/plugins/bibles/lib/__init__.py (+18/-18)
openlp/plugins/bibles/lib/bibleimport.py (+20/-20)
openlp/plugins/bibles/lib/biblestab.py (+18/-18)
openlp/plugins/bibles/lib/db.py (+27/-27)
openlp/plugins/bibles/lib/importers/__init__.py (+18/-18)
openlp/plugins/bibles/lib/importers/csvbible.py (+20/-20)
openlp/plugins/bibles/lib/importers/http.py (+18/-18)
openlp/plugins/bibles/lib/importers/opensong.py (+18/-18)
openlp/plugins/bibles/lib/importers/osis.py (+18/-18)
openlp/plugins/bibles/lib/importers/sword.py (+18/-18)
openlp/plugins/bibles/lib/importers/wordproject.py (+20/-20)
openlp/plugins/bibles/lib/importers/zefania.py (+18/-18)
openlp/plugins/bibles/lib/manager.py (+20/-20)
openlp/plugins/bibles/lib/mediaitem.py (+21/-21)
openlp/plugins/bibles/lib/upgrade.py (+18/-18)
openlp/plugins/bibles/lib/versereferencelist.py (+18/-18)
openlp/plugins/custom/__init__.py (+18/-18)
openlp/plugins/custom/customplugin.py (+18/-18)
openlp/plugins/custom/endpoint.py (+18/-18)
openlp/plugins/custom/forms/__init__.py (+18/-18)
openlp/plugins/custom/forms/editcustomdialog.py (+18/-18)
openlp/plugins/custom/forms/editcustomform.py (+18/-18)
openlp/plugins/custom/forms/editcustomslidedialog.py (+18/-18)
openlp/plugins/custom/forms/editcustomslideform.py (+18/-18)
openlp/plugins/custom/lib/__init__.py (+18/-18)
openlp/plugins/custom/lib/customtab.py (+18/-18)
openlp/plugins/custom/lib/customxmlhandler.py (+18/-18)
openlp/plugins/custom/lib/db.py (+18/-18)
openlp/plugins/custom/lib/mediaitem.py (+21/-24)
openlp/plugins/images/__init__.py (+18/-18)
openlp/plugins/images/endpoint.py (+18/-18)
openlp/plugins/images/forms/__init__.py (+18/-18)
openlp/plugins/images/forms/addgroupdialog.py (+18/-18)
openlp/plugins/images/forms/addgroupform.py (+18/-18)
openlp/plugins/images/forms/choosegroupdialog.py (+18/-18)
openlp/plugins/images/forms/choosegroupform.py (+18/-18)
openlp/plugins/images/imageplugin.py (+18/-18)
openlp/plugins/images/lib/__init__.py (+18/-18)
openlp/plugins/images/lib/db.py (+18/-18)
openlp/plugins/images/lib/imagetab.py (+18/-18)
openlp/plugins/images/lib/mediaitem.py (+27/-27)
openlp/plugins/images/lib/upgrade.py (+21/-21)
openlp/plugins/media/__init__.py (+18/-18)
openlp/plugins/media/endpoint.py (+18/-18)
openlp/plugins/media/forms/__init__.py (+18/-18)
openlp/plugins/media/forms/mediaclipselectordialog.py (+18/-18)
openlp/plugins/media/forms/mediaclipselectorform.py (+19/-19)
openlp/plugins/media/lib/__init__.py (+18/-18)
openlp/plugins/media/lib/mediaitem.py (+54/-50)
openlp/plugins/media/lib/mediatab.py (+0/-73)
openlp/plugins/media/mediaplugin.py (+18/-31)
openlp/plugins/presentations/__init__.py (+18/-18)
openlp/plugins/presentations/endpoint.py (+18/-18)
openlp/plugins/presentations/lib/__init__.py (+18/-18)
openlp/plugins/presentations/lib/impresscontroller.py (+225/-41)
openlp/plugins/presentations/lib/libreofficeserver.py (+431/-0)
openlp/plugins/presentations/lib/maclocontroller.py (+266/-0)
openlp/plugins/presentations/lib/mediaitem.py (+32/-34)
openlp/plugins/presentations/lib/messagelistener.py (+43/-48)
openlp/plugins/presentations/lib/pdfcontroller.py (+43/-25)
openlp/plugins/presentations/lib/powerpointcontroller.py (+44/-25)
openlp/plugins/presentations/lib/presentationcontroller.py (+38/-32)
openlp/plugins/presentations/lib/presentationtab.py (+21/-21)
openlp/plugins/presentations/lib/serializers.py (+52/-0)
openlp/plugins/presentations/lib/vendor/do_not_delete.txt (+5/-0)
openlp/plugins/presentations/presentationplugin.py (+34/-32)
openlp/plugins/songs/__init__.py (+18/-18)
openlp/plugins/songs/endpoint.py (+18/-18)
openlp/plugins/songs/forms/__init__.py (+18/-18)
openlp/plugins/songs/forms/authorsdialog.py (+18/-18)
openlp/plugins/songs/forms/authorsform.py (+18/-18)
openlp/plugins/songs/forms/duplicatesongremovalform.py (+18/-18)
openlp/plugins/songs/forms/editsongdialog.py (+18/-18)
openlp/plugins/songs/forms/editsongform.py (+20/-19)
openlp/plugins/songs/forms/editversedialog.py (+18/-18)
openlp/plugins/songs/forms/editverseform.py (+18/-18)
openlp/plugins/songs/forms/mediafilesdialog.py (+18/-18)
openlp/plugins/songs/forms/mediafilesform.py (+20/-20)
openlp/plugins/songs/forms/songbookdialog.py (+18/-18)
openlp/plugins/songs/forms/songbookform.py (+18/-18)
openlp/plugins/songs/forms/songexportform.py (+18/-18)
openlp/plugins/songs/forms/songimportform.py (+25/-20)
openlp/plugins/songs/forms/songmaintenancedialog.py (+18/-18)
openlp/plugins/songs/forms/songmaintenanceform.py (+18/-18)
openlp/plugins/songs/forms/songreviewwidget.py (+48/-28)
openlp/plugins/songs/forms/songselectdialog.py (+18/-18)
openlp/plugins/songs/forms/songselectform.py (+29/-20)
openlp/plugins/songs/forms/topicsdialog.py (+18/-18)
openlp/plugins/songs/forms/topicsform.py (+18/-18)
openlp/plugins/songs/lib/__init__.py (+18/-18)
openlp/plugins/songs/lib/db.py (+18/-18)
openlp/plugins/songs/lib/importer.py (+18/-18)
openlp/plugins/songs/lib/importers/__init__.py (+18/-18)
openlp/plugins/songs/lib/importers/cclifile.py (+23/-23)
openlp/plugins/songs/lib/importers/chordpro.py (+18/-18)
openlp/plugins/songs/lib/importers/dreambeam.py (+18/-18)
openlp/plugins/songs/lib/importers/easyslides.py (+18/-18)
openlp/plugins/songs/lib/importers/easyworship.py (+19/-19)
openlp/plugins/songs/lib/importers/foilpresenter.py (+18/-18)
openlp/plugins/songs/lib/importers/lyrix.py (+18/-18)
openlp/plugins/songs/lib/importers/mediashout.py (+18/-18)
openlp/plugins/songs/lib/importers/openlp.py (+19/-19)
openlp/plugins/songs/lib/importers/openlyrics.py (+18/-18)
openlp/plugins/songs/lib/importers/openoffice.py (+18/-18)
openlp/plugins/songs/lib/importers/opensong.py (+18/-18)
openlp/plugins/songs/lib/importers/opspro.py (+18/-18)
openlp/plugins/songs/lib/importers/powerpraise.py (+18/-18)
openlp/plugins/songs/lib/importers/powersong.py (+20/-20)
openlp/plugins/songs/lib/importers/presentationmanager.py (+20/-20)
openlp/plugins/songs/lib/importers/propresenter.py (+19/-19)
openlp/plugins/songs/lib/importers/songbeamer.py (+20/-20)
openlp/plugins/songs/lib/importers/songimport.py (+22/-21)
openlp/plugins/songs/lib/importers/songpro.py (+19/-19)
openlp/plugins/songs/lib/importers/songshowplus.py (+18/-18)
openlp/plugins/songs/lib/importers/songsoffellowship.py (+18/-18)
openlp/plugins/songs/lib/importers/sundayplus.py (+20/-20)
openlp/plugins/songs/lib/importers/videopsalm.py (+19/-19)
openlp/plugins/songs/lib/importers/wordsofworship.py (+164/-97)
openlp/plugins/songs/lib/importers/worshipassistant.py (+19/-19)
openlp/plugins/songs/lib/importers/worshipcenterpro.py (+18/-18)
openlp/plugins/songs/lib/importers/zionworx.py (+18/-18)
openlp/plugins/songs/lib/mediaitem.py (+67/-62)
openlp/plugins/songs/lib/openlyricsexport.py (+19/-19)
openlp/plugins/songs/lib/openlyricsxml.py (+18/-18)
openlp/plugins/songs/lib/songcompare.py (+18/-18)
openlp/plugins/songs/lib/songselect.py (+43/-23)
openlp/plugins/songs/lib/songstab.py (+91/-56)
openlp/plugins/songs/lib/ui.py (+18/-18)
openlp/plugins/songs/lib/upgrade.py (+21/-21)
openlp/plugins/songs/reporting.py (+19/-26)
openlp/plugins/songs/songsplugin.py (+73/-23)
openlp/plugins/songusage/__init__.py (+18/-18)
openlp/plugins/songusage/forms/__init__.py (+18/-18)
openlp/plugins/songusage/forms/songusagedeletedialog.py (+18/-18)
openlp/plugins/songusage/forms/songusagedeleteform.py (+18/-18)
openlp/plugins/songusage/forms/songusagedetaildialog.py (+18/-18)
openlp/plugins/songusage/forms/songusagedetailform.py (+21/-21)
openlp/plugins/songusage/lib/__init__.py (+18/-18)
openlp/plugins/songusage/lib/db.py (+18/-18)
openlp/plugins/songusage/lib/upgrade.py (+18/-18)
openlp/plugins/songusage/songusageplugin.py (+18/-18)
package.json (+2/-2)
resources/forms/about.ui (+240/-107)
run_openlp.py (+26/-20)
scripts/appveyor-webhook.py (+18/-18)
scripts/appveyor.yml (+18/-18)
scripts/check_dependencies.py (+28/-22)
scripts/clean_up_resources.py (+18/-18)
scripts/generate_resources.sh (+18/-18)
scripts/jenkins_script.py (+18/-18)
scripts/lp-merge.py (+18/-18)
scripts/resources.patch (+18/-18)
scripts/translation_utils.py (+18/-18)
scripts/websocket_client.py (+18/-18)
setup.cfg (+4/-0)
setup.py (+53/-49)
tests/__init__.py (+18/-18)
tests/functional/__init__.py (+18/-18)
tests/functional/openlp_core/__init__.py (+18/-18)
tests/functional/openlp_core/api/__init__.py (+18/-18)
tests/functional/openlp_core/api/endpoint/test_controller.py (+18/-18)
tests/functional/openlp_core/api/endpoint/test_remote.py (+18/-18)
tests/functional/openlp_core/api/http/__init__.py (+18/-18)
tests/functional/openlp_core/api/http/test_error.py (+18/-18)
tests/functional/openlp_core/api/http/test_http.py (+18/-18)
tests/functional/openlp_core/api/http/test_init.py (+18/-18)
tests/functional/openlp_core/api/http/test_wsgiapp.py (+18/-18)
tests/functional/openlp_core/api/test_deploy.py (+26/-25)
tests/functional/openlp_core/api/test_tab.py (+18/-18)
tests/functional/openlp_core/api/test_websockets.py (+18/-18)
tests/functional/openlp_core/common/__init__.py (+18/-18)
tests/functional/openlp_core/common/test_actions.py (+18/-18)
tests/functional/openlp_core/common/test_applocation.py (+19/-19)
tests/functional/openlp_core/common/test_common.py (+23/-23)
tests/functional/openlp_core/common/test_db.py (+18/-18)
tests/functional/openlp_core/common/test_httputils.py (+24/-28)
tests/functional/openlp_core/common/test_i18n.py (+18/-18)
tests/functional/openlp_core/common/test_init.py (+35/-29)
tests/functional/openlp_core/common/test_json.py (+216/-38)
tests/functional/openlp_core/common/test_mixins.py (+18/-18)
tests/functional/openlp_core/common/test_path.py (+33/-208)
tests/functional/openlp_core/common/test_registry.py (+18/-18)
tests/functional/openlp_core/common/test_settings.py (+20/-19)
tests/functional/openlp_core/display/__init__.py (+18/-18)
tests/functional/openlp_core/display/test_render.py (+18/-18)
tests/functional/openlp_core/display/test_screens.py (+18/-18)
tests/functional/openlp_core/lib/__init__.py (+18/-18)
tests/functional/openlp_core/lib/test_db.py (+19/-19)
tests/functional/openlp_core/lib/test_exceptions.py (+18/-18)
tests/functional/openlp_core/lib/test_formattingtags.py (+18/-18)
tests/functional/openlp_core/lib/test_image_manager.py (+20/-20)
tests/functional/openlp_core/lib/test_lib.py (+199/-21)
tests/functional/openlp_core/lib/test_mediamanageritem.py (+18/-18)
tests/functional/openlp_core/lib/test_pluginmanager.py (+18/-18)
tests/functional/openlp_core/lib/test_serviceitem.py (+23/-23)
tests/functional/openlp_core/lib/test_theme.py (+18/-18)
tests/functional/openlp_core/lib/test_ui.py (+18/-18)
tests/functional/openlp_core/test_app.py (+43/-20)
tests/functional/openlp_core/test_server.py (+21/-22)
tests/functional/openlp_core/test_state.py (+18/-18)
tests/functional/openlp_core/test_threading.py (+23/-27)
tests/functional/openlp_core/test_version.py (+18/-18)
tests/functional/openlp_core/ui/__init__.py (+18/-18)
tests/functional/openlp_core/ui/media/__init__.py (+18/-18)
tests/functional/openlp_core/ui/media/test_mediacontroller.py (+61/-41)
tests/functional/openlp_core/ui/media/test_systemplayer.py (+0/-567)
tests/functional/openlp_core/ui/media/test_vlcplayer.py (+109/-159)
tests/functional/openlp_core/ui/test_aboutform.py (+18/-18)
tests/functional/openlp_core/ui/test_advancedtab.py (+18/-18)
tests/functional/openlp_core/ui/test_exceptionform.py (+19/-19)
tests/functional/openlp_core/ui/test_first_time.py (+18/-18)
tests/functional/openlp_core/ui/test_firsttimeform.py (+234/-111)
tests/functional/openlp_core/ui/test_formattingtagscontroller.py (+18/-18)
tests/functional/openlp_core/ui/test_formattingtagsform.py (+18/-18)
tests/functional/openlp_core/ui/test_icons.py (+18/-18)
tests/functional/openlp_core/ui/test_mainwindow.py (+19/-20)
tests/functional/openlp_core/ui/test_media.py (+18/-18)
tests/functional/openlp_core/ui/test_servicemanager.py (+18/-18)
tests/functional/openlp_core/ui/test_settingsform.py (+18/-18)
tests/functional/openlp_core/ui/test_shortcutlistdialog.py (+18/-18)
tests/functional/openlp_core/ui/test_slidecontroller.py (+18/-18)
tests/functional/openlp_core/ui/test_style.py (+18/-18)
tests/functional/openlp_core/ui/test_themeform.py (+19/-19)
tests/functional/openlp_core/ui/test_thememanager.py (+37/-37)
tests/functional/openlp_core/ui/test_themetab.py (+18/-18)
tests/functional/openlp_core/widgets/__init__.py (+18/-18)
tests/functional/openlp_core/widgets/test_buttons.py (+18/-18)
tests/functional/openlp_core/widgets/test_dialogs.py (+22/-1)
tests/functional/openlp_core/widgets/test_edits.py (+19/-19)
tests/functional/openlp_core/widgets/test_views.py (+18/-18)
tests/functional/openlp_core/widgets/test_widgets.py (+18/-18)
tests/functional/openlp_plugins/__init__.py (+18/-18)
tests/functional/openlp_plugins/alerts/__init__.py (+18/-18)
tests/functional/openlp_plugins/alerts/test_manager.py (+18/-18)
tests/functional/openlp_plugins/bibles/__init__.py (+18/-18)
tests/functional/openlp_plugins/bibles/test_bibleimport.py (+19/-19)
tests/functional/openlp_plugins/bibles/test_bibleserver.py (+18/-18)
tests/functional/openlp_plugins/bibles/test_csvimport.py (+20/-21)
tests/functional/openlp_plugins/bibles/test_db.py (+18/-18)
tests/functional/openlp_plugins/bibles/test_lib.py (+18/-18)
tests/functional/openlp_plugins/bibles/test_manager.py (+22/-21)
tests/functional/openlp_plugins/bibles/test_mediaitem.py (+18/-18)
tests/functional/openlp_plugins/bibles/test_opensongimport.py (+18/-18)
tests/functional/openlp_plugins/bibles/test_osisimport.py (+18/-18)
tests/functional/openlp_plugins/bibles/test_swordimport.py (+18/-18)
tests/functional/openlp_plugins/bibles/test_upgrade.py (+18/-18)
tests/functional/openlp_plugins/bibles/test_versereferencelist.py (+18/-18)
tests/functional/openlp_plugins/bibles/test_wordprojectimport.py (+19/-19)
tests/functional/openlp_plugins/bibles/test_zefaniaimport.py (+18/-18)
tests/functional/openlp_plugins/custom/__init__.py (+18/-18)
tests/functional/openlp_plugins/custom/test_mediaitem.py (+18/-18)
tests/functional/openlp_plugins/images/__init__.py (+18/-18)
tests/functional/openlp_plugins/images/test_imagetab.py (+18/-18)
tests/functional/openlp_plugins/images/test_lib.py (+19/-19)
tests/functional/openlp_plugins/images/test_upgrade.py (+19/-19)
tests/functional/openlp_plugins/media/test_mediaitem.py (+19/-19)
tests/functional/openlp_plugins/media/test_mediaplugin.py (+19/-19)
tests/functional/openlp_plugins/presentations/__init__.py (+18/-18)
tests/functional/openlp_plugins/presentations/test_impresscontroller.py (+18/-18)
tests/functional/openlp_plugins/presentations/test_libreofficeserver.py (+948/-0)
tests/functional/openlp_plugins/presentations/test_maclocontroller.py (+453/-0)
tests/functional/openlp_plugins/presentations/test_mediaitem.py (+23/-20)
tests/functional/openlp_plugins/presentations/test_messagelistener.py (+18/-18)
tests/functional/openlp_plugins/presentations/test_pdfcontroller.py (+70/-34)
tests/functional/openlp_plugins/presentations/test_powerpointcontroller.py (+18/-18)
tests/functional/openlp_plugins/presentations/test_pptviewcontroller.py.THIS (+18/-18)
tests/functional/openlp_plugins/presentations/test_presentationcontroller.py (+19/-19)
tests/functional/openlp_plugins/songs/__init__.py (+18/-18)
tests/functional/openlp_plugins/songs/test_chordproimport.py (+18/-18)
tests/functional/openlp_plugins/songs/test_db.py (+18/-18)
tests/functional/openlp_plugins/songs/test_easyslidesimport.py (+19/-18)
tests/functional/openlp_plugins/songs/test_editsongform.py (+18/-18)
tests/functional/openlp_plugins/songs/test_editverseform.py (+18/-18)
tests/functional/openlp_plugins/songs/test_ewimport.py (+18/-18)
tests/functional/openlp_plugins/songs/test_foilpresenterimport.py (+18/-18)
tests/functional/openlp_plugins/songs/test_lib.py (+19/-19)
tests/functional/openlp_plugins/songs/test_lyriximport.py (+19/-18)
tests/functional/openlp_plugins/songs/test_mediaitem.py (+125/-87)
tests/functional/openlp_plugins/songs/test_mediashout.py (+18/-18)
tests/functional/openlp_plugins/songs/test_openlpimporter.py (+24/-24)
tests/functional/openlp_plugins/songs/test_openlyricsexport.py (+21/-20)
tests/functional/openlp_plugins/songs/test_openlyricsimport.py (+18/-18)
tests/functional/openlp_plugins/songs/test_openoffice.py (+18/-18)
tests/functional/openlp_plugins/songs/test_opensongimport.py (+18/-18)
tests/functional/openlp_plugins/songs/test_opsproimport.py (+18/-18)
tests/functional/openlp_plugins/songs/test_powerpraiseimport.py (+18/-18)
tests/functional/openlp_plugins/songs/test_presentationmanagerimport.py (+22/-18)
tests/functional/openlp_plugins/songs/test_propresenterimport.py (+18/-18)
tests/functional/openlp_plugins/songs/test_songbeamerimport.py (+18/-18)
tests/functional/openlp_plugins/songs/test_songformat.py (+18/-18)
tests/functional/openlp_plugins/songs/test_songproimport.py (+18/-18)
tests/functional/openlp_plugins/songs/test_songselect.py (+30/-25)
tests/functional/openlp_plugins/songs/test_songshowplusimport.py (+18/-18)
tests/functional/openlp_plugins/songs/test_sundayplusimport.py (+19/-18)
tests/functional/openlp_plugins/songs/test_videopsalm.py (+19/-18)
tests/functional/openlp_plugins/songs/test_wordsofworshipimport.py (+54/-30)
tests/functional/openlp_plugins/songs/test_worshipassistantimport.py (+18/-18)
tests/functional/openlp_plugins/songs/test_worshipcenterproimport.py (+18/-18)
tests/functional/openlp_plugins/songs/test_zionworximport.py (+18/-18)
tests/functional/openlp_plugins/songusage/__init__.py (+18/-18)
tests/functional/openlp_plugins/songusage/test_songusage.py (+20/-20)
tests/helpers/__init__.py (+18/-18)
tests/helpers/songfileimport.py (+19/-19)
tests/helpers/testmixin.py (+18/-18)
tests/interfaces/__init__.py (+18/-18)
tests/interfaces/openlp_core/__init__.py (+18/-18)
tests/interfaces/openlp_core/api/__init__.py (+18/-18)
tests/interfaces/openlp_core/common/__init__.py (+18/-18)
tests/interfaces/openlp_core/common/test_utils.py (+18/-18)
tests/interfaces/openlp_core/lib/__init__.py (+18/-18)
tests/interfaces/openlp_core/lib/test_pluginmanager.py (+21/-20)
tests/interfaces/openlp_core/ui/__init__.py (+18/-18)
tests/interfaces/openlp_core/ui/lib/__init__.py (+18/-18)
tests/interfaces/openlp_core/ui/test_filerenamedialog.py (+18/-18)
tests/interfaces/openlp_core/ui/test_firsttimeform.py (+88/-0)
tests/interfaces/openlp_core/ui/test_init.py (+18/-18)
tests/interfaces/openlp_core/ui/test_mainwindow.py (+18/-18)
tests/interfaces/openlp_core/ui/test_servicemanager.py (+18/-18)
tests/interfaces/openlp_core/ui/test_servicenotedialog.py (+18/-18)
tests/interfaces/openlp_core/ui/test_settings_form.py (+18/-18)
tests/interfaces/openlp_core/ui/test_shortcutlistform.py (+18/-18)
tests/interfaces/openlp_core/ui/test_starttimedialog.py (+18/-18)
tests/interfaces/openlp_core/ui/test_thememanager.py (+19/-19)
tests/interfaces/openlp_core/widgets/__init__.py (+18/-18)
tests/interfaces/openlp_core/widgets/test_edits.py (+18/-18)
tests/interfaces/openlp_core/widgets/test_views.py (+18/-18)
tests/interfaces/openlp_core/widgets/test_widgets.py (+18/-18)
tests/interfaces/openlp_plugins/__init__.py (+18/-18)
tests/interfaces/openlp_plugins/bibles/__init__.py (+18/-18)
tests/interfaces/openlp_plugins/bibles/forms/__init__.py (+18/-18)
tests/interfaces/openlp_plugins/bibles/forms/test_bibleimportform.py (+18/-18)
tests/interfaces/openlp_plugins/bibles/test_lib_http.py (+18/-18)
tests/interfaces/openlp_plugins/bibles/test_lib_manager.py (+18/-18)
tests/interfaces/openlp_plugins/bibles/test_lib_parse_reference.py (+18/-18)
tests/interfaces/openlp_plugins/custom/__init__.py (+18/-18)
tests/interfaces/openlp_plugins/custom/forms/__init__.py (+18/-18)
tests/interfaces/openlp_plugins/custom/forms/test_customform.py (+18/-18)
tests/interfaces/openlp_plugins/custom/forms/test_customslideform.py (+18/-18)
tests/interfaces/openlp_plugins/images/__init__.py (+18/-18)
tests/interfaces/openlp_plugins/images/forms/test_choosegroupform.py (+18/-18)
tests/interfaces/openlp_plugins/media/__init__.py (+18/-18)
tests/interfaces/openlp_plugins/media/forms/__init__.py (+18/-18)
tests/interfaces/openlp_plugins/media/forms/test_mediaclipselectorform.py (+18/-18)
tests/interfaces/openlp_plugins/songs/__init__.py (+18/-18)
tests/interfaces/openlp_plugins/songs/forms/__init__.py (+18/-18)
tests/interfaces/openlp_plugins/songs/forms/test_authorsform.py (+18/-18)
tests/interfaces/openlp_plugins/songs/forms/test_editsongform.py (+18/-18)
tests/interfaces/openlp_plugins/songs/forms/test_editverseform.py (+18/-18)
tests/interfaces/openlp_plugins/songs/forms/test_songmaintenanceform.py (+20/-20)
tests/interfaces/openlp_plugins/songs/forms/test_topicsform.py (+18/-18)
tests/js/test_display.js (+346/-0)
tests/openlp_core/__init__.py (+18/-18)
tests/openlp_core/common/test_network_interfaces.py (+19/-19)
tests/openlp_core/projectors/__init__.py (+18/-18)
tests/openlp_core/projectors/test_projector_bugfixes_01.py (+23/-23)
tests/openlp_core/projectors/test_projector_command_routing.py (+225/-0)
tests/openlp_core/projectors/test_projector_commands_01.py (+483/-741)
tests/openlp_core/projectors/test_projector_commands_02.py (+550/-0)
tests/openlp_core/projectors/test_projector_commands_03.py (+234/-329)
tests/openlp_core/projectors/test_projector_constants.py (+20/-19)
tests/openlp_core/projectors/test_projector_db.py (+22/-21)
tests/openlp_core/projectors/test_projector_editform.py (+18/-18)
tests/openlp_core/projectors/test_projector_pjlink_base_01.py (+368/-380)
tests/openlp_core/projectors/test_projector_pjlink_base_02.py (+645/-78)
tests/openlp_core/projectors/test_projector_pjlink_base_03.py (+130/-0)
tests/openlp_core/projectors/test_projector_pjlink_cmd_routing.py (+116/-228)
tests/openlp_core/projectors/test_projector_pjlink_udp.py (+18/-19)
tests/openlp_core/projectors/test_projector_sourceform.py (+20/-20)
tests/openlp_core/projectors/test_projector_utilities.py (+18/-18)
tests/openlp_core/projectors/test_projectormanager.py (+18/-18)
tests/openlp_core/ui/test_themeform.py (+23/-19)
tests/resources/projector/data.py (+18/-18)
tests/resources/songs/wordsofworship/Amazing Grace (6 Verses)_v2_1_2.json (+1/-1)
tests/resources/songs/wordsofworship/Holy Holy Holy Lord God Almighty_v2_1_2.json (+1/-1)
tests/resources/songs/wordsofworship/Test_Song_v2_0_0.json (+18/-0)
tests/resources/songs/wordsofworship/Test_Song_v2_1_2.json (+26/-0)
tests/resources/songs/wordsofworship/When morning gilds the skies_v2_0_0.json (+1/-1)
tests/utils/__init__.py (+19/-19)
tests/utils/constants.py (+19/-20)
tests/utils/osdinteraction.py (+18/-18)
tests/utils/test_bzr_tags.py (+23/-20)
tests/utils/test_pylint.py (+18/-18)
To merge this branch: bzr merge lp:~ic90/openlp/animated-alerts
Reviewer Review Type Date Requested Status
Tomas Groth Needs Fixing
Raoul Snyman Needs Fixing
Nico Opiyo Pending
Review via email: mp+363053@code.launchpad.net

This proposal supersedes a proposal from 2019-02-06.

Commit message

Refactored the tests and optimized alert display code plus fixed spacing

Description of the change

Refactored the tests and optimized alert display code plus fixed spacing

JS Test Output is as below:
PhantomJS 2.1.1 (Windows 8.0.0) Display.setTextSlides should correctly set outline width FAILED
        TypeError: undefined is not an object (evaluating 'dom.wrapper.querySelectorAll') in openlp/core/display/html/reveal.js (line 2304)
        slide@openlp/core/display/html/reveal.js:2304:37
        goToSlide@openlp/core/display/html/display.js:712:19
        setTextSlides@openlp/core/display/html/display.js:569:22
        tests/js/test_display.js:365:26
PhantomJS 2.1.1 (Windows 8.0.0): Executed 68 of 68 (1 FAILED) (0 secs / 0.099 secs)
PhantomJS 2.1.1 (Windows 8.0.0): Executed 68 of 68 (1 FAILED) (0.127 secs / 0.099 secs)
TOTAL: 1 FAILED, 67 SUCCESS

To post a comment you must log in.
Revision history for this message
Raoul Snyman (raoul-snyman) wrote : Posted in a previous version of this proposal

See the inline comments.

Also, in your tests you seem to be testing a single style every time, you should be able to combine those into a single test. For example:

   it("should set the correct styles when the location is the top of the page", function(){
       Display.doEntranceTransition("0");
       expect(alertBackground.style.top).toEqual('0px');
       expect(alertBackground.style.transition).toEqual("2s linear");
       expect(alertBackground.style.height).toEqual("25%");
   });

review: Needs Fixing
Revision history for this message
Nico Opiyo (ic90) wrote : Posted in a previous version of this proposal

Javascript Test Output:

PhantomJS 2.1.1 (Windows 8.0.0) Display.setTextSlides should correctly set outline width FAILED
        TypeError: undefined is not an object (evaluating 'dom.wrapper.querySelectorAll') in openlp/core/display/html/reveal.js (line 2304)
        slide@openlp/core/display/html/reveal.js:2304:37
        goToSlide@openlp/core/display/html/display.js:712:19
        setTextSlides@openlp/core/display/html/display.js:569:22
        tests/js/test_display.js:365:26
PhantomJS 2.1.1 (Windows 8.0.0): Executed 68 of 68 (1 FAILED) (0 secs / 0.063 secs)
PhantomJS 2.1.1 (Windows 8.0.0): Executed 68 of 68 (1 FAILED) (0.073 secs / 0.063 secs)
TOTAL: 1 FAILED, 67 SUCCESS

Revision history for this message
Raoul Snyman (raoul-snyman) wrote :

I just actually ran the alerts, and there are some problems :-(

Almost none of the settings in the Settings dialog seem to have any effect on the alerts:

- font isn't applied
- font size is not applied either
- alert duration seems to be ignored
- there's no option to turn off the scrolling

review: Needs Fixing
lp:~ic90/openlp/animated-alerts updated
2867. By Nico Opiyo

Refactored transition code and added settings from alert settings configuration

2868. By Nico Opiyo

Refactored the tests for the alerts to mkae them DRY

2869. By Nico Opiyo

Refactored the hex_to_rgb method in the alerts manager class

2870. By Nico Opiyo

Added queuing functionality to the alerts

2871. By Nico Opiyo

Added a few tests and fixed failing JS tests

2872. By Nico Opiyo

Fixed exit transition bug

2873. By Nico Opiyo

Added scrolling option to alerts

2874. By Nico Opiyo

Fixed tests and refactored event listeners for effective testing

2875. By Nico Opiyo

Fixed buggy alerts and refactored CSS

2876. By Nico Opiyo

Cleaned up Javascript and refactored the functions and tests plus optimized animation of text

2877. By Nico Opiyo

Fixed all tests and changed entrance transition to class based toggling

2878. By Nico Opiyo

Fixed queue bug when showing alerts from the queue

2879. By Nico Opiyo

Fixed alert positioning with CSS flexbox and also fixed non-scrolling alert display

2880. By Nico Opiyo

Pulled in changes from trunk

2881. By Nico Opiyo

Fixed scrolling bug display

Revision history for this message
Tomas Groth (tomasgroth) wrote :

You need to make the merge request against the trunk repo, not webengine-migrate, since that is no longer used.

review: Needs Fixing
lp:~ic90/openlp/animated-alerts updated
2882. By Nico Opiyo

Fixed unit tests for alerts branch

2883. By Nico Opiyo

Pulled in latest changes from trunk

2884. By Nico Opiyo

Changed variable names to camelCase and added parameter for Jenkins JS tests

Unmerged revisions

2884. By Nico Opiyo

Changed variable names to camelCase and added parameter for Jenkins JS tests

2883. By Nico Opiyo

Pulled in latest changes from trunk

2882. By Nico Opiyo

Fixed unit tests for alerts branch

2881. By Nico Opiyo

Fixed scrolling bug display

2880. By Nico Opiyo

Pulled in changes from trunk

2879. By Nico Opiyo

Fixed alert positioning with CSS flexbox and also fixed non-scrolling alert display

2878. By Nico Opiyo

Fixed queue bug when showing alerts from the queue

2877. By Nico Opiyo

Fixed all tests and changed entrance transition to class based toggling

2876. By Nico Opiyo

Cleaned up Javascript and refactored the functions and tests plus optimized animation of text

2875. By Nico Opiyo

Fixed buggy alerts and refactored CSS

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file '.bzrignore'
2--- .bzrignore 2018-09-07 06:43:01 +0000
3+++ .bzrignore 2019-07-01 17:47:01 +0000
4@@ -1,55 +1,48 @@
5 *.*~
6-*.~\?~
7-\#*\#
8-build
9-.cache
10-cover
11-.coverage
12-coverage
13-.directory
14-dist
15 *.dll
16-documentation/build/doctrees
17-documentation/build/html
18 *.e4*
19-*eric[1-9]project
20-.git
21-# Git files
22-.gitignore
23-htmlcov
24-.idea
25 *.kate-swp
26 *.kdev4
27-.kdev4
28 *.komodoproject
29-.komodotools
30-list
31 *.log*
32 *.nja
33-openlp.cfg
34-openlp/core/resources.py.old
35-OpenLP.egg-info
36-openlp.org 2.0.e4*
37-openlp.pro
38-openlp-test-projectordb.sqlite
39 *.orig
40-output
41 *.pyc
42-__pycache__
43-.pylint.d
44-.pytest_cache
45 *.qm
46 *.rej
47-# Rejected diff's
48-resources/innosetup/Output
49-resources/windows/warnOpenLP.txt
50 *.ropeproject
51-tags
52-output
53+*.~\?~
54+*eric[1-9]project
55+.cache
56+.coverage
57+.directory
58+.git
59+.gitignore
60+.idea
61+.kdev4
62+.komodotools
63+.pylint.d
64+.pytest_cache
65+.vscode
66+OpenLP.egg-info
67+\#*\#
68+__pycache__
69+build
70+cover
71+coverage
72+dist
73+env
74 htmlcov
75+list
76 node_modules
77 openlp-test-projectordb.sqlite
78+openlp.cfg
79+openlp.pro
80+openlp/core/resources.py.old
81+openlp/plugins/presentations/lib/vendor/Pyro4
82+openlp/plugins/presentations/lib/vendor/serpent.py
83+output
84 package-lock.json
85-.cache
86+tags
87 test
88 tests.kdev4
89
90=== modified file 'LICENSE'
91--- LICENSE 2011-02-24 05:47:38 +0000
92+++ LICENSE 2019-07-01 17:47:01 +0000
93@@ -1,285 +1,626 @@
94- GNU GENERAL PUBLIC LICENSE
95- Version 2, June 1991
96+ GNU GENERAL PUBLIC LICENSE
97+ Version 3, 29 June 2007
98
99- Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
100- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
101+ Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
102 Everyone is permitted to copy and distribute verbatim copies
103 of this license document, but changing it is not allowed.
104
105- Preamble
106-
107- The licenses for most software are designed to take away your
108-freedom to share and change it. By contrast, the GNU General Public
109-License is intended to guarantee your freedom to share and change free
110-software--to make sure the software is free for all its users. This
111-General Public License applies to most of the Free Software
112-Foundation's software and to any other program whose authors commit to
113-using it. (Some other Free Software Foundation software is covered by
114-the GNU Lesser General Public License instead.) You can apply it to
115+ Preamble
116+
117+ The GNU General Public License is a free, copyleft license for
118+software and other kinds of works.
119+
120+ The licenses for most software and other practical works are designed
121+to take away your freedom to share and change the works. By contrast,
122+the GNU General Public License is intended to guarantee your freedom to
123+share and change all versions of a program--to make sure it remains free
124+software for all its users. We, the Free Software Foundation, use the
125+GNU General Public License for most of our software; it applies also to
126+any other work released this way by its authors. You can apply it to
127 your programs, too.
128
129 When we speak of free software, we are referring to freedom, not
130 price. Our General Public Licenses are designed to make sure that you
131 have the freedom to distribute copies of free software (and charge for
132-this service if you wish), that you receive source code or can get it
133-if you want it, that you can change the software or use pieces of it
134-in new free programs; and that you know you can do these things.
135+them if you wish), that you receive source code or can get it if you
136+want it, that you can change the software or use pieces of it in new
137+free programs, and that you know you can do these things.
138
139- To protect your rights, we need to make restrictions that forbid
140-anyone to deny you these rights or to ask you to surrender the rights.
141-These restrictions translate to certain responsibilities for you if you
142-distribute copies of the software, or if you modify it.
143+ To protect your rights, we need to prevent others from denying you
144+these rights or asking you to surrender the rights. Therefore, you have
145+certain responsibilities if you distribute copies of the software, or if
146+you modify it: responsibilities to respect the freedom of others.
147
148 For example, if you distribute copies of such a program, whether
149-gratis or for a fee, you must give the recipients all the rights that
150-you have. You must make sure that they, too, receive or can get the
151-source code. And you must show them these terms so they know their
152-rights.
153-
154- We protect your rights with two steps: (1) copyright the software, and
155-(2) offer you this license which gives you legal permission to copy,
156-distribute and/or modify the software.
157-
158- Also, for each author's protection and ours, we want to make certain
159-that everyone understands that there is no warranty for this free
160-software. If the software is modified by someone else and passed on, we
161-want its recipients to know that what they have is not the original, so
162-that any problems introduced by others will not reflect on the original
163-authors' reputations.
164-
165- Finally, any free program is threatened constantly by software
166-patents. We wish to avoid the danger that redistributors of a free
167-program will individually obtain patent licenses, in effect making the
168-program proprietary. To prevent this, we have made it clear that any
169-patent must be licensed for everyone's free use or not licensed at all.
170+gratis or for a fee, you must pass on to the recipients the same
171+freedoms that you received. You must make sure that they, too, receive
172+or can get the source code. And you must show them these terms so they
173+know their rights.
174+
175+ Developers that use the GNU GPL protect your rights with two steps:
176+(1) assert copyright on the software, and (2) offer you this License
177+giving you legal permission to copy, distribute and/or modify it.
178+
179+ For the developers' and authors' protection, the GPL clearly explains
180+that there is no warranty for this free software. For both users' and
181+authors' sake, the GPL requires that modified versions be marked as
182+changed, so that their problems will not be attributed erroneously to
183+authors of previous versions.
184+
185+ Some devices are designed to deny users access to install or run
186+modified versions of the software inside them, although the manufacturer
187+can do so. This is fundamentally incompatible with the aim of
188+protecting users' freedom to change the software. The systematic
189+pattern of such abuse occurs in the area of products for individuals to
190+use, which is precisely where it is most unacceptable. Therefore, we
191+have designed this version of the GPL to prohibit the practice for those
192+products. If such problems arise substantially in other domains, we
193+stand ready to extend this provision to those domains in future versions
194+of the GPL, as needed to protect the freedom of users.
195+
196+ Finally, every program is threatened constantly by software patents.
197+States should not allow patents to restrict development and use of
198+software on general-purpose computers, but in those that do, we wish to
199+avoid the special danger that patents applied to a free program could
200+make it effectively proprietary. To prevent this, the GPL assures that
201+patents cannot be used to render the program non-free.
202
203 The precise terms and conditions for copying, distribution and
204 modification follow.
205
206- GNU GENERAL PUBLIC LICENSE
207- TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
208-
209- 0. This License applies to any program or other work which contains
210-a notice placed by the copyright holder saying it may be distributed
211-under the terms of this General Public License. The "Program", below,
212-refers to any such program or work, and a "work based on the Program"
213-means either the Program or any derivative work under copyright law:
214-that is to say, a work containing the Program or a portion of it,
215-either verbatim or with modifications and/or translated into another
216-language. (Hereinafter, translation is included without limitation in
217-the term "modification".) Each licensee is addressed as "you".
218-
219-Activities other than copying, distribution and modification are not
220-covered by this License; they are outside its scope. The act of
221-running the Program is not restricted, and the output from the Program
222-is covered only if its contents constitute a work based on the
223-Program (independent of having been made by running the Program).
224-Whether that is true depends on what the Program does.
225-
226- 1. You may copy and distribute verbatim copies of the Program's
227-source code as you receive it, in any medium, provided that you
228-conspicuously and appropriately publish on each copy an appropriate
229-copyright notice and disclaimer of warranty; keep intact all the
230-notices that refer to this License and to the absence of any warranty;
231-and give any other recipients of the Program a copy of this License
232-along with the Program.
233-
234-You may charge a fee for the physical act of transferring a copy, and
235-you may at your option offer warranty protection in exchange for a fee.
236-
237- 2. You may modify your copy or copies of the Program or any portion
238-of it, thus forming a work based on the Program, and copy and
239-distribute such modifications or work under the terms of Section 1
240-above, provided that you also meet all of these conditions:
241-
242- a) You must cause the modified files to carry prominent notices
243- stating that you changed the files and the date of any change.
244-
245- b) You must cause any work that you distribute or publish, that in
246- whole or in part contains or is derived from the Program or any
247- part thereof, to be licensed as a whole at no charge to all third
248- parties under the terms of this License.
249-
250- c) If the modified program normally reads commands interactively
251- when run, you must cause it, when started running for such
252- interactive use in the most ordinary way, to print or display an
253- announcement including an appropriate copyright notice and a
254- notice that there is no warranty (or else, saying that you provide
255- a warranty) and that users may redistribute the program under
256- these conditions, and telling the user how to view a copy of this
257- License. (Exception: if the Program itself is interactive but
258- does not normally print such an announcement, your work based on
259- the Program is not required to print an announcement.)
260-
261-These requirements apply to the modified work as a whole. If
262-identifiable sections of that work are not derived from the Program,
263-and can be reasonably considered independent and separate works in
264-themselves, then this License, and its terms, do not apply to those
265-sections when you distribute them as separate works. But when you
266-distribute the same sections as part of a whole which is a work based
267-on the Program, the distribution of the whole must be on the terms of
268-this License, whose permissions for other licensees extend to the
269-entire whole, and thus to each and every part regardless of who wrote it.
270-
271-Thus, it is not the intent of this section to claim rights or contest
272-your rights to work written entirely by you; rather, the intent is to
273-exercise the right to control the distribution of derivative or
274-collective works based on the Program.
275-
276-In addition, mere aggregation of another work not based on the Program
277-with the Program (or with a work based on the Program) on a volume of
278-a storage or distribution medium does not bring the other work under
279-the scope of this License.
280-
281- 3. You may copy and distribute the Program (or a work based on it,
282-under Section 2) in object code or executable form under the terms of
283-Sections 1 and 2 above provided that you also do one of the following:
284-
285- a) Accompany it with the complete corresponding machine-readable
286- source code, which must be distributed under the terms of Sections
287- 1 and 2 above on a medium customarily used for software interchange; or,
288-
289- b) Accompany it with a written offer, valid for at least three
290- years, to give any third party, for a charge no more than your
291- cost of physically performing source distribution, a complete
292- machine-readable copy of the corresponding source code, to be
293- distributed under the terms of Sections 1 and 2 above on a medium
294- customarily used for software interchange; or,
295-
296- c) Accompany it with the information you received as to the offer
297- to distribute corresponding source code. (This alternative is
298- allowed only for noncommercial distribution and only if you
299- received the program in object code or executable form with such
300- an offer, in accord with Subsection b above.)
301-
302-The source code for a work means the preferred form of the work for
303-making modifications to it. For an executable work, complete source
304-code means all the source code for all modules it contains, plus any
305-associated interface definition files, plus the scripts used to
306-control compilation and installation of the executable. However, as a
307-special exception, the source code distributed need not include
308-anything that is normally distributed (in either source or binary
309-form) with the major components (compiler, kernel, and so on) of the
310-operating system on which the executable runs, unless that component
311-itself accompanies the executable.
312-
313-If distribution of executable or object code is made by offering
314-access to copy from a designated place, then offering equivalent
315-access to copy the source code from the same place counts as
316-distribution of the source code, even though third parties are not
317-compelled to copy the source along with the object code.
318-
319- 4. You may not copy, modify, sublicense, or distribute the Program
320-except as expressly provided under this License. Any attempt
321-otherwise to copy, modify, sublicense or distribute the Program is
322-void, and will automatically terminate your rights under this License.
323-However, parties who have received copies, or rights, from you under
324-this License will not have their licenses terminated so long as such
325-parties remain in full compliance.
326-
327- 5. You are not required to accept this License, since you have not
328-signed it. However, nothing else grants you permission to modify or
329-distribute the Program or its derivative works. These actions are
330-prohibited by law if you do not accept this License. Therefore, by
331-modifying or distributing the Program (or any work based on the
332-Program), you indicate your acceptance of this License to do so, and
333-all its terms and conditions for copying, distributing or modifying
334-the Program or works based on it.
335-
336- 6. Each time you redistribute the Program (or any work based on the
337-Program), the recipient automatically receives a license from the
338-original licensor to copy, distribute or modify the Program subject to
339-these terms and conditions. You may not impose any further
340-restrictions on the recipients' exercise of the rights granted herein.
341-You are not responsible for enforcing compliance by third parties to
342+ TERMS AND CONDITIONS
343+
344+ 0. Definitions.
345+
346+ "This License" refers to version 3 of the GNU General Public License.
347+
348+ "Copyright" also means copyright-like laws that apply to other kinds of
349+works, such as semiconductor masks.
350+
351+ "The Program" refers to any copyrightable work licensed under this
352+License. Each licensee is addressed as "you". "Licensees" and
353+"recipients" may be individuals or organizations.
354+
355+ To "modify" a work means to copy from or adapt all or part of the work
356+in a fashion requiring copyright permission, other than the making of an
357+exact copy. The resulting work is called a "modified version" of the
358+earlier work or a work "based on" the earlier work.
359+
360+ A "covered work" means either the unmodified Program or a work based
361+on the Program.
362+
363+ To "propagate" a work means to do anything with it that, without
364+permission, would make you directly or secondarily liable for
365+infringement under applicable copyright law, except executing it on a
366+computer or modifying a private copy. Propagation includes copying,
367+distribution (with or without modification), making available to the
368+public, and in some countries other activities as well.
369+
370+ To "convey" a work means any kind of propagation that enables other
371+parties to make or receive copies. Mere interaction with a user through
372+a computer network, with no transfer of a copy, is not conveying.
373+
374+ An interactive user interface displays "Appropriate Legal Notices"
375+to the extent that it includes a convenient and prominently visible
376+feature that (1) displays an appropriate copyright notice, and (2)
377+tells the user that there is no warranty for the work (except to the
378+extent that warranties are provided), that licensees may convey the
379+work under this License, and how to view a copy of this License. If
380+the interface presents a list of user commands or options, such as a
381+menu, a prominent item in the list meets this criterion.
382+
383+ 1. Source Code.
384+
385+ The "source code" for a work means the preferred form of the work
386+for making modifications to it. "Object code" means any non-source
387+form of a work.
388+
389+ A "Standard Interface" means an interface that either is an official
390+standard defined by a recognized standards body, or, in the case of
391+interfaces specified for a particular programming language, one that
392+is widely used among developers working in that language.
393+
394+ The "System Libraries" of an executable work include anything, other
395+than the work as a whole, that (a) is included in the normal form of
396+packaging a Major Component, but which is not part of that Major
397+Component, and (b) serves only to enable use of the work with that
398+Major Component, or to implement a Standard Interface for which an
399+implementation is available to the public in source code form. A
400+"Major Component", in this context, means a major essential component
401+(kernel, window system, and so on) of the specific operating system
402+(if any) on which the executable work runs, or a compiler used to
403+produce the work, or an object code interpreter used to run it.
404+
405+ The "Corresponding Source" for a work in object code form means all
406+the source code needed to generate, install, and (for an executable
407+work) run the object code and to modify the work, including scripts to
408+control those activities. However, it does not include the work's
409+System Libraries, or general-purpose tools or generally available free
410+programs which are used unmodified in performing those activities but
411+which are not part of the work. For example, Corresponding Source
412+includes interface definition files associated with source files for
413+the work, and the source code for shared libraries and dynamically
414+linked subprograms that the work is specifically designed to require,
415+such as by intimate data communication or control flow between those
416+subprograms and other parts of the work.
417+
418+ The Corresponding Source need not include anything that users
419+can regenerate automatically from other parts of the Corresponding
420+Source.
421+
422+ The Corresponding Source for a work in source code form is that
423+same work.
424+
425+ 2. Basic Permissions.
426+
427+ All rights granted under this License are granted for the term of
428+copyright on the Program, and are irrevocable provided the stated
429+conditions are met. This License explicitly affirms your unlimited
430+permission to run the unmodified Program. The output from running a
431+covered work is covered by this License only if the output, given its
432+content, constitutes a covered work. This License acknowledges your
433+rights of fair use or other equivalent, as provided by copyright law.
434+
435+ You may make, run and propagate covered works that you do not
436+convey, without conditions so long as your license otherwise remains
437+in force. You may convey covered works to others for the sole purpose
438+of having them make modifications exclusively for you, or provide you
439+with facilities for running those works, provided that you comply with
440+the terms of this License in conveying all material for which you do
441+not control copyright. Those thus making or running the covered works
442+for you must do so exclusively on your behalf, under your direction
443+and control, on terms that prohibit them from making any copies of
444+your copyrighted material outside their relationship with you.
445+
446+ Conveying under any other circumstances is permitted solely under
447+the conditions stated below. Sublicensing is not allowed; section 10
448+makes it unnecessary.
449+
450+ 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
451+
452+ No covered work shall be deemed part of an effective technological
453+measure under any applicable law fulfilling obligations under article
454+11 of the WIPO copyright treaty adopted on 20 December 1996, or
455+similar laws prohibiting or restricting circumvention of such
456+measures.
457+
458+ When you convey a covered work, you waive any legal power to forbid
459+circumvention of technological measures to the extent such circumvention
460+is effected by exercising rights under this License with respect to
461+the covered work, and you disclaim any intention to limit operation or
462+modification of the work as a means of enforcing, against the work's
463+users, your or third parties' legal rights to forbid circumvention of
464+technological measures.
465+
466+ 4. Conveying Verbatim Copies.
467+
468+ You may convey verbatim copies of the Program's source code as you
469+receive it, in any medium, provided that you conspicuously and
470+appropriately publish on each copy an appropriate copyright notice;
471+keep intact all notices stating that this License and any
472+non-permissive terms added in accord with section 7 apply to the code;
473+keep intact all notices of the absence of any warranty; and give all
474+recipients a copy of this License along with the Program.
475+
476+ You may charge any price or no price for each copy that you convey,
477+and you may offer support or warranty protection for a fee.
478+
479+ 5. Conveying Modified Source Versions.
480+
481+ You may convey a work based on the Program, or the modifications to
482+produce it from the Program, in the form of source code under the
483+terms of section 4, provided that you also meet all of these conditions:
484+
485+ a) The work must carry prominent notices stating that you modified
486+ it, and giving a relevant date.
487+
488+ b) The work must carry prominent notices stating that it is
489+ released under this License and any conditions added under section
490+ 7. This requirement modifies the requirement in section 4 to
491+ "keep intact all notices".
492+
493+ c) You must license the entire work, as a whole, under this
494+ License to anyone who comes into possession of a copy. This
495+ License will therefore apply, along with any applicable section 7
496+ additional terms, to the whole of the work, and all its parts,
497+ regardless of how they are packaged. This License gives no
498+ permission to license the work in any other way, but it does not
499+ invalidate such permission if you have separately received it.
500+
501+ d) If the work has interactive user interfaces, each must display
502+ Appropriate Legal Notices; however, if the Program has interactive
503+ interfaces that do not display Appropriate Legal Notices, your
504+ work need not make them do so.
505+
506+ A compilation of a covered work with other separate and independent
507+works, which are not by their nature extensions of the covered work,
508+and which are not combined with it such as to form a larger program,
509+in or on a volume of a storage or distribution medium, is called an
510+"aggregate" if the compilation and its resulting copyright are not
511+used to limit the access or legal rights of the compilation's users
512+beyond what the individual works permit. Inclusion of a covered work
513+in an aggregate does not cause this License to apply to the other
514+parts of the aggregate.
515+
516+ 6. Conveying Non-Source Forms.
517+
518+ You may convey a covered work in object code form under the terms
519+of sections 4 and 5, provided that you also convey the
520+machine-readable Corresponding Source under the terms of this License,
521+in one of these ways:
522+
523+ a) Convey the object code in, or embodied in, a physical product
524+ (including a physical distribution medium), accompanied by the
525+ Corresponding Source fixed on a durable physical medium
526+ customarily used for software interchange.
527+
528+ b) Convey the object code in, or embodied in, a physical product
529+ (including a physical distribution medium), accompanied by a
530+ written offer, valid for at least three years and valid for as
531+ long as you offer spare parts or customer support for that product
532+ model, to give anyone who possesses the object code either (1) a
533+ copy of the Corresponding Source for all the software in the
534+ product that is covered by this License, on a durable physical
535+ medium customarily used for software interchange, for a price no
536+ more than your reasonable cost of physically performing this
537+ conveying of source, or (2) access to copy the
538+ Corresponding Source from a network server at no charge.
539+
540+ c) Convey individual copies of the object code with a copy of the
541+ written offer to provide the Corresponding Source. This
542+ alternative is allowed only occasionally and noncommercially, and
543+ only if you received the object code with such an offer, in accord
544+ with subsection 6b.
545+
546+ d) Convey the object code by offering access from a designated
547+ place (gratis or for a charge), and offer equivalent access to the
548+ Corresponding Source in the same way through the same place at no
549+ further charge. You need not require recipients to copy the
550+ Corresponding Source along with the object code. If the place to
551+ copy the object code is a network server, the Corresponding Source
552+ may be on a different server (operated by you or a third party)
553+ that supports equivalent copying facilities, provided you maintain
554+ clear directions next to the object code saying where to find the
555+ Corresponding Source. Regardless of what server hosts the
556+ Corresponding Source, you remain obligated to ensure that it is
557+ available for as long as needed to satisfy these requirements.
558+
559+ e) Convey the object code using peer-to-peer transmission, provided
560+ you inform other peers where the object code and Corresponding
561+ Source of the work are being offered to the general public at no
562+ charge under subsection 6d.
563+
564+ A separable portion of the object code, whose source code is excluded
565+from the Corresponding Source as a System Library, need not be
566+included in conveying the object code work.
567+
568+ A "User Product" is either (1) a "consumer product", which means any
569+tangible personal property which is normally used for personal, family,
570+or household purposes, or (2) anything designed or sold for incorporation
571+into a dwelling. In determining whether a product is a consumer product,
572+doubtful cases shall be resolved in favor of coverage. For a particular
573+product received by a particular user, "normally used" refers to a
574+typical or common use of that class of product, regardless of the status
575+of the particular user or of the way in which the particular user
576+actually uses, or expects or is expected to use, the product. A product
577+is a consumer product regardless of whether the product has substantial
578+commercial, industrial or non-consumer uses, unless such uses represent
579+the only significant mode of use of the product.
580+
581+ "Installation Information" for a User Product means any methods,
582+procedures, authorization keys, or other information required to install
583+and execute modified versions of a covered work in that User Product from
584+a modified version of its Corresponding Source. The information must
585+suffice to ensure that the continued functioning of the modified object
586+code is in no case prevented or interfered with solely because
587+modification has been made.
588+
589+ If you convey an object code work under this section in, or with, or
590+specifically for use in, a User Product, and the conveying occurs as
591+part of a transaction in which the right of possession and use of the
592+User Product is transferred to the recipient in perpetuity or for a
593+fixed term (regardless of how the transaction is characterized), the
594+Corresponding Source conveyed under this section must be accompanied
595+by the Installation Information. But this requirement does not apply
596+if neither you nor any third party retains the ability to install
597+modified object code on the User Product (for example, the work has
598+been installed in ROM).
599+
600+ The requirement to provide Installation Information does not include a
601+requirement to continue to provide support service, warranty, or updates
602+for a work that has been modified or installed by the recipient, or for
603+the User Product in which it has been modified or installed. Access to a
604+network may be denied when the modification itself materially and
605+adversely affects the operation of the network or violates the rules and
606+protocols for communication across the network.
607+
608+ Corresponding Source conveyed, and Installation Information provided,
609+in accord with this section must be in a format that is publicly
610+documented (and with an implementation available to the public in
611+source code form), and must require no special password or key for
612+unpacking, reading or copying.
613+
614+ 7. Additional Terms.
615+
616+ "Additional permissions" are terms that supplement the terms of this
617+License by making exceptions from one or more of its conditions.
618+Additional permissions that are applicable to the entire Program shall
619+be treated as though they were included in this License, to the extent
620+that they are valid under applicable law. If additional permissions
621+apply only to part of the Program, that part may be used separately
622+under those permissions, but the entire Program remains governed by
623+this License without regard to the additional permissions.
624+
625+ When you convey a copy of a covered work, you may at your option
626+remove any additional permissions from that copy, or from any part of
627+it. (Additional permissions may be written to require their own
628+removal in certain cases when you modify the work.) You may place
629+additional permissions on material, added by you to a covered work,
630+for which you have or can give appropriate copyright permission.
631+
632+ Notwithstanding any other provision of this License, for material you
633+add to a covered work, you may (if authorized by the copyright holders of
634+that material) supplement the terms of this License with terms:
635+
636+ a) Disclaiming warranty or limiting liability differently from the
637+ terms of sections 15 and 16 of this License; or
638+
639+ b) Requiring preservation of specified reasonable legal notices or
640+ author attributions in that material or in the Appropriate Legal
641+ Notices displayed by works containing it; or
642+
643+ c) Prohibiting misrepresentation of the origin of that material, or
644+ requiring that modified versions of such material be marked in
645+ reasonable ways as different from the original version; or
646+
647+ d) Limiting the use for publicity purposes of names of licensors or
648+ authors of the material; or
649+
650+ e) Declining to grant rights under trademark law for use of some
651+ trade names, trademarks, or service marks; or
652+
653+ f) Requiring indemnification of licensors and authors of that
654+ material by anyone who conveys the material (or modified versions of
655+ it) with contractual assumptions of liability to the recipient, for
656+ any liability that these contractual assumptions directly impose on
657+ those licensors and authors.
658+
659+ All other non-permissive additional terms are considered "further
660+restrictions" within the meaning of section 10. If the Program as you
661+received it, or any part of it, contains a notice stating that it is
662+governed by this License along with a term that is a further
663+restriction, you may remove that term. If a license document contains
664+a further restriction but permits relicensing or conveying under this
665+License, you may add to a covered work material governed by the terms
666+of that license document, provided that the further restriction does
667+not survive such relicensing or conveying.
668+
669+ If you add terms to a covered work in accord with this section, you
670+must place, in the relevant source files, a statement of the
671+additional terms that apply to those files, or a notice indicating
672+where to find the applicable terms.
673+
674+ Additional terms, permissive or non-permissive, may be stated in the
675+form of a separately written license, or stated as exceptions;
676+the above requirements apply either way.
677+
678+ 8. Termination.
679+
680+ You may not propagate or modify a covered work except as expressly
681+provided under this License. Any attempt otherwise to propagate or
682+modify it is void, and will automatically terminate your rights under
683+this License (including any patent licenses granted under the third
684+paragraph of section 11).
685+
686+ However, if you cease all violation of this License, then your
687+license from a particular copyright holder is reinstated (a)
688+provisionally, unless and until the copyright holder explicitly and
689+finally terminates your license, and (b) permanently, if the copyright
690+holder fails to notify you of the violation by some reasonable means
691+prior to 60 days after the cessation.
692+
693+ Moreover, your license from a particular copyright holder is
694+reinstated permanently if the copyright holder notifies you of the
695+violation by some reasonable means, this is the first time you have
696+received notice of violation of this License (for any work) from that
697+copyright holder, and you cure the violation prior to 30 days after
698+your receipt of the notice.
699+
700+ Termination of your rights under this section does not terminate the
701+licenses of parties who have received copies or rights from you under
702+this License. If your rights have been terminated and not permanently
703+reinstated, you do not qualify to receive new licenses for the same
704+material under section 10.
705+
706+ 9. Acceptance Not Required for Having Copies.
707+
708+ You are not required to accept this License in order to receive or
709+run a copy of the Program. Ancillary propagation of a covered work
710+occurring solely as a consequence of using peer-to-peer transmission
711+to receive a copy likewise does not require acceptance. However,
712+nothing other than this License grants you permission to propagate or
713+modify any covered work. These actions infringe copyright if you do
714+not accept this License. Therefore, by modifying or propagating a
715+covered work, you indicate your acceptance of this License to do so.
716+
717+ 10. Automatic Licensing of Downstream Recipients.
718+
719+ Each time you convey a covered work, the recipient automatically
720+receives a license from the original licensors, to run, modify and
721+propagate that work, subject to this License. You are not responsible
722+for enforcing compliance by third parties with this License.
723+
724+ An "entity transaction" is a transaction transferring control of an
725+organization, or substantially all assets of one, or subdividing an
726+organization, or merging organizations. If propagation of a covered
727+work results from an entity transaction, each party to that
728+transaction who receives a copy of the work also receives whatever
729+licenses to the work the party's predecessor in interest had or could
730+give under the previous paragraph, plus a right to possession of the
731+Corresponding Source of the work from the predecessor in interest, if
732+the predecessor has it or can get it with reasonable efforts.
733+
734+ You may not impose any further restrictions on the exercise of the
735+rights granted or affirmed under this License. For example, you may
736+not impose a license fee, royalty, or other charge for exercise of
737+rights granted under this License, and you may not initiate litigation
738+(including a cross-claim or counterclaim in a lawsuit) alleging that
739+any patent claim is infringed by making, using, selling, offering for
740+sale, or importing the Program or any portion of it.
741+
742+ 11. Patents.
743+
744+ A "contributor" is a copyright holder who authorizes use under this
745+License of the Program or a work on which the Program is based. The
746+work thus licensed is called the contributor's "contributor version".
747+
748+ A contributor's "essential patent claims" are all patent claims
749+owned or controlled by the contributor, whether already acquired or
750+hereafter acquired, that would be infringed by some manner, permitted
751+by this License, of making, using, or selling its contributor version,
752+but do not include claims that would be infringed only as a
753+consequence of further modification of the contributor version. For
754+purposes of this definition, "control" includes the right to grant
755+patent sublicenses in a manner consistent with the requirements of
756 this License.
757
758- 7. If, as a consequence of a court judgment or allegation of patent
759-infringement or for any other reason (not limited to patent issues),
760-conditions are imposed on you (whether by court order, agreement or
761+ Each contributor grants you a non-exclusive, worldwide, royalty-free
762+patent license under the contributor's essential patent claims, to
763+make, use, sell, offer for sale, import and otherwise run, modify and
764+propagate the contents of its contributor version.
765+
766+ In the following three paragraphs, a "patent license" is any express
767+agreement or commitment, however denominated, not to enforce a patent
768+(such as an express permission to practice a patent or covenant not to
769+sue for patent infringement). To "grant" such a patent license to a
770+party means to make such an agreement or commitment not to enforce a
771+patent against the party.
772+
773+ If you convey a covered work, knowingly relying on a patent license,
774+and the Corresponding Source of the work is not available for anyone
775+to copy, free of charge and under the terms of this License, through a
776+publicly available network server or other readily accessible means,
777+then you must either (1) cause the Corresponding Source to be so
778+available, or (2) arrange to deprive yourself of the benefit of the
779+patent license for this particular work, or (3) arrange, in a manner
780+consistent with the requirements of this License, to extend the patent
781+license to downstream recipients. "Knowingly relying" means you have
782+actual knowledge that, but for the patent license, your conveying the
783+covered work in a country, or your recipient's use of the covered work
784+in a country, would infringe one or more identifiable patents in that
785+country that you have reason to believe are valid.
786+
787+ If, pursuant to or in connection with a single transaction or
788+arrangement, you convey, or propagate by procuring conveyance of, a
789+covered work, and grant a patent license to some of the parties
790+receiving the covered work authorizing them to use, propagate, modify
791+or convey a specific copy of the covered work, then the patent license
792+you grant is automatically extended to all recipients of the covered
793+work and works based on it.
794+
795+ A patent license is "discriminatory" if it does not include within
796+the scope of its coverage, prohibits the exercise of, or is
797+conditioned on the non-exercise of one or more of the rights that are
798+specifically granted under this License. You may not convey a covered
799+work if you are a party to an arrangement with a third party that is
800+in the business of distributing software, under which you make payment
801+to the third party based on the extent of your activity of conveying
802+the work, and under which the third party grants, to any of the
803+parties who would receive the covered work from you, a discriminatory
804+patent license (a) in connection with copies of the covered work
805+conveyed by you (or copies made from those copies), or (b) primarily
806+for and in connection with specific products or compilations that
807+contain the covered work, unless you entered into that arrangement,
808+or that patent license was granted, prior to 28 March 2007.
809+
810+ Nothing in this License shall be construed as excluding or limiting
811+any implied license or other defenses to infringement that may
812+otherwise be available to you under applicable patent law.
813+
814+ 12. No Surrender of Others' Freedom.
815+
816+ If conditions are imposed on you (whether by court order, agreement or
817 otherwise) that contradict the conditions of this License, they do not
818-excuse you from the conditions of this License. If you cannot
819-distribute so as to satisfy simultaneously your obligations under this
820-License and any other pertinent obligations, then as a consequence you
821-may not distribute the Program at all. For example, if a patent
822-license would not permit royalty-free redistribution of the Program by
823-all those who receive copies directly or indirectly through you, then
824-the only way you could satisfy both it and this License would be to
825-refrain entirely from distribution of the Program.
826-
827-If any portion of this section is held invalid or unenforceable under
828-any particular circumstance, the balance of the section is intended to
829-apply and the section as a whole is intended to apply in other
830-circumstances.
831-
832-It is not the purpose of this section to induce you to infringe any
833-patents or other property right claims or to contest validity of any
834-such claims; this section has the sole purpose of protecting the
835-integrity of the free software distribution system, which is
836-implemented by public license practices. Many people have made
837-generous contributions to the wide range of software distributed
838-through that system in reliance on consistent application of that
839-system; it is up to the author/donor to decide if he or she is willing
840-to distribute software through any other system and a licensee cannot
841-impose that choice.
842-
843-This section is intended to make thoroughly clear what is believed to
844-be a consequence of the rest of this License.
845-
846- 8. If the distribution and/or use of the Program is restricted in
847-certain countries either by patents or by copyrighted interfaces, the
848-original copyright holder who places the Program under this License
849-may add an explicit geographical distribution limitation excluding
850-those countries, so that distribution is permitted only in or among
851-countries not thus excluded. In such case, this License incorporates
852-the limitation as if written in the body of this License.
853-
854- 9. The Free Software Foundation may publish revised and/or new versions
855-of the General Public License from time to time. Such new versions will
856+excuse you from the conditions of this License. If you cannot convey a
857+covered work so as to satisfy simultaneously your obligations under this
858+License and any other pertinent obligations, then as a consequence you may
859+not convey it at all. For example, if you agree to terms that obligate you
860+to collect a royalty for further conveying from those to whom you convey
861+the Program, the only way you could satisfy both those terms and this
862+License would be to refrain entirely from conveying the Program.
863+
864+ 13. Use with the GNU Affero General Public License.
865+
866+ Notwithstanding any other provision of this License, you have
867+permission to link or combine any covered work with a work licensed
868+under version 3 of the GNU Affero General Public License into a single
869+combined work, and to convey the resulting work. The terms of this
870+License will continue to apply to the part which is the covered work,
871+but the special requirements of the GNU Affero General Public License,
872+section 13, concerning interaction through a network will apply to the
873+combination as such.
874+
875+ 14. Revised Versions of this License.
876+
877+ The Free Software Foundation may publish revised and/or new versions of
878+the GNU General Public License from time to time. Such new versions will
879 be similar in spirit to the present version, but may differ in detail to
880 address new problems or concerns.
881
882-Each version is given a distinguishing version number. If the Program
883-specifies a version number of this License which applies to it and "any
884-later version", you have the option of following the terms and conditions
885-either of that version or of any later version published by the Free
886-Software Foundation. If the Program does not specify a version number of
887-this License, you may choose any version ever published by the Free Software
888-Foundation.
889-
890- 10. If you wish to incorporate parts of the Program into other free
891-programs whose distribution conditions are different, write to the author
892-to ask for permission. For software which is copyrighted by the Free
893-Software Foundation, write to the Free Software Foundation; we sometimes
894-make exceptions for this. Our decision will be guided by the two goals
895-of preserving the free status of all derivatives of our free software and
896-of promoting the sharing and reuse of software generally.
897-
898- NO WARRANTY
899-
900- 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
901-FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
902-OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
903-PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
904-OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
905-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
906-TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
907-PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
908-REPAIR OR CORRECTION.
909-
910- 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
911-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
912-REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
913-INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
914-OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
915-TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
916-YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
917-PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
918-POSSIBILITY OF SUCH DAMAGES.
919-
920- END OF TERMS AND CONDITIONS
921-
922- How to Apply These Terms to Your New Programs
923+ Each version is given a distinguishing version number. If the
924+Program specifies that a certain numbered version of the GNU General
925+Public License "or any later version" applies to it, you have the
926+option of following the terms and conditions either of that numbered
927+version or of any later version published by the Free Software
928+Foundation. If the Program does not specify a version number of the
929+GNU General Public License, you may choose any version ever published
930+by the Free Software Foundation.
931+
932+ If the Program specifies that a proxy can decide which future
933+versions of the GNU General Public License can be used, that proxy's
934+public statement of acceptance of a version permanently authorizes you
935+to choose that version for the Program.
936+
937+ Later license versions may give you additional or different
938+permissions. However, no additional obligations are imposed on any
939+author or copyright holder as a result of your choosing to follow a
940+later version.
941+
942+ 15. Disclaimer of Warranty.
943+
944+ THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
945+APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
946+HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
947+OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
948+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
949+PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
950+IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
951+ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
952+
953+ 16. Limitation of Liability.
954+
955+ IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
956+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
957+THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
958+GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
959+USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
960+DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
961+PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
962+EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
963+SUCH DAMAGES.
964+
965+ 17. Interpretation of Sections 15 and 16.
966+
967+ If the disclaimer of warranty and limitation of liability provided
968+above cannot be given local legal effect according to their terms,
969+reviewing courts shall apply local law that most closely approximates
970+an absolute waiver of all civil liability in connection with the
971+Program, unless a warranty or assumption of liability accompanies a
972+copy of the Program in return for a fee.
973+
974+ END OF TERMS AND CONDITIONS
975+
976+ How to Apply These Terms to Your New Programs
977
978 If you develop a new program, and you want it to be of the greatest
979 possible use to the public, the best way to achieve this is to make it
980@@ -287,15 +628,15 @@
981
982 To do so, attach the following notices to the program. It is safest
983 to attach them to the start of each source file to most effectively
984-convey the exclusion of warranty; and each file should have at least
985+state the exclusion of warranty; and each file should have at least
986 the "copyright" line and a pointer to where the full notice is found.
987
988 <one line to give the program's name and a brief idea of what it does.>
989 Copyright (C) <year> <name of author>
990
991- This program is free software; you can redistribute it and/or modify
992+ This program is free software: you can redistribute it and/or modify
993 it under the terms of the GNU General Public License as published by
994- the Free Software Foundation; either version 2 of the License, or
995+ the Free Software Foundation, either version 3 of the License, or
996 (at your option) any later version.
997
998 This program is distributed in the hope that it will be useful,
999@@ -303,37 +644,31 @@
1000 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1001 GNU General Public License for more details.
1002
1003- You should have received a copy of the GNU General Public License along
1004- with this program; if not, write to the Free Software Foundation, Inc.,
1005- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
1006+ You should have received a copy of the GNU General Public License
1007+ along with this program. If not, see <https://www.gnu.org/licenses/>.
1008
1009 Also add information on how to contact you by electronic and paper mail.
1010
1011-If the program is interactive, make it output a short notice like this
1012-when it starts in an interactive mode:
1013+ If the program does terminal interaction, make it output a short
1014+notice like this when it starts in an interactive mode:
1015
1016- Gnomovision version 69, Copyright (C) year name of author
1017- Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
1018+ <program> Copyright (C) <year> <name of author>
1019+ This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
1020 This is free software, and you are welcome to redistribute it
1021 under certain conditions; type `show c' for details.
1022
1023 The hypothetical commands `show w' and `show c' should show the appropriate
1024-parts of the General Public License. Of course, the commands you use may
1025-be called something other than `show w' and `show c'; they could even be
1026-mouse-clicks or menu items--whatever suits your program.
1027-
1028-You should also get your employer (if you work as a programmer) or your
1029-school, if any, to sign a "copyright disclaimer" for the program, if
1030-necessary. Here is a sample; alter the names:
1031-
1032- Yoyodyne, Inc., hereby disclaims all copyright interest in the program
1033- `Gnomovision' (which makes passes at compilers) written by James Hacker.
1034-
1035- <signature of Ty Coon>, 1 April 1989
1036- Ty Coon, President of Vice
1037-
1038-This General Public License does not permit incorporating your program into
1039-proprietary programs. If your program is a subroutine library, you may
1040-consider it more useful to permit linking proprietary applications with the
1041-library. If this is what you want to do, use the GNU Lesser General
1042-Public License instead of this License.
1043+parts of the General Public License. Of course, your program's commands
1044+might be different; for a GUI interface, you would use an "about box".
1045+
1046+ You should also get your employer (if you work as a programmer) or school,
1047+if any, to sign a "copyright disclaimer" for the program, if necessary.
1048+For more information on this, and how to apply and follow the GNU GPL, see
1049+<https://www.gnu.org/licenses/>.
1050+
1051+ The GNU General Public License does not permit incorporating your program
1052+into proprietary programs. If your program is a subroutine library, you
1053+may consider it more useful to permit linking proprietary applications with
1054+the library. If this is what you want to do, use the GNU Lesser General
1055+Public License instead of this License. But first, please read
1056+<https://www.gnu.org/licenses/why-not-lgpl.html>.
1057
1058=== modified file 'copyright.txt'
1059--- copyright.txt 2019-02-14 15:09:09 +0000
1060+++ copyright.txt 2019-07-01 17:47:01 +0000
1061@@ -1,21 +1,21 @@
1062 # -*- coding: utf-8 -*-
1063 # vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4
1064
1065-###############################################################################
1066-# OpenLP - Open Source Lyrics Projection #
1067-# --------------------------------------------------------------------------- #
1068-# Copyright (c) 2008-2019 OpenLP Developers #
1069-# --------------------------------------------------------------------------- #
1070-# This program is free software; you can redistribute it and/or modify it #
1071-# under the terms of the GNU General Public License as published by the Free #
1072-# Software Foundation; version 2 of the License. #
1073-# #
1074-# This program is distributed in the hope that it will be useful, but WITHOUT #
1075-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or #
1076-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for #
1077-# more details. #
1078-# #
1079-# You should have received a copy of the GNU General Public License along #
1080-# with this program; if not, write to the Free Software Foundation, Inc., 59 #
1081-# Temple Place, Suite 330, Boston, MA 02111-1307 USA #
1082-###############################################################################
1083+##########################################################################
1084+# OpenLP - Open Source Lyrics Projection #
1085+# ---------------------------------------------------------------------- #
1086+# Copyright (c) 2008-2019 OpenLP Developers #
1087+# ---------------------------------------------------------------------- #
1088+# This program is free software: you can redistribute it and/or modify #
1089+# it under the terms of the GNU General Public License as published by #
1090+# the Free Software Foundation, either version 3 of the License, or #
1091+# (at your option) any later version. #
1092+# #
1093+# This program is distributed in the hope that it will be useful, #
1094+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
1095+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
1096+# GNU General Public License for more details. #
1097+# #
1098+# You should have received a copy of the GNU General Public License #
1099+# along with this program. If not, see <https://www.gnu.org/licenses/>. #
1100+##########################################################################
1101
1102=== removed file 'nose2.cfg'
1103--- nose2.cfg 2017-12-02 05:31:23 +0000
1104+++ nose2.cfg 1970-01-01 00:00:00 +0000
1105@@ -1,27 +0,0 @@
1106-[unittest]
1107-verbose = true
1108-plugins = nose2.plugins.mp
1109-
1110-[log-capture]
1111-always-on = true
1112-clear-handlers = true
1113-filter = -nose
1114-log-level = ERROR
1115-
1116-[test-result]
1117-always-on = true
1118-descriptions = true
1119-
1120-[coverage]
1121-always-on = true
1122-coverage = openlp
1123-coverage-report = html
1124-
1125-[multiprocess]
1126-always-on = false
1127-processes = 4
1128-
1129-[output-buffer]
1130-always-on = true
1131-stderr = true
1132-stdout = true
1133
1134=== modified file 'openlp/__init__.py'
1135--- openlp/__init__.py 2019-02-14 15:09:09 +0000
1136+++ openlp/__init__.py 2019-07-01 17:47:01 +0000
1137@@ -1,24 +1,24 @@
1138 # -*- coding: utf-8 -*-
1139 # vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4
1140
1141-###############################################################################
1142-# OpenLP - Open Source Lyrics Projection #
1143-# --------------------------------------------------------------------------- #
1144-# Copyright (c) 2008-2019 OpenLP Developers #
1145-# --------------------------------------------------------------------------- #
1146-# This program is free software; you can redistribute it and/or modify it #
1147-# under the terms of the GNU General Public License as published by the Free #
1148-# Software Foundation; version 2 of the License. #
1149-# #
1150-# This program is distributed in the hope that it will be useful, but WITHOUT #
1151-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or #
1152-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for #
1153-# more details. #
1154-# #
1155-# You should have received a copy of the GNU General Public License along #
1156-# with this program; if not, write to the Free Software Foundation, Inc., 59 #
1157-# Temple Place, Suite 330, Boston, MA 02111-1307 USA #
1158-###############################################################################
1159+##########################################################################
1160+# OpenLP - Open Source Lyrics Projection #
1161+# ---------------------------------------------------------------------- #
1162+# Copyright (c) 2008-2019 OpenLP Developers #
1163+# ---------------------------------------------------------------------- #
1164+# This program is free software: you can redistribute it and/or modify #
1165+# it under the terms of the GNU General Public License as published by #
1166+# the Free Software Foundation, either version 3 of the License, or #
1167+# (at your option) any later version. #
1168+# #
1169+# This program is distributed in the hope that it will be useful, #
1170+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
1171+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
1172+# GNU General Public License for more details. #
1173+# #
1174+# You should have received a copy of the GNU General Public License #
1175+# along with this program. If not, see <https://www.gnu.org/licenses/>. #
1176+##########################################################################
1177 """
1178 The :mod:`openlp` module contains all the project produced OpenLP functionality
1179 """
1180
1181=== modified file 'openlp/core/__init__.py'
1182--- openlp/core/__init__.py 2019-02-14 15:09:09 +0000
1183+++ openlp/core/__init__.py 2019-07-01 17:47:01 +0000
1184@@ -1,24 +1,24 @@
1185 # -*- coding: utf-8 -*-
1186 # vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4
1187
1188-###############################################################################
1189-# OpenLP - Open Source Lyrics Projection #
1190-# --------------------------------------------------------------------------- #
1191-# Copyright (c) 2008-2019 OpenLP Developers #
1192-# --------------------------------------------------------------------------- #
1193-# This program is free software; you can redistribute it and/or modify it #
1194-# under the terms of the GNU General Public License as published by the Free #
1195-# Software Foundation; version 2 of the License. #
1196-# #
1197-# This program is distributed in the hope that it will be useful, but WITHOUT #
1198-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or #
1199-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for #
1200-# more details. #
1201-# #
1202-# You should have received a copy of the GNU General Public License along #
1203-# with this program; if not, write to the Free Software Foundation, Inc., 59 #
1204-# Temple Place, Suite 330, Boston, MA 02111-1307 USA #
1205-###############################################################################
1206+##########################################################################
1207+# OpenLP - Open Source Lyrics Projection #
1208+# ---------------------------------------------------------------------- #
1209+# Copyright (c) 2008-2019 OpenLP Developers #
1210+# ---------------------------------------------------------------------- #
1211+# This program is free software: you can redistribute it and/or modify #
1212+# it under the terms of the GNU General Public License as published by #
1213+# the Free Software Foundation, either version 3 of the License, or #
1214+# (at your option) any later version. #
1215+# #
1216+# This program is distributed in the hope that it will be useful, #
1217+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
1218+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
1219+# GNU General Public License for more details. #
1220+# #
1221+# You should have received a copy of the GNU General Public License #
1222+# along with this program. If not, see <https://www.gnu.org/licenses/>. #
1223+##########################################################################
1224
1225 """
1226 The :mod:`core` module provides all core application functions
1227
1228=== modified file 'openlp/core/api/__init__.py'
1229--- openlp/core/api/__init__.py 2019-02-14 15:09:09 +0000
1230+++ openlp/core/api/__init__.py 2019-07-01 17:47:01 +0000
1231@@ -1,21 +1,21 @@
1232 # -*- coding: utf-8 -*-
1233 # vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4
1234
1235-###############################################################################
1236-# OpenLP - Open Source Lyrics Projection #
1237-# --------------------------------------------------------------------------- #
1238-# Copyright (c) 2008-2019 OpenLP Developers #
1239-# --------------------------------------------------------------------------- #
1240-# This program is free software; you can redistribute it and/or modify it #
1241-# under the terms of the GNU General Public License as published by the Free #
1242-# Software Foundation; version 2 of the License. #
1243-# #
1244-# This program is distributed in the hope that it will be useful, but WITHOUT #
1245-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or #
1246-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for #
1247-# more details. #
1248-# #
1249-# You should have received a copy of the GNU General Public License along #
1250-# with this program; if not, write to the Free Software Foundation, Inc., 59 #
1251-# Temple Place, Suite 330, Boston, MA 02111-1307 USA #
1252-###############################################################################
1253+##########################################################################
1254+# OpenLP - Open Source Lyrics Projection #
1255+# ---------------------------------------------------------------------- #
1256+# Copyright (c) 2008-2019 OpenLP Developers #
1257+# ---------------------------------------------------------------------- #
1258+# This program is free software: you can redistribute it and/or modify #
1259+# it under the terms of the GNU General Public License as published by #
1260+# the Free Software Foundation, either version 3 of the License, or #
1261+# (at your option) any later version. #
1262+# #
1263+# This program is distributed in the hope that it will be useful, #
1264+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
1265+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
1266+# GNU General Public License for more details. #
1267+# #
1268+# You should have received a copy of the GNU General Public License #
1269+# along with this program. If not, see <https://www.gnu.org/licenses/>. #
1270+##########################################################################
1271
1272=== modified file 'openlp/core/api/deploy.py'
1273--- openlp/core/api/deploy.py 2019-02-14 15:09:09 +0000
1274+++ openlp/core/api/deploy.py 2019-07-01 17:47:01 +0000
1275@@ -1,24 +1,24 @@
1276 # -*- coding: utf-8 -*-
1277 # vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4
1278
1279-###############################################################################
1280-# OpenLP - Open Source Lyrics Projection #
1281-# --------------------------------------------------------------------------- #
1282-# Copyright (c) 2008-2019 OpenLP Developers #
1283-# --------------------------------------------------------------------------- #
1284-# This program is free software; you can redistribute it and/or modify it #
1285-# under the terms of the GNU General Public License as published by the Free #
1286-# Software Foundation; version 2 of the License. #
1287-# #
1288-# This program is distributed in the hope that it will be useful, but WITHOUT #
1289-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or #
1290-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for #
1291-# more details. #
1292-# #
1293-# You should have received a copy of the GNU General Public License along #
1294-# with this program; if not, write to the Free Software Foundation, Inc., 59 #
1295-# Temple Place, Suite 330, Boston, MA 02111-1307 USA #
1296-###############################################################################
1297+##########################################################################
1298+# OpenLP - Open Source Lyrics Projection #
1299+# ---------------------------------------------------------------------- #
1300+# Copyright (c) 2008-2019 OpenLP Developers #
1301+# ---------------------------------------------------------------------- #
1302+# This program is free software: you can redistribute it and/or modify #
1303+# it under the terms of the GNU General Public License as published by #
1304+# the Free Software Foundation, either version 3 of the License, or #
1305+# (at your option) any later version. #
1306+# #
1307+# This program is distributed in the hope that it will be useful, #
1308+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
1309+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
1310+# GNU General Public License for more details. #
1311+# #
1312+# You should have received a copy of the GNU General Public License #
1313+# along with this program. If not, see <https://www.gnu.org/licenses/>. #
1314+##########################################################################
1315 """
1316 Download and "install" the remote web client
1317 """
1318@@ -34,13 +34,13 @@
1319 Process the downloaded zip file and add to the correct directory
1320
1321 :param str zip_name: the zip file name to be processed
1322- :param openlp.core.common.path.Path app_root_path: The directory to expand the zip to
1323+ :param pathlib.Path app_root_path: The directory to expand the zip to
1324
1325 :return: None
1326 """
1327 zip_path = app_root_path / zip_name
1328- web_zip = ZipFile(str(zip_path))
1329- web_zip.extractall(str(app_root_path))
1330+ web_zip = ZipFile(zip_path)
1331+ web_zip.extractall(app_root_path)
1332
1333
1334 def download_sha256():
1335
1336=== modified file 'openlp/core/api/endpoint/__init__.py'
1337--- openlp/core/api/endpoint/__init__.py 2019-02-14 15:09:09 +0000
1338+++ openlp/core/api/endpoint/__init__.py 2019-07-01 17:47:01 +0000
1339@@ -1,24 +1,24 @@
1340 # -*- coding: utf-8 -*-
1341 # vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4
1342
1343-###############################################################################
1344-# OpenLP - Open Source Lyrics Projection #
1345-# --------------------------------------------------------------------------- #
1346-# Copyright (c) 2008-2019 OpenLP Developers #
1347-# --------------------------------------------------------------------------- #
1348-# This program is free software; you can redistribute it and/or modify it #
1349-# under the terms of the GNU General Public License as published by the Free #
1350-# Software Foundation; version 2 of the License. #
1351-# #
1352-# This program is distributed in the hope that it will be useful, but WITHOUT #
1353-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or #
1354-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for #
1355-# more details. #
1356-# #
1357-# You should have received a copy of the GNU General Public License along #
1358-# with this program; if not, write to the Free Software Foundation, Inc., 59 #
1359-# Temple Place, Suite 330, Boston, MA 02111-1307 USA #
1360-###############################################################################
1361+##########################################################################
1362+# OpenLP - Open Source Lyrics Projection #
1363+# ---------------------------------------------------------------------- #
1364+# Copyright (c) 2008-2019 OpenLP Developers #
1365+# ---------------------------------------------------------------------- #
1366+# This program is free software: you can redistribute it and/or modify #
1367+# it under the terms of the GNU General Public License as published by #
1368+# the Free Software Foundation, either version 3 of the License, or #
1369+# (at your option) any later version. #
1370+# #
1371+# This program is distributed in the hope that it will be useful, #
1372+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
1373+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
1374+# GNU General Public License for more details. #
1375+# #
1376+# You should have received a copy of the GNU General Public License #
1377+# along with this program. If not, see <https://www.gnu.org/licenses/>. #
1378+##########################################################################
1379 """
1380 The Endpoint class, which provides plugins with a way to serve their own portion of the API
1381 """
1382
1383=== modified file 'openlp/core/api/endpoint/controller.py'
1384--- openlp/core/api/endpoint/controller.py 2019-02-14 15:09:09 +0000
1385+++ openlp/core/api/endpoint/controller.py 2019-07-01 17:47:01 +0000
1386@@ -1,34 +1,34 @@
1387 # -*- coding: utf-8 -*-
1388 # vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4
1389
1390-###############################################################################
1391-# OpenLP - Open Source Lyrics Projection #
1392-# --------------------------------------------------------------------------- #
1393-# Copyright (c) 2008-2019 OpenLP Developers #
1394-# --------------------------------------------------------------------------- #
1395-# This program is free software; you can redistribute it and/or modify it #
1396-# under the terms of the GNU General Public License as published by the Free #
1397-# Software Foundation; version 2 of the License. #
1398-# #
1399-# This program is distributed in the hope that it will be useful, but WITHOUT #
1400-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or #
1401-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for #
1402-# more details. #
1403-# #
1404-# You should have received a copy of the GNU General Public License along #
1405-# with this program; if not, write to the Free Software Foundation, Inc., 59 #
1406-# Temple Place, Suite 330, Boston, MA 02111-1307 USA #
1407-###############################################################################
1408+##########################################################################
1409+# OpenLP - Open Source Lyrics Projection #
1410+# ---------------------------------------------------------------------- #
1411+# Copyright (c) 2008-2019 OpenLP Developers #
1412+# ---------------------------------------------------------------------- #
1413+# This program is free software: you can redistribute it and/or modify #
1414+# it under the terms of the GNU General Public License as published by #
1415+# the Free Software Foundation, either version 3 of the License, or #
1416+# (at your option) any later version. #
1417+# #
1418+# This program is distributed in the hope that it will be useful, #
1419+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
1420+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
1421+# GNU General Public License for more details. #
1422+# #
1423+# You should have received a copy of the GNU General Public License #
1424+# along with this program. If not, see <https://www.gnu.org/licenses/>. #
1425+##########################################################################
1426 import json
1427 import logging
1428 import os
1429 import urllib.error
1430 import urllib.request
1431+from pathlib import Path
1432
1433 from openlp.core.api.http import requires_auth
1434 from openlp.core.api.http.endpoint import Endpoint
1435 from openlp.core.common.applocation import AppLocation
1436-from openlp.core.common.path import Path
1437 from openlp.core.common.registry import Registry
1438 from openlp.core.common.settings import Settings
1439 from openlp.core.lib import create_thumb
1440
1441=== modified file 'openlp/core/api/endpoint/core.py'
1442--- openlp/core/api/endpoint/core.py 2019-02-14 15:09:09 +0000
1443+++ openlp/core/api/endpoint/core.py 2019-07-01 17:47:01 +0000
1444@@ -1,24 +1,24 @@
1445 # -*- coding: utf-8 -*-
1446 # vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4
1447
1448-###############################################################################
1449-# OpenLP - Open Source Lyrics Projection #
1450-# --------------------------------------------------------------------------- #
1451-# Copyright (c) 2008-2019 OpenLP Developers #
1452-# --------------------------------------------------------------------------- #
1453-# This program is free software; you can redistribute it and/or modify it #
1454-# under the terms of the GNU General Public License as published by the Free #
1455-# Software Foundation; version 2 of the License. #
1456-# #
1457-# This program is distributed in the hope that it will be useful, but WITHOUT #
1458-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or #
1459-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for #
1460-# more details. #
1461-# #
1462-# You should have received a copy of the GNU General Public License along #
1463-# with this program; if not, write to the Free Software Foundation, Inc., 59 #
1464-# Temple Place, Suite 330, Boston, MA 02111-1307 USA #
1465-###############################################################################
1466+##########################################################################
1467+# OpenLP - Open Source Lyrics Projection #
1468+# ---------------------------------------------------------------------- #
1469+# Copyright (c) 2008-2019 OpenLP Developers #
1470+# ---------------------------------------------------------------------- #
1471+# This program is free software: you can redistribute it and/or modify #
1472+# it under the terms of the GNU General Public License as published by #
1473+# the Free Software Foundation, either version 3 of the License, or #
1474+# (at your option) any later version. #
1475+# #
1476+# This program is distributed in the hope that it will be useful, #
1477+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
1478+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
1479+# GNU General Public License for more details. #
1480+# #
1481+# You should have received a copy of the GNU General Public License #
1482+# along with this program. If not, see <https://www.gnu.org/licenses/>. #
1483+##########################################################################
1484 """
1485 The :mod:`~openlp.core.api.endpoint.core` module contains the core API endpoints
1486 """
1487
1488=== modified file 'openlp/core/api/endpoint/pluginhelpers.py'
1489--- openlp/core/api/endpoint/pluginhelpers.py 2019-02-14 15:09:09 +0000
1490+++ openlp/core/api/endpoint/pluginhelpers.py 2019-07-01 17:47:01 +0000
1491@@ -1,24 +1,24 @@
1492 # -*- coding: utf-8 -*-
1493 # vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4
1494
1495-###############################################################################
1496-# OpenLP - Open Source Lyrics Projection #
1497-# --------------------------------------------------------------------------- #
1498-# Copyright (c) 2008-2019 OpenLP Developers #
1499-# --------------------------------------------------------------------------- #
1500-# This program is free software; you can redistribute it and/or modify it #
1501-# under the terms of the GNU General Public License as published by the Free #
1502-# Software Foundation; version 2 of the License. #
1503-# #
1504-# This program is distributed in the hope that it will be useful, but WITHOUT #
1505-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or #
1506-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for #
1507-# more details. #
1508-# #
1509-# You should have received a copy of the GNU General Public License along #
1510-# with this program; if not, write to the Free Software Foundation, Inc., 59 #
1511-# Temple Place, Suite 330, Boston, MA 02111-1307 USA #
1512-###############################################################################
1513+##########################################################################
1514+# OpenLP - Open Source Lyrics Projection #
1515+# ---------------------------------------------------------------------- #
1516+# Copyright (c) 2008-2019 OpenLP Developers #
1517+# ---------------------------------------------------------------------- #
1518+# This program is free software: you can redistribute it and/or modify #
1519+# it under the terms of the GNU General Public License as published by #
1520+# the Free Software Foundation, either version 3 of the License, or #
1521+# (at your option) any later version. #
1522+# #
1523+# This program is distributed in the hope that it will be useful, #
1524+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
1525+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
1526+# GNU General Public License for more details. #
1527+# #
1528+# You should have received a copy of the GNU General Public License #
1529+# along with this program. If not, see <https://www.gnu.org/licenses/>. #
1530+##########################################################################
1531 import json
1532 import re
1533 import urllib
1534
1535=== modified file 'openlp/core/api/endpoint/remote.py'
1536--- openlp/core/api/endpoint/remote.py 2019-02-14 15:09:09 +0000
1537+++ openlp/core/api/endpoint/remote.py 2019-07-01 17:47:01 +0000
1538@@ -1,24 +1,24 @@
1539 # -*- coding: utf-8 -*-
1540 # vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4
1541
1542-###############################################################################
1543-# OpenLP - Open Source Lyrics Projection #
1544-# --------------------------------------------------------------------------- #
1545-# Copyright (c) 2008-2019 OpenLP Developers #
1546-# --------------------------------------------------------------------------- #
1547-# This program is free software; you can redistribute it and/or modify it #
1548-# under the terms of the GNU General Public License as published by the Free #
1549-# Software Foundation; version 2 of the License. #
1550-# #
1551-# This program is distributed in the hope that it will be useful, but WITHOUT #
1552-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or #
1553-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for #
1554-# more details. #
1555-# #
1556-# You should have received a copy of the GNU General Public License along #
1557-# with this program; if not, write to the Free Software Foundation, Inc., 59 #
1558-# Temple Place, Suite 330, Boston, MA 02111-1307 USA #
1559-###############################################################################
1560+##########################################################################
1561+# OpenLP - Open Source Lyrics Projection #
1562+# ---------------------------------------------------------------------- #
1563+# Copyright (c) 2008-2019 OpenLP Developers #
1564+# ---------------------------------------------------------------------- #
1565+# This program is free software: you can redistribute it and/or modify #
1566+# it under the terms of the GNU General Public License as published by #
1567+# the Free Software Foundation, either version 3 of the License, or #
1568+# (at your option) any later version. #
1569+# #
1570+# This program is distributed in the hope that it will be useful, #
1571+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
1572+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
1573+# GNU General Public License for more details. #
1574+# #
1575+# You should have received a copy of the GNU General Public License #
1576+# along with this program. If not, see <https://www.gnu.org/licenses/>. #
1577+##########################################################################
1578 import logging
1579
1580 from openlp.core.api.endpoint.core import TRANSLATED_STRINGS
1581
1582=== modified file 'openlp/core/api/endpoint/service.py'
1583--- openlp/core/api/endpoint/service.py 2019-02-14 15:09:09 +0000
1584+++ openlp/core/api/endpoint/service.py 2019-07-01 17:47:01 +0000
1585@@ -1,24 +1,24 @@
1586 # -*- coding: utf-8 -*-
1587 # vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4
1588
1589-###############################################################################
1590-# OpenLP - Open Source Lyrics Projection #
1591-# --------------------------------------------------------------------------- #
1592-# Copyright (c) 2008-2019 OpenLP Developers #
1593-# --------------------------------------------------------------------------- #
1594-# This program is free software; you can redistribute it and/or modify it #
1595-# under the terms of the GNU General Public License as published by the Free #
1596-# Software Foundation; version 2 of the License. #
1597-# #
1598-# This program is distributed in the hope that it will be useful, but WITHOUT #
1599-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or #
1600-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for #
1601-# more details. #
1602-# #
1603-# You should have received a copy of the GNU General Public License along #
1604-# with this program; if not, write to the Free Software Foundation, Inc., 59 #
1605-# Temple Place, Suite 330, Boston, MA 02111-1307 USA #
1606-###############################################################################
1607+##########################################################################
1608+# OpenLP - Open Source Lyrics Projection #
1609+# ---------------------------------------------------------------------- #
1610+# Copyright (c) 2008-2019 OpenLP Developers #
1611+# ---------------------------------------------------------------------- #
1612+# This program is free software: you can redistribute it and/or modify #
1613+# it under the terms of the GNU General Public License as published by #
1614+# the Free Software Foundation, either version 3 of the License, or #
1615+# (at your option) any later version. #
1616+# #
1617+# This program is distributed in the hope that it will be useful, #
1618+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
1619+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
1620+# GNU General Public License for more details. #
1621+# #
1622+# You should have received a copy of the GNU General Public License #
1623+# along with this program. If not, see <https://www.gnu.org/licenses/>. #
1624+##########################################################################
1625 import json
1626 import logging
1627
1628
1629=== modified file 'openlp/core/api/http/__init__.py'
1630--- openlp/core/api/http/__init__.py 2019-02-14 15:09:09 +0000
1631+++ openlp/core/api/http/__init__.py 2019-07-01 17:47:01 +0000
1632@@ -1,24 +1,24 @@
1633 # -*- coding: utf-8 -*-
1634 # vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4
1635
1636-###############################################################################
1637-# OpenLP - Open Source Lyrics Projection #
1638-# --------------------------------------------------------------------------- #
1639-# Copyright (c) 2008-2019 OpenLP Developers #
1640-# --------------------------------------------------------------------------- #
1641-# This program is free software; you can redistribute it and/or modify it #
1642-# under the terms of the GNU General Public License as published by the Free #
1643-# Software Foundation; version 2 of the License. #
1644-# #
1645-# This program is distributed in the hope that it will be useful, but WITHOUT #
1646-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or #
1647-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for #
1648-# more details. #
1649-# #
1650-# You should have received a copy of the GNU General Public License along #
1651-# with this program; if not, write to the Free Software Foundation, Inc., 59 #
1652-# Temple Place, Suite 330, Boston, MA 02111-1307 USA #
1653-###############################################################################
1654+##########################################################################
1655+# OpenLP - Open Source Lyrics Projection #
1656+# ---------------------------------------------------------------------- #
1657+# Copyright (c) 2008-2019 OpenLP Developers #
1658+# ---------------------------------------------------------------------- #
1659+# This program is free software: you can redistribute it and/or modify #
1660+# it under the terms of the GNU General Public License as published by #
1661+# the Free Software Foundation, either version 3 of the License, or #
1662+# (at your option) any later version. #
1663+# #
1664+# This program is distributed in the hope that it will be useful, #
1665+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
1666+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
1667+# GNU General Public License for more details. #
1668+# #
1669+# You should have received a copy of the GNU General Public License #
1670+# along with this program. If not, see <https://www.gnu.org/licenses/>. #
1671+##########################################################################
1672
1673 import base64
1674 from functools import wraps
1675
1676=== modified file 'openlp/core/api/http/endpoint.py'
1677--- openlp/core/api/http/endpoint.py 2019-02-14 15:09:09 +0000
1678+++ openlp/core/api/http/endpoint.py 2019-07-01 17:47:01 +0000
1679@@ -1,24 +1,24 @@
1680 # -*- coding: utf-8 -*-
1681 # vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4
1682
1683-###############################################################################
1684-# OpenLP - Open Source Lyrics Projection #
1685-# --------------------------------------------------------------------------- #
1686-# Copyright (c) 2008-2019 OpenLP Developers #
1687-# --------------------------------------------------------------------------- #
1688-# This program is free software; you can redistribute it and/or modify it #
1689-# under the terms of the GNU General Public License as published by the Free #
1690-# Software Foundation; version 2 of the License. #
1691-# #
1692-# This program is distributed in the hope that it will be useful, but WITHOUT #
1693-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or #
1694-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for #
1695-# more details. #
1696-# #
1697-# You should have received a copy of the GNU General Public License along #
1698-# with this program; if not, write to the Free Software Foundation, Inc., 59 #
1699-# Temple Place, Suite 330, Boston, MA 02111-1307 USA #
1700-###############################################################################
1701+##########################################################################
1702+# OpenLP - Open Source Lyrics Projection #
1703+# ---------------------------------------------------------------------- #
1704+# Copyright (c) 2008-2019 OpenLP Developers #
1705+# ---------------------------------------------------------------------- #
1706+# This program is free software: you can redistribute it and/or modify #
1707+# it under the terms of the GNU General Public License as published by #
1708+# the Free Software Foundation, either version 3 of the License, or #
1709+# (at your option) any later version. #
1710+# #
1711+# This program is distributed in the hope that it will be useful, #
1712+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
1713+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
1714+# GNU General Public License for more details. #
1715+# #
1716+# You should have received a copy of the GNU General Public License #
1717+# along with this program. If not, see <https://www.gnu.org/licenses/>. #
1718+##########################################################################
1719 """
1720 The Endpoint class, which provides plugins with a way to serve their own portion of the API
1721 """
1722
1723=== modified file 'openlp/core/api/http/errors.py'
1724--- openlp/core/api/http/errors.py 2019-02-14 15:09:09 +0000
1725+++ openlp/core/api/http/errors.py 2019-07-01 17:47:01 +0000
1726@@ -1,24 +1,24 @@
1727 # -*- coding: utf-8 -*-
1728 # vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4
1729
1730-###############################################################################
1731-# OpenLP - Open Source Lyrics Projection #
1732-# --------------------------------------------------------------------------- #
1733-# Copyright (c) 2008-2019 OpenLP Developers #
1734-# --------------------------------------------------------------------------- #
1735-# This program is free software; you can redistribute it and/or modify it #
1736-# under the terms of the GNU General Public License as published by the Free #
1737-# Software Foundation; version 2 of the License. #
1738-# #
1739-# This program is distributed in the hope that it will be useful, but WITHOUT #
1740-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or #
1741-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for #
1742-# more details. #
1743-# #
1744-# You should have received a copy of the GNU General Public License along #
1745-# with this program; if not, write to the Free Software Foundation, Inc., 59 #
1746-# Temple Place, Suite 330, Boston, MA 02111-1307 USA #
1747-###############################################################################
1748+##########################################################################
1749+# OpenLP - Open Source Lyrics Projection #
1750+# ---------------------------------------------------------------------- #
1751+# Copyright (c) 2008-2019 OpenLP Developers #
1752+# ---------------------------------------------------------------------- #
1753+# This program is free software: you can redistribute it and/or modify #
1754+# it under the terms of the GNU General Public License as published by #
1755+# the Free Software Foundation, either version 3 of the License, or #
1756+# (at your option) any later version. #
1757+# #
1758+# This program is distributed in the hope that it will be useful, #
1759+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
1760+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
1761+# GNU General Public License for more details. #
1762+# #
1763+# You should have received a copy of the GNU General Public License #
1764+# along with this program. If not, see <https://www.gnu.org/licenses/>. #
1765+##########################################################################
1766 """
1767 HTTP Error classes
1768 """
1769
1770=== modified file 'openlp/core/api/http/server.py'
1771--- openlp/core/api/http/server.py 2019-02-14 15:09:09 +0000
1772+++ openlp/core/api/http/server.py 2019-07-01 17:47:01 +0000
1773@@ -1,24 +1,24 @@
1774 # -*- coding: utf-8 -*-
1775 # vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4
1776
1777-###############################################################################
1778-# OpenLP - Open Source Lyrics Projection #
1779-# --------------------------------------------------------------------------- #
1780-# Copyright (c) 2008-2019 OpenLP Developers #
1781-# --------------------------------------------------------------------------- #
1782-# This program is free software; you can redistribute it and/or modify it #
1783-# under the terms of the GNU General Public License as published by the Free #
1784-# Software Foundation; version 2 of the License. #
1785-# #
1786-# This program is distributed in the hope that it will be useful, but WITHOUT #
1787-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or #
1788-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for #
1789-# more details. #
1790-# #
1791-# You should have received a copy of the GNU General Public License along #
1792-# with this program; if not, write to the Free Software Foundation, Inc., 59 #
1793-# Temple Place, Suite 330, Boston, MA 02111-1307 USA #
1794-###############################################################################
1795+##########################################################################
1796+# OpenLP - Open Source Lyrics Projection #
1797+# ---------------------------------------------------------------------- #
1798+# Copyright (c) 2008-2019 OpenLP Developers #
1799+# ---------------------------------------------------------------------- #
1800+# This program is free software: you can redistribute it and/or modify #
1801+# it under the terms of the GNU General Public License as published by #
1802+# the Free Software Foundation, either version 3 of the License, or #
1803+# (at your option) any later version. #
1804+# #
1805+# This program is distributed in the hope that it will be useful, #
1806+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
1807+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
1808+# GNU General Public License for more details. #
1809+# #
1810+# You should have received a copy of the GNU General Public License #
1811+# along with this program. If not, see <https://www.gnu.org/licenses/>. #
1812+##########################################################################
1813 """
1814 The :mod:`http` module contains the API web server. This is a lightweight web server used by remotes to interact
1815 with OpenLP. It uses JSON to communicate with the remotes.
1816
1817=== modified file 'openlp/core/api/http/wsgiapp.py'
1818--- openlp/core/api/http/wsgiapp.py 2019-02-14 15:09:09 +0000
1819+++ openlp/core/api/http/wsgiapp.py 2019-07-01 17:47:01 +0000
1820@@ -2,24 +2,24 @@
1821 # vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4
1822 # pylint: disable=logging-format-interpolation
1823
1824-###############################################################################
1825-# OpenLP - Open Source Lyrics Projection #
1826-# --------------------------------------------------------------------------- #
1827-# Copyright (c) 2008-2019 OpenLP Developers #
1828-# --------------------------------------------------------------------------- #
1829-# This program is free software; you can redistribute it and/or modify it #
1830-# under the terms of the GNU General Public License as published by the Free #
1831-# Software Foundation; version 2 of the License. #
1832-# #
1833-# This program is distributed in the hope that it will be useful, but WITHOUT #
1834-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or #
1835-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for #
1836-# more details. #
1837-# #
1838-# You should have received a copy of the GNU General Public License along #
1839-# with this program; if not, write to the Free Software Foundation, Inc., 59 #
1840-# Temple Place, Suite 330, Boston, MA 02111-1307 USA #
1841-###############################################################################
1842+##########################################################################
1843+# OpenLP - Open Source Lyrics Projection #
1844+# ---------------------------------------------------------------------- #
1845+# Copyright (c) 2008-2019 OpenLP Developers #
1846+# ---------------------------------------------------------------------- #
1847+# This program is free software: you can redistribute it and/or modify #
1848+# it under the terms of the GNU General Public License as published by #
1849+# the Free Software Foundation, either version 3 of the License, or #
1850+# (at your option) any later version. #
1851+# #
1852+# This program is distributed in the hope that it will be useful, #
1853+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
1854+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
1855+# GNU General Public License for more details. #
1856+# #
1857+# You should have received a copy of the GNU General Public License #
1858+# along with this program. If not, see <https://www.gnu.org/licenses/>. #
1859+##########################################################################
1860 """
1861 App stuff
1862 """
1863
1864=== modified file 'openlp/core/api/poll.py'
1865--- openlp/core/api/poll.py 2019-02-14 15:09:09 +0000
1866+++ openlp/core/api/poll.py 2019-07-01 17:47:01 +0000
1867@@ -1,24 +1,24 @@
1868 # -*- coding: utf-8 -*-
1869 # vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4
1870
1871-###############################################################################
1872-# OpenLP - Open Source Lyrics Projection #
1873-# --------------------------------------------------------------------------- #
1874-# Copyright (c) 2008-2019 OpenLP Developers #
1875-# --------------------------------------------------------------------------- #
1876-# This program is free software; you can redistribute it and/or modify it #
1877-# under the terms of the GNU General Public License as published by the Free #
1878-# Software Foundation; version 2 of the License. #
1879-# #
1880-# This program is distributed in the hope that it will be useful, but WITHOUT #
1881-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or #
1882-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for #
1883-# more details. #
1884-# #
1885-# You should have received a copy of the GNU General Public License along #
1886-# with this program; if not, write to the Free Software Foundation, Inc., 59 #
1887-# Temple Place, Suite 330, Boston, MA 02111-1307 USA #
1888-###############################################################################
1889+##########################################################################
1890+# OpenLP - Open Source Lyrics Projection #
1891+# ---------------------------------------------------------------------- #
1892+# Copyright (c) 2008-2019 OpenLP Developers #
1893+# ---------------------------------------------------------------------- #
1894+# This program is free software: you can redistribute it and/or modify #
1895+# it under the terms of the GNU General Public License as published by #
1896+# the Free Software Foundation, either version 3 of the License, or #
1897+# (at your option) any later version. #
1898+# #
1899+# This program is distributed in the hope that it will be useful, #
1900+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
1901+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
1902+# GNU General Public License for more details. #
1903+# #
1904+# You should have received a copy of the GNU General Public License #
1905+# along with this program. If not, see <https://www.gnu.org/licenses/>. #
1906+##########################################################################
1907
1908 import json
1909
1910
1911=== modified file 'openlp/core/api/tab.py'
1912--- openlp/core/api/tab.py 2019-02-14 15:09:09 +0000
1913+++ openlp/core/api/tab.py 2019-07-01 17:47:01 +0000
1914@@ -1,24 +1,24 @@
1915 # -*- coding: utf-8 -*-
1916 # vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4
1917
1918-###############################################################################
1919-# OpenLP - Open Source Lyrics Projection #
1920-# --------------------------------------------------------------------------- #
1921-# Copyright (c) 2008-2019 OpenLP Developers #
1922-# --------------------------------------------------------------------------- #
1923-# This program is free software; you can redistribute it and/or modify it #
1924-# under the terms of the GNU General Public License as published by the Free #
1925-# Software Foundation; version 2 of the License. #
1926-# #
1927-# This program is distributed in the hope that it will be useful, but WITHOUT #
1928-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or #
1929-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for #
1930-# more details. #
1931-# #
1932-# You should have received a copy of the GNU General Public License along #
1933-# with this program; if not, write to the Free Software Foundation, Inc., 59 #
1934-# Temple Place, Suite 330, Boston, MA 02111-1307 USA #
1935-###############################################################################
1936+##########################################################################
1937+# OpenLP - Open Source Lyrics Projection #
1938+# ---------------------------------------------------------------------- #
1939+# Copyright (c) 2008-2019 OpenLP Developers #
1940+# ---------------------------------------------------------------------- #
1941+# This program is free software: you can redistribute it and/or modify #
1942+# it under the terms of the GNU General Public License as published by #
1943+# the Free Software Foundation, either version 3 of the License, or #
1944+# (at your option) any later version. #
1945+# #
1946+# This program is distributed in the hope that it will be useful, #
1947+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
1948+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
1949+# GNU General Public License for more details. #
1950+# #
1951+# You should have received a copy of the GNU General Public License #
1952+# along with this program. If not, see <https://www.gnu.org/licenses/>. #
1953+##########################################################################
1954 """
1955 The :mod:`~openlp.core.api.tab` module contains the settings tab for the API
1956 """
1957
1958=== modified file 'openlp/core/api/websockets.py'
1959--- openlp/core/api/websockets.py 2019-02-14 15:09:09 +0000
1960+++ openlp/core/api/websockets.py 2019-07-01 17:47:01 +0000
1961@@ -1,24 +1,24 @@
1962 # -*- coding: utf-8 -*-
1963 # vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4
1964
1965-###############################################################################
1966-# OpenLP - Open Source Lyrics Projection #
1967-# --------------------------------------------------------------------------- #
1968-# Copyright (c) 2008-2019 OpenLP Developers #
1969-# --------------------------------------------------------------------------- #
1970-# This program is free software; you can redistribute it and/or modify it #
1971-# under the terms of the GNU General Public License as published by the Free #
1972-# Software Foundation; version 2 of the License. #
1973-# #
1974-# This program is distributed in the hope that it will be useful, but WITHOUT #
1975-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or #
1976-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for #
1977-# more details. #
1978-# #
1979-# You should have received a copy of the GNU General Public License along #
1980-# with this program; if not, write to the Free Software Foundation, Inc., 59 #
1981-# Temple Place, Suite 330, Boston, MA 02111-1307 USA #
1982-###############################################################################
1983+##########################################################################
1984+# OpenLP - Open Source Lyrics Projection #
1985+# ---------------------------------------------------------------------- #
1986+# Copyright (c) 2008-2019 OpenLP Developers #
1987+# ---------------------------------------------------------------------- #
1988+# This program is free software: you can redistribute it and/or modify #
1989+# it under the terms of the GNU General Public License as published by #
1990+# the Free Software Foundation, either version 3 of the License, or #
1991+# (at your option) any later version. #
1992+# #
1993+# This program is distributed in the hope that it will be useful, #
1994+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
1995+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
1996+# GNU General Public License for more details. #
1997+# #
1998+# You should have received a copy of the GNU General Public License #
1999+# along with this program. If not, see <https://www.gnu.org/licenses/>. #
2000+##########################################################################
2001 """
2002 The :mod:`http` module contains the API web server. This is a lightweight web server used by remotes to interact
2003 with OpenLP. It uses JSON to communicate with the remotes.
2004
2005=== modified file 'openlp/core/app.py'
2006--- openlp/core/app.py 2019-02-14 15:09:09 +0000
2007+++ openlp/core/app.py 2019-07-01 17:47:01 +0000
2008@@ -1,24 +1,24 @@
2009 # -*- coding: utf-8 -*-
2010 # vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4
2011
2012-###############################################################################
2013-# OpenLP - Open Source Lyrics Projection #
2014-# --------------------------------------------------------------------------- #
2015-# Copyright (c) 2008-2019 OpenLP Developers #
2016-# --------------------------------------------------------------------------- #
2017-# This program is free software; you can redistribute it and/or modify it #
2018-# under the terms of the GNU General Public License as published by the Free #
2019-# Software Foundation; version 2 of the License. #
2020-# #
2021-# This program is distributed in the hope that it will be useful, but WITHOUT #
2022-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or #
2023-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for #
2024-# more details. #
2025-# #
2026-# You should have received a copy of the GNU General Public License along #
2027-# with this program; if not, write to the Free Software Foundation, Inc., 59 #
2028-# Temple Place, Suite 330, Boston, MA 02111-1307 USA #
2029-###############################################################################
2030+##########################################################################
2031+# OpenLP - Open Source Lyrics Projection #
2032+# ---------------------------------------------------------------------- #
2033+# Copyright (c) 2008-2019 OpenLP Developers #
2034+# ---------------------------------------------------------------------- #
2035+# This program is free software: you can redistribute it and/or modify #
2036+# it under the terms of the GNU General Public License as published by #
2037+# the Free Software Foundation, either version 3 of the License, or #
2038+# (at your option) any later version. #
2039+# #
2040+# This program is distributed in the hope that it will be useful, #
2041+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
2042+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
2043+# GNU General Public License for more details. #
2044+# #
2045+# You should have received a copy of the GNU General Public License #
2046+# along with this program. If not, see <https://www.gnu.org/licenses/>. #
2047+##########################################################################
2048
2049 """
2050 The :mod:`core` module provides all core application functions
2051@@ -28,9 +28,12 @@
2052 """
2053 import argparse
2054 import logging
2055+import os
2056 import sys
2057 import time
2058 from datetime import datetime
2059+from pathlib import Path
2060+from shutil import copytree
2061 from traceback import format_exception
2062
2063 from PyQt5 import QtCore, QtWebEngineWidgets, QtWidgets # noqa
2064@@ -40,7 +43,7 @@
2065 from openlp.core.common.applocation import AppLocation
2066 from openlp.core.loader import loader
2067 from openlp.core.common.i18n import LanguageManager, UiStrings, translate
2068-from openlp.core.common.path import copytree, create_paths
2069+from openlp.core.common.path import create_paths
2070 from openlp.core.common.registry import Registry
2071 from openlp.core.common.settings import Settings
2072 from openlp.core.display.screens import ScreenList
2073@@ -101,7 +104,7 @@
2074 ftw.initialize(screens)
2075 if ftw.exec() == QtWidgets.QDialog.Accepted:
2076 Settings().setValue('core/has run wizard', True)
2077- elif ftw.was_cancelled:
2078+ else:
2079 QtCore.QCoreApplication.exit()
2080 sys.exit()
2081 # Correct stylesheet bugs
2082@@ -286,12 +289,12 @@
2083 return QtWidgets.QApplication.event(self, event)
2084
2085
2086-def parse_options(args=None):
2087+def parse_options():
2088 """
2089 Parse the command line arguments
2090
2091- :param args: list of command line arguments
2092- :return: a tuple of parsed options of type optparse.Value and a list of remaining argsZ
2093+ :return: An :object:`argparse.Namespace` insatnce containing the parsed args.
2094+ :rtype: argparse.Namespace
2095 """
2096 # Set up command line options.
2097 parser = argparse.ArgumentParser(prog='openlp')
2098@@ -301,37 +304,37 @@
2099 help='Set logging to LEVEL level. Valid values are "debug", "info", "warning".')
2100 parser.add_argument('-p', '--portable', dest='portable', action='store_true',
2101 help='Specify if this should be run as a portable app, ')
2102+ parser.add_argument('-pp', '--portable-path', dest='portablepath', default=None,
2103+ help='Specify the path of the portable data, defaults to "{dir_name}".'.format(
2104+ dir_name=os.path.join('<AppDir>', '..', '..')))
2105 parser.add_argument('-w', '--no-web-server', dest='no_web_server', action='store_true',
2106 help='Turn off the Web and Socket Server ')
2107- parser.add_argument('rargs', nargs='?', default=[])
2108- # Parse command line options and deal with them. Use args supplied pragmatically if possible.
2109- return parser.parse_args(args) if args else parser.parse_args()
2110+ parser.add_argument('rargs', nargs='*', default=[])
2111+ # Parse command line options and deal with them.
2112+ return parser.parse_args()
2113
2114
2115 def set_up_logging(log_path):
2116 """
2117 Setup our logging using log_path
2118
2119- :param openlp.core.common.path.Path log_path: The file to save the log to.
2120+ :param Path log_path: The file to save the log to.
2121 :rtype: None
2122 """
2123 create_paths(log_path, do_not_log=True)
2124 file_path = log_path / 'openlp.log'
2125- # TODO: FileHandler accepts a Path object in Py3.6
2126- logfile = logging.FileHandler(str(file_path), 'w', encoding='UTF-8')
2127+ logfile = logging.FileHandler(file_path, 'w', encoding='UTF-8')
2128 logfile.setFormatter(logging.Formatter('%(asctime)s %(threadName)s %(name)-55s %(levelname)-8s %(message)s'))
2129 log.addHandler(logfile)
2130 if log.isEnabledFor(logging.DEBUG):
2131 print('Logging to: {name}'.format(name=file_path))
2132
2133
2134-def main(args=None):
2135+def main():
2136 """
2137 The main function which parses command line options and then runs
2138-
2139- :param args: Some args
2140 """
2141- args = parse_options(args)
2142+ args = parse_options()
2143 qt_args = ['--disable-web-security']
2144 # qt_args = []
2145 if args and args.loglevel.lower() in ['d', 'debug']:
2146@@ -357,14 +360,21 @@
2147 application.setApplicationName('OpenLPPortable')
2148 Settings.setDefaultFormat(Settings.IniFormat)
2149 # Get location OpenLPPortable.ini
2150- portable_path = (AppLocation.get_directory(AppLocation.AppDir) / '..' / '..').resolve()
2151+ if args.portablepath:
2152+ if os.path.isabs(args.portablepath):
2153+ portable_path = Path(args.portablepath)
2154+ else:
2155+ portable_path = AppLocation.get_directory(AppLocation.AppDir) / '..' / args.portablepath
2156+ else:
2157+ portable_path = AppLocation.get_directory(AppLocation.AppDir) / '..' / '..'
2158+ portable_path = portable_path.resolve()
2159 data_path = portable_path / 'Data'
2160 set_up_logging(portable_path / 'Other')
2161 log.info('Running portable')
2162 portable_settings_path = data_path / 'OpenLP.ini'
2163 # Make this our settings file
2164 log.info('INI file: {name}'.format(name=portable_settings_path))
2165- Settings.set_filename(str(portable_settings_path))
2166+ Settings.set_filename(portable_settings_path)
2167 portable_settings = Settings()
2168 # Set our data path
2169 log.info('Data path: {name}'.format(name=data_path))
2170@@ -375,6 +385,15 @@
2171 else:
2172 application.setApplicationName('OpenLP')
2173 set_up_logging(AppLocation.get_directory(AppLocation.CacheDir))
2174+ # Set the libvlc environment variable if we're frozen
2175+ if getattr(sys, 'frozen', False):
2176+ if is_macosx():
2177+ vlc_lib = 'libvlc.dylib'
2178+ elif is_win():
2179+ vlc_lib = 'libvlc.dll'
2180+ os.environ['PYTHON_VLC_LIB_PATH'] = str(AppLocation.get_directory(AppLocation.AppDir) / vlc_lib)
2181+ log.debug('VLC Path: {}'.format(os.environ['PYTHON_VLC_LIB_PATH']))
2182+ # Initialise the Registry
2183 Registry.create()
2184 Registry().register('application', application)
2185 Registry().set_flag('no_web_server', args.no_web_server)
2186@@ -405,7 +424,12 @@
2187 None, translate('OpenLP', 'Settings Upgrade'),
2188 translate('OpenLP', 'Your settings are about to be upgraded. A backup will be created at '
2189 '{back_up_path}').format(back_up_path=back_up_path))
2190- settings.export(back_up_path)
2191+ try:
2192+ settings.export(back_up_path)
2193+ except OSError:
2194+ QtWidgets.QMessageBox.warning(
2195+ None, translate('OpenLP', 'Settings Upgrade'),
2196+ translate('OpenLP', 'Settings back up failed.\n\nContinuining to upgrade.'))
2197 settings.upgrade_settings()
2198 # First time checks in settings
2199 if not Settings().value('core/has run wizard'):
2200
2201=== modified file 'openlp/core/common/__init__.py'
2202--- openlp/core/common/__init__.py 2019-02-14 15:09:09 +0000
2203+++ openlp/core/common/__init__.py 2019-07-01 17:47:01 +0000
2204@@ -1,24 +1,24 @@
2205 # -*- coding: utf-8 -*-
2206 # vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4
2207
2208-###############################################################################
2209-# OpenLP - Open Source Lyrics Projection #
2210-# --------------------------------------------------------------------------- #
2211-# Copyright (c) 2008-2019 OpenLP Developers #
2212-# --------------------------------------------------------------------------- #
2213-# This program is free software; you can redistribute it and/or modify it #
2214-# under the terms of the GNU General Public License as published by the Free #
2215-# Software Foundation; version 2 of the License. #
2216-# #
2217-# This program is distributed in the hope that it will be useful, but WITHOUT #
2218-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or #
2219-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for #
2220-# more details. #
2221-# #
2222-# You should have received a copy of the GNU General Public License along #
2223-# with this program; if not, write to the Free Software Foundation, Inc., 59 #
2224-# Temple Place, Suite 330, Boston, MA 02111-1307 USA #
2225-###############################################################################
2226+##########################################################################
2227+# OpenLP - Open Source Lyrics Projection #
2228+# ---------------------------------------------------------------------- #
2229+# Copyright (c) 2008-2019 OpenLP Developers #
2230+# ---------------------------------------------------------------------- #
2231+# This program is free software: you can redistribute it and/or modify #
2232+# it under the terms of the GNU General Public License as published by #
2233+# the Free Software Foundation, either version 3 of the License, or #
2234+# (at your option) any later version. #
2235+# #
2236+# This program is distributed in the hope that it will be useful, #
2237+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
2238+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
2239+# GNU General Public License for more details. #
2240+# #
2241+# You should have received a copy of the GNU General Public License #
2242+# along with this program. If not, see <https://www.gnu.org/licenses/>. #
2243+##########################################################################
2244 """
2245 The :mod:`common` module contains most of the components and libraries that make
2246 OpenLP work.
2247@@ -134,15 +134,15 @@
2248 importlib.import_module(module_name)
2249 except (ImportError, OSError):
2250 # On some platforms importing vlc.py might cause OSError exceptions. (e.g. Mac OS X)
2251- log.warning('Failed to import {module_name} on path {extension_path}'
2252- .format(module_name=module_name, extension_path=extension_path))
2253+ log.exception('Failed to import {module_name} on path {extension_path}'
2254+ .format(module_name=module_name, extension_path=extension_path))
2255
2256
2257 def path_to_module(path):
2258 """
2259 Convert a path to a module name (i.e openlp.core.common)
2260
2261- :param openlp.core.common.path.Path path: The path to convert to a module name.
2262+ :param pathlib.Path path: The path to convert to a module name.
2263 :return: The module name.
2264 :rtype: str
2265 """
2266@@ -371,7 +371,7 @@
2267 """
2268 Deletes a file from the system.
2269
2270- :param openlp.core.common.path.Path file_path: The file, including path, to delete.
2271+ :param pathlib.Path file_path: The file, including path, to delete.
2272 :return: True if the deletion was successful, or the file never existed. False otherwise.
2273 :rtype: bool
2274 """
2275@@ -407,7 +407,7 @@
2276 """
2277 Validate that the file is not an image file.
2278
2279- :param openlp.core.common.path.Path file_path: The file to be checked.
2280+ :param pathlib.Path file_path: The file to be checked.
2281 :return: If the file is not an image
2282 :rtype: bool
2283 """
2284@@ -435,7 +435,7 @@
2285 """
2286 Function that checks whether a binary exists.
2287
2288- :param openlp.core.common.path.Path program_path: The full path to the binary to check.
2289+ :param pathlib.Path program_path: The full path to the binary to check.
2290 :return: program output to be parsed
2291 :rtype: bytes
2292 """
2293@@ -462,9 +462,9 @@
2294 """
2295 Utility function to incrementally detect the file encoding.
2296
2297- :param openlp.core.common.path.Path file_path: Filename for the file to determine the encoding for.
2298- :return: A dict with the keys 'encoding' and 'confidence'
2299- :rtype: dict[str, float]
2300+ :param pathlib.Path file_path: Filename for the file to determine the encoding for.
2301+ :return: The name of the encoding detected
2302+ :rtype: str
2303 """
2304 detector = UniversalDetector()
2305 try:
2306@@ -474,10 +474,10 @@
2307 if not chunk:
2308 break
2309 detector.feed(chunk)
2310- detector.close()
2311- return detector.result
2312 except OSError:
2313 log.exception('Error detecting file encoding')
2314+ finally:
2315+ return detector.close()['encoding']
2316
2317
2318 def normalize_str(irregular_string):
2319
2320=== modified file 'openlp/core/common/actions.py'
2321--- openlp/core/common/actions.py 2019-02-14 15:09:09 +0000
2322+++ openlp/core/common/actions.py 2019-07-01 17:47:01 +0000
2323@@ -1,24 +1,24 @@
2324 # -*- coding: utf-8 -*-
2325 # vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4
2326
2327-###############################################################################
2328-# OpenLP - Open Source Lyrics Projection #
2329-# --------------------------------------------------------------------------- #
2330-# Copyright (c) 2008-2019 OpenLP Developers #
2331-# --------------------------------------------------------------------------- #
2332-# This program is free software; you can redistribute it and/or modify it #
2333-# under the terms of the GNU General Public License as published by the Free #
2334-# Software Foundation; version 2 of the License. #
2335-# #
2336-# This program is distributed in the hope that it will be useful, but WITHOUT #
2337-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or #
2338-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for #
2339-# more details. #
2340-# #
2341-# You should have received a copy of the GNU General Public License along #
2342-# with this program; if not, write to the Free Software Foundation, Inc., 59 #
2343-# Temple Place, Suite 330, Boston, MA 02111-1307 USA #
2344-###############################################################################
2345+##########################################################################
2346+# OpenLP - Open Source Lyrics Projection #
2347+# ---------------------------------------------------------------------- #
2348+# Copyright (c) 2008-2019 OpenLP Developers #
2349+# ---------------------------------------------------------------------- #
2350+# This program is free software: you can redistribute it and/or modify #
2351+# it under the terms of the GNU General Public License as published by #
2352+# the Free Software Foundation, either version 3 of the License, or #
2353+# (at your option) any later version. #
2354+# #
2355+# This program is distributed in the hope that it will be useful, #
2356+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
2357+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
2358+# GNU General Public License for more details. #
2359+# #
2360+# You should have received a copy of the GNU General Public License #
2361+# along with this program. If not, see <https://www.gnu.org/licenses/>. #
2362+##########################################################################
2363 """
2364 The :mod:`~openlp.core.common.actions` module provides action list classes used
2365 by the shortcuts system.
2366
2367=== modified file 'openlp/core/common/applocation.py'
2368--- openlp/core/common/applocation.py 2019-02-14 15:09:09 +0000
2369+++ openlp/core/common/applocation.py 2019-07-01 17:47:01 +0000
2370@@ -1,36 +1,37 @@
2371 # -*- coding: utf-8 -*-
2372 # vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4
2373
2374-###############################################################################
2375-# OpenLP - Open Source Lyrics Projection #
2376-# --------------------------------------------------------------------------- #
2377-# Copyright (c) 2008-2019 OpenLP Developers #
2378-# --------------------------------------------------------------------------- #
2379-# This program is free software; you can redistribute it and/or modify it #
2380-# under the terms of the GNU General Public License as published by the Free #
2381-# Software Foundation; version 2 of the License. #
2382-# #
2383-# This program is distributed in the hope that it will be useful, but WITHOUT #
2384-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or #
2385-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for #
2386-# more details. #
2387-# #
2388-# You should have received a copy of the GNU General Public License along #
2389-# with this program; if not, write to the Free Software Foundation, Inc., 59 #
2390-# Temple Place, Suite 330, Boston, MA 02111-1307 USA #
2391-###############################################################################
2392+##########################################################################
2393+# OpenLP - Open Source Lyrics Projection #
2394+# ---------------------------------------------------------------------- #
2395+# Copyright (c) 2008-2019 OpenLP Developers #
2396+# ---------------------------------------------------------------------- #
2397+# This program is free software: you can redistribute it and/or modify #
2398+# it under the terms of the GNU General Public License as published by #
2399+# the Free Software Foundation, either version 3 of the License, or #
2400+# (at your option) any later version. #
2401+# #
2402+# This program is distributed in the hope that it will be useful, #
2403+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
2404+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
2405+# GNU General Public License for more details. #
2406+# #
2407+# You should have received a copy of the GNU General Public License #
2408+# along with this program. If not, see <https://www.gnu.org/licenses/>. #
2409+##########################################################################
2410 """
2411 The :mod:`openlp.core.common.applocation` module provides an utility for OpenLP receiving the data path etc.
2412 """
2413 import logging
2414 import os
2415 import sys
2416+from pathlib import Path
2417
2418 import appdirs
2419
2420 import openlp
2421 from openlp.core.common import get_frozen_path, is_macosx, is_win
2422-from openlp.core.common.path import Path, create_paths
2423+from openlp.core.common.path import create_paths
2424 from openlp.core.common.settings import Settings
2425
2426
2427@@ -58,7 +59,7 @@
2428
2429 :param dir_type: The directory type you want, for instance the data directory. Default *AppLocation.AppDir*
2430 :return: The requested path
2431- :rtype: openlp.core.common.path.Path
2432+ :rtype: Path
2433 """
2434 if dir_type == AppLocation.AppDir or dir_type == AppLocation.VersionDir:
2435 return get_frozen_path(FROZEN_APP_PATH, APP_PATH)
2436@@ -75,7 +76,7 @@
2437 Return the path OpenLP stores all its data under.
2438
2439 :return: The data path to use.
2440- :rtype: openlp.core.common.path.Path
2441+ :rtype: Path
2442 """
2443 # Check if we have a different data location.
2444 if Settings().contains('advanced/data path'):
2445@@ -95,7 +96,7 @@
2446 :param str extension: Defaults to ''. The extension to search for. For example::
2447 '.png'
2448 :return: List of files found.
2449- :rtype: list[openlp.core.common.path.Path]
2450+ :rtype: list[Path]
2451 """
2452 path = AppLocation.get_data_path()
2453 if section:
2454@@ -112,7 +113,7 @@
2455 Return the path a particular module stores its data under.
2456
2457 :param str section:
2458- :rtype: openlp.core.common.path.Path
2459+ :rtype: Path
2460 """
2461 path = AppLocation.get_data_path() / section
2462 create_paths(path)
2463@@ -125,7 +126,7 @@
2464
2465 :param dir_type: AppLocation Enum of the requested path type
2466 :return: The requested path
2467- :rtype: openlp.core.common.path.Path
2468+ :rtype: Path
2469 """
2470 # If running from source, return the language directory from the source directory
2471 if dir_type == AppLocation.LanguageDir:
2472
2473=== modified file 'openlp/core/common/db.py'
2474--- openlp/core/common/db.py 2019-02-14 15:09:09 +0000
2475+++ openlp/core/common/db.py 2019-07-01 17:47:01 +0000
2476@@ -1,24 +1,24 @@
2477 # -*- coding: utf-8 -*-
2478 # vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4
2479
2480-###############################################################################
2481-# OpenLP - Open Source Lyrics Projection #
2482-# --------------------------------------------------------------------------- #
2483-# Copyright (c) 2008-2019 OpenLP Developers #
2484-# --------------------------------------------------------------------------- #
2485-# This program is free software; you can redistribute it and/or modify it #
2486-# under the terms of the GNU General Public License as published by the Free #
2487-# Software Foundation; version 2 of the License. #
2488-# #
2489-# This program is distributed in the hope that it will be useful, but WITHOUT #
2490-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or #
2491-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for #
2492-# more details. #
2493-# #
2494-# You should have received a copy of the GNU General Public License along #
2495-# with this program; if not, write to the Free Software Foundation, Inc., 59 #
2496-# Temple Place, Suite 330, Boston, MA 02111-1307 USA #
2497-###############################################################################
2498+##########################################################################
2499+# OpenLP - Open Source Lyrics Projection #
2500+# ---------------------------------------------------------------------- #
2501+# Copyright (c) 2008-2019 OpenLP Developers #
2502+# ---------------------------------------------------------------------- #
2503+# This program is free software: you can redistribute it and/or modify #
2504+# it under the terms of the GNU General Public License as published by #
2505+# the Free Software Foundation, either version 3 of the License, or #
2506+# (at your option) any later version. #
2507+# #
2508+# This program is distributed in the hope that it will be useful, #
2509+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
2510+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
2511+# GNU General Public License for more details. #
2512+# #
2513+# You should have received a copy of the GNU General Public License #
2514+# along with this program. If not, see <https://www.gnu.org/licenses/>. #
2515+##########################################################################
2516 """
2517 The :mod:`db` module provides helper functions for database related methods.
2518 """
2519
2520=== modified file 'openlp/core/common/httputils.py'
2521--- openlp/core/common/httputils.py 2019-02-14 15:09:09 +0000
2522+++ openlp/core/common/httputils.py 2019-07-01 17:47:01 +0000
2523@@ -1,24 +1,24 @@
2524 # -*- coding: utf-8 -*-
2525 # vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4
2526
2527-###############################################################################
2528-# OpenLP - Open Source Lyrics Projection #
2529-# --------------------------------------------------------------------------- #
2530-# Copyright (c) 2008-2019 OpenLP Developers #
2531-# --------------------------------------------------------------------------- #
2532-# This program is free software; you can redistribute it and/or modify it #
2533-# under the terms of the GNU General Public License as published by the Free #
2534-# Software Foundation; version 2 of the License. #
2535-# #
2536-# This program is distributed in the hope that it will be useful, but WITHOUT #
2537-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or #
2538-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for #
2539-# more details. #
2540-# #
2541-# You should have received a copy of the GNU General Public License along #
2542-# with this program; if not, write to the Free Software Foundation, Inc., 59 #
2543-# Temple Place, Suite 330, Boston, MA 02111-1307 USA #
2544-###############################################################################
2545+##########################################################################
2546+# OpenLP - Open Source Lyrics Projection #
2547+# ---------------------------------------------------------------------- #
2548+# Copyright (c) 2008-2019 OpenLP Developers #
2549+# ---------------------------------------------------------------------- #
2550+# This program is free software: you can redistribute it and/or modify #
2551+# it under the terms of the GNU General Public License as published by #
2552+# the Free Software Foundation, either version 3 of the License, or #
2553+# (at your option) any later version. #
2554+# #
2555+# This program is distributed in the hope that it will be useful, #
2556+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
2557+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
2558+# GNU General Public License for more details. #
2559+# #
2560+# You should have received a copy of the GNU General Public License #
2561+# along with this program. If not, see <https://www.gnu.org/licenses/>. #
2562+##########################################################################
2563 """
2564 The :mod:`openlp.core.common.httputils` module provides the utility methods for downloading stuff.
2565 """
2566@@ -26,13 +26,17 @@
2567 import logging
2568 import sys
2569 import time
2570+from pathlib import Path
2571 from random import randint
2572+from tempfile import gettempdir
2573
2574 import requests
2575+from PyQt5 import QtCore
2576
2577 from openlp.core.common import trace_error_handler
2578 from openlp.core.common.registry import Registry
2579 from openlp.core.common.settings import ProxyMode, Settings
2580+from openlp.core.threading import ThreadWorker
2581
2582
2583 log = logging.getLogger(__name__ + '.__init__')
2584@@ -154,16 +158,20 @@
2585 return response.text
2586
2587
2588-def get_url_file_size(url):
2589+def get_url_file_size(url, proxy=None):
2590 """
2591 Get the size of a file.
2592
2593 :param url: The URL of the file we want to download.
2594+ :param dict | ProxyMode | None proxy: ProxyMode enum or a dictionary containing the proxy servers, with their types
2595+ as the key e.g. {'http': 'http://proxyserver:port', 'https': 'https://proxyserver:port'}
2596 """
2597 retries = 0
2598+ if not isinstance(proxy, dict):
2599+ proxy = get_proxy_settings(mode=proxy)
2600 while True:
2601 try:
2602- response = requests.head(url, timeout=float(CONNECTION_TIMEOUT), allow_redirects=True)
2603+ response = requests.head(url, proxies=proxy, timeout=float(CONNECTION_TIMEOUT), allow_redirects=True)
2604 return int(response.headers['Content-Length'])
2605 except OSError:
2606 if retries > CONNECTION_RETRIES:
2607@@ -174,7 +182,7 @@
2608 continue
2609
2610
2611-def download_file(update_object, url, file_path, sha256=None):
2612+def download_file(update_object, url, file_path, sha256=None, proxy=None):
2613 """"
2614 Download a file given a URL. The file is retrieved in chunks, giving the ability to cancel the download at any
2615 point. Returns False on download error.
2616@@ -183,15 +191,19 @@
2617 :param url: URL to download
2618 :param file_path: Destination file
2619 :param sha256: The check sum value to be checked against the download value
2620+ :param dict | ProxyMode | None proxy: ProxyMode enum or a dictionary containing the proxy servers, with their types
2621+ as the key e.g. {'http': 'http://proxyserver:port', 'https': 'https://proxyserver:port'}
2622 """
2623 block_count = 0
2624 block_size = 4096
2625 retries = 0
2626+ if not isinstance(proxy, dict):
2627+ proxy = get_proxy_settings(mode=proxy)
2628 log.debug('url_get_file: %s', url)
2629 while retries < CONNECTION_RETRIES:
2630 try:
2631 with file_path.open('wb') as saved_file:
2632- response = requests.get(url, timeout=float(CONNECTION_TIMEOUT), stream=True)
2633+ response = requests.get(url, proxies=proxy, timeout=float(CONNECTION_TIMEOUT), stream=True)
2634 if sha256:
2635 hasher = hashlib.sha256()
2636 # Download until finished or canceled.
2637@@ -227,4 +239,46 @@
2638 return True
2639
2640
2641-__all__ = ['get_web_page']
2642+class DownloadWorker(ThreadWorker):
2643+ """
2644+ This worker allows a file to be downloaded in a thread
2645+ """
2646+ download_failed = QtCore.pyqtSignal()
2647+ download_succeeded = QtCore.pyqtSignal(Path)
2648+
2649+ def __init__(self, base_url, file_name):
2650+ """
2651+ Set up the worker object
2652+ """
2653+ self._base_url = base_url
2654+ self._file_name = file_name
2655+ self.was_cancelled = False
2656+ super().__init__()
2657+
2658+ def start(self):
2659+ """
2660+ Download the url to the temporary directory
2661+ """
2662+ if self.was_cancelled:
2663+ self.quit.emit()
2664+ return
2665+ try:
2666+ dest_path = Path(gettempdir()) / 'openlp' / self._file_name
2667+ url = '{url}{name}'.format(url=self._base_url, name=self._file_name)
2668+ is_success = download_file(self, url, dest_path)
2669+ if is_success and not self.was_cancelled:
2670+ self.download_succeeded.emit(dest_path)
2671+ else:
2672+ self.download_failed.emit()
2673+ except Exception:
2674+ log.exception('Unable to download %s', url)
2675+ self.download_failed.emit()
2676+ finally:
2677+ self.quit.emit()
2678+
2679+ @QtCore.pyqtSlot()
2680+ def cancel_download(self):
2681+ """
2682+ A slot to allow the download to be cancelled from outside of the thread
2683+ """
2684+ self.was_cancelled = True
2685
2686=== modified file 'openlp/core/common/i18n.py'
2687--- openlp/core/common/i18n.py 2019-02-14 15:09:09 +0000
2688+++ openlp/core/common/i18n.py 2019-07-01 17:47:01 +0000
2689@@ -1,24 +1,24 @@
2690 # -*- coding: utf-8 -*-
2691 # vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4
2692
2693-###############################################################################
2694-# OpenLP - Open Source Lyrics Projection #
2695-# --------------------------------------------------------------------------- #
2696-# Copyright (c) 2008-2019 OpenLP Developers #
2697-# --------------------------------------------------------------------------- #
2698-# This program is free software; you can redistribute it and/or modify it #
2699-# under the terms of the GNU General Public License as published by the Free #
2700-# Software Foundation; version 2 of the License. #
2701-# #
2702-# This program is distributed in the hope that it will be useful, but WITHOUT #
2703-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or #
2704-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for #
2705-# more details. #
2706-# #
2707-# You should have received a copy of the GNU General Public License along #
2708-# with this program; if not, write to the Free Software Foundation, Inc., 59 #
2709-# Temple Place, Suite 330, Boston, MA 02111-1307 USA #
2710-###############################################################################
2711+##########################################################################
2712+# OpenLP - Open Source Lyrics Projection #
2713+# ---------------------------------------------------------------------- #
2714+# Copyright (c) 2008-2019 OpenLP Developers #
2715+# ---------------------------------------------------------------------- #
2716+# This program is free software: you can redistribute it and/or modify #
2717+# it under the terms of the GNU General Public License as published by #
2718+# the Free Software Foundation, either version 3 of the License, or #
2719+# (at your option) any later version. #
2720+# #
2721+# This program is distributed in the hope that it will be useful, #
2722+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
2723+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
2724+# GNU General Public License for more details. #
2725+# #
2726+# You should have received a copy of the GNU General Public License #
2727+# along with this program. If not, see <https://www.gnu.org/licenses/>. #
2728+##########################################################################
2729 """
2730 The :mod:`languages` module provides a list of language names with utility functions.
2731 """
2732@@ -385,7 +385,8 @@
2733 self.Error = translate('OpenLP.Ui', 'Error')
2734 self.Export = translate('OpenLP.Ui', 'Export')
2735 self.File = translate('OpenLP.Ui', 'File')
2736- self.FontSizePtUnit = translate('OpenLP.Ui', 'pt', 'Abbreviated font pointsize unit')
2737+ self.FileCorrupt = translate('OpenLP.Ui', 'File appears to be corrupt.')
2738+ self.FontSizePtUnit = translate('OpenLP.Ui', 'pt', 'Abbreviated font point size unit')
2739 self.Help = translate('OpenLP.Ui', 'Help')
2740 self.Hours = translate('OpenLP.Ui', 'h', 'The abbreviated unit for hours')
2741 self.IFdSs = translate('OpenLP.Ui', 'Invalid Folder Selected', 'Singular')
2742
2743=== modified file 'openlp/core/common/json.py'
2744--- openlp/core/common/json.py 2019-02-14 15:09:09 +0000
2745+++ openlp/core/common/json.py 2019-07-01 17:47:01 +0000
2746@@ -1,32 +1,93 @@
2747 # -*- coding: utf-8 -*-
2748 # vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4
2749
2750-###############################################################################
2751-# OpenLP - Open Source Lyrics Projection #
2752-# --------------------------------------------------------------------------- #
2753-# Copyright (c) 2008-2019 OpenLP Developers #
2754-# --------------------------------------------------------------------------- #
2755-# This program is free software; you can redistribute it and/or modify it #
2756-# under the terms of the GNU General Public License as published by the Free #
2757-# Software Foundation; version 2 of the License. #
2758-# #
2759-# This program is distributed in the hope that it will be useful, but WITHOUT #
2760-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or #
2761-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for #
2762-# more details. #
2763-# #
2764-# You should have received a copy of the GNU General Public License along #
2765-# with this program; if not, write to the Free Software Foundation, Inc., 59 #
2766-# Temple Place, Suite 330, Boston, MA 02111-1307 USA #
2767-###############################################################################
2768+##########################################################################
2769+# OpenLP - Open Source Lyrics Projection #
2770+# ---------------------------------------------------------------------- #
2771+# Copyright (c) 2008-2019 OpenLP Developers #
2772+# ---------------------------------------------------------------------- #
2773+# This program is free software: you can redistribute it and/or modify #
2774+# it under the terms of the GNU General Public License as published by #
2775+# the Free Software Foundation, either version 3 of the License, or #
2776+# (at your option) any later version. #
2777+# #
2778+# This program is distributed in the hope that it will be useful, #
2779+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
2780+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
2781+# GNU General Public License for more details. #
2782+# #
2783+# You should have received a copy of the GNU General Public License #
2784+# along with this program. If not, see <https://www.gnu.org/licenses/>. #
2785+##########################################################################
2786+from contextlib import suppress
2787 from json import JSONDecoder, JSONEncoder
2788-
2789-from openlp.core.common.path import Path
2790-
2791-
2792-class OpenLPJsonDecoder(JSONDecoder):
2793- """
2794- Implement a custom JSONDecoder to handle Path objects
2795+from pathlib import Path
2796+
2797+_registered_classes = {}
2798+
2799+
2800+class JSONMixin(object):
2801+ """
2802+ :class:`JSONMixin` is a mixin class to simplify the serialization of a subclass to JSON.
2803+
2804+ :cvar:`_json_keys` is used to specify the attributes of the subclass that you wish to serialize.
2805+ :vartype _json_keys: list[str]
2806+ :cvar:`_name` set to override the the subclass name, useful if using a `proxy` class
2807+ :vartype _name: str
2808+ """
2809+ _json_keys = []
2810+ _name = None
2811+ _version = 1
2812+
2813+ def __init_subclass__(cls, register_names=None, **kwargs):
2814+ """
2815+ Register the subclass.
2816+
2817+ :param collections.Iterable[str] register_names: Alternative names to register instead of the class name
2818+ :param kwargs: Other args to pass to the super method
2819+ :return None:
2820+ """
2821+ super().__init_subclass__(**kwargs)
2822+ for key in register_names or [cls.__name__]:
2823+ _registered_classes[key] = cls
2824+
2825+ @classmethod
2826+ def encode_json(cls, obj, **kwargs):
2827+ """
2828+ Create a instance of the subclass from the dictionary that has been constructed by the JSON representation.
2829+ Only use the keys specified in :cvar:`_json_keys`.
2830+
2831+ :param dict[str] obj: The dictionary representation of the subclass (deserailized from the JSON)
2832+ :param kwargs: Contains any extra parameters. Not used!
2833+ :return: The desrialized object
2834+ """
2835+ return cls(**{key: obj[key] for key in cls._json_keys if obj.get(key) is not None})
2836+
2837+ @classmethod
2838+ def attach_meta(cls, j_dict):
2839+ """
2840+ Attach meta data to the serialized dictionary.
2841+
2842+ :param dict[str] j_dict: The dictionary to update with the meta data
2843+ :return None:
2844+ """
2845+ j_dict.update({'json_meta': {'class': cls._name or cls.__name__, 'version': cls._version}})
2846+
2847+ def json_object(self, **kwargs):
2848+ """
2849+ Create a dictionary that can be JSON decoded.
2850+
2851+ :param kwargs: Contains any extra parameters. Not used!
2852+ :return dict[str]: The dictionary representation of this Path object.
2853+ """
2854+ j_dict = {key: self.__dict__[key] for key in self._json_keys if self.__dict__.get(key) is not None}
2855+ self.attach_meta(j_dict)
2856+ return j_dict
2857+
2858+
2859+class OpenLPJSONDecoder(JSONDecoder):
2860+ """
2861+ Implement a custom JSONDecoder to extend compatibility to custom objects
2862
2863 Example Usage:
2864 object = json.loads(json_string, cls=OpenLPJsonDecoder)
2865@@ -45,23 +106,28 @@
2866
2867 def custom_object_hook(self, obj):
2868 """
2869- Implement a custom Path object decoder.
2870+ Implement a custom object decoder.
2871
2872 :param dict obj: A decoded JSON object
2873- :return: The original object literal, or a Path object if the object literal contains a key '__Path__'
2874- :rtype: dict | openlp.core.common.path.Path
2875+ :return: The custom object from the serialized data if the custom object is registered, else obj
2876 """
2877 if '__Path__' in obj:
2878- obj = Path.encode_json(obj, **self.kwargs)
2879+ return PathSerializer.encode_json(obj, **self.kwargs)
2880+ try:
2881+ key = obj['json_meta']['class']
2882+ except KeyError:
2883+ return obj
2884+ if key in _registered_classes:
2885+ return _registered_classes[key].encode_json(obj, **self.kwargs)
2886 return obj
2887
2888
2889-class OpenLPJsonEncoder(JSONEncoder):
2890+class OpenLPJSONEncoder(JSONEncoder):
2891 """
2892- Implement a custom JSONEncoder to handle Path objects
2893+ Implement a custom JSONEncoder to handle to extend compatibility to custom objects
2894
2895 Example Usage:
2896- json_string = json.dumps(object, cls=OpenLPJsonEncoder)
2897+ json_string = json.dumps(object, cls=OpenLPJSONEncoder)
2898 """
2899 def __init__(self, skipkeys=False, ensure_ascii=True, check_circular=True, allow_nan=True, sort_keys=False,
2900 indent=None, separators=None, default=None, **kwargs):
2901@@ -78,12 +144,64 @@
2902
2903 def custom_default(self, obj):
2904 """
2905- Convert any Path objects into a dictionary object which can be serialized.
2906+ Convert any registered objects into a dictionary object which can be serialized.
2907
2908 :param object obj: The object to convert
2909- :return: The serializable object
2910- :rtype: dict
2911- """
2912- if isinstance(obj, Path):
2913- return obj.json_object(**self.kwargs)
2914- return super().default(obj)
2915+ :return dict: The serializable object
2916+ """
2917+ if isinstance(obj, JSONMixin):
2918+ return obj.json_object()
2919+ elif obj.__class__.__name__ in _registered_classes:
2920+ return _registered_classes[obj.__class__.__name__].json_object(obj, **self.kwargs)
2921+ return super().default(obj, **self.kwargs)
2922+
2923+
2924+def is_serializable(obj):
2925+ return obj.__class__.__name__ in _registered_classes
2926+
2927+
2928+class PathSerializer(JSONMixin, register_names=('Path', 'PosixPath', 'WindowsPath')):
2929+ """
2930+ Implement a de/serializer for pathlib.Path objects
2931+ """
2932+ _name = 'Path'
2933+
2934+ @staticmethod
2935+ def encode_json(obj, base_path=None, **kwargs):
2936+ """
2937+ Reimplement encode_json to create a Path object from a dictionary representation.
2938+
2939+ :param dict[str] obj: The dictionary representation
2940+ :param Path base_path: If specified, an absolute path to base the relative path off of.
2941+ :param kwargs: Contains any extra parameters. Not used!
2942+ :return Path: The deserialized Path object
2943+ """
2944+ if '__Path__' in obj:
2945+ parts = obj['__Path__']
2946+ else:
2947+ parts = obj['parts']
2948+ path = Path(*parts)
2949+ if base_path and not path.is_absolute():
2950+ return base_path / path
2951+ return path
2952+
2953+ @classmethod
2954+ def json_object(cls, obj, base_path=None, is_js=False, **kwargs):
2955+ """
2956+ Create a dictionary that can be JSON decoded.
2957+
2958+ :param Path base_path: If specified, an absolute path to make a relative path from.
2959+ :param bool is_js: Encode the path as a uri. For example for use in the js rendering code.
2960+ :param kwargs: Contains any extra parameters. Not used!
2961+ :return: The dictionary representation of this Path object.
2962+ :rtype: dict[tuple]
2963+ """
2964+ path = obj
2965+ if base_path:
2966+ with suppress(ValueError):
2967+ path = path.relative_to(base_path)
2968+ if is_js is True:
2969+ return path.as_uri()
2970+ json_dict = {'parts': path.parts}
2971+ cls.attach_meta(json_dict)
2972+ return json_dict
2973
2974=== modified file 'openlp/core/common/mixins.py'
2975--- openlp/core/common/mixins.py 2019-02-14 15:09:09 +0000
2976+++ openlp/core/common/mixins.py 2019-07-01 17:47:01 +0000
2977@@ -1,24 +1,24 @@
2978 # -*- coding: utf-8 -*-
2979 # vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4
2980
2981-###############################################################################
2982-# OpenLP - Open Source Lyrics Projection #
2983-# --------------------------------------------------------------------------- #
2984-# Copyright (c) 2008-2019 OpenLP Developers #
2985-# --------------------------------------------------------------------------- #
2986-# This program is free software; you can redistribute it and/or modify it #
2987-# under the terms of the GNU General Public License as published by the Free #
2988-# Software Foundation; version 2 of the License. #
2989-# #
2990-# This program is distributed in the hope that it will be useful, but WITHOUT #
2991-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or #
2992-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for #
2993-# more details. #
2994-# #
2995-# You should have received a copy of the GNU General Public License along #
2996-# with this program; if not, write to the Free Software Foundation, Inc., 59 #
2997-# Temple Place, Suite 330, Boston, MA 02111-1307 USA #
2998-###############################################################################
2999+##########################################################################
3000+# OpenLP - Open Source Lyrics Projection #
3001+# ---------------------------------------------------------------------- #
3002+# Copyright (c) 2008-2019 OpenLP Developers #
3003+# ---------------------------------------------------------------------- #
3004+# This program is free software: you can redistribute it and/or modify #
3005+# it under the terms of the GNU General Public License as published by #
3006+# the Free Software Foundation, either version 3 of the License, or #
3007+# (at your option) any later version. #
3008+# #
3009+# This program is distributed in the hope that it will be useful, #
3010+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
3011+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
3012+# GNU General Public License for more details. #
3013+# #
3014+# You should have received a copy of the GNU General Public License #
3015+# along with this program. If not, see <https://www.gnu.org/licenses/>. #
3016+##########################################################################
3017 """
3018 Provide Error Handling and login Services
3019 """
3020
3021=== modified file 'openlp/core/common/path.py'
3022--- openlp/core/common/path.py 2019-02-14 15:09:09 +0000
3023+++ openlp/core/common/path.py 2019-07-01 17:47:01 +0000
3024@@ -1,86 +1,31 @@
3025 # -*- coding: utf-8 -*-
3026 # vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4
3027
3028-###############################################################################
3029-# OpenLP - Open Source Lyrics Projection #
3030-# --------------------------------------------------------------------------- #
3031-# Copyright (c) 2008-2019 OpenLP Developers #
3032-# --------------------------------------------------------------------------- #
3033-# This program is free software; you can redistribute it and/or modify it #
3034-# under the terms of the GNU General Public License as published by the Free #
3035-# Software Foundation; version 2 of the License. #
3036-# #
3037-# This program is distributed in the hope that it will be useful, but WITHOUT #
3038-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or #
3039-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for #
3040-# more details. #
3041-# #
3042-# You should have received a copy of the GNU General Public License along #
3043-# with this program; if not, write to the Free Software Foundation, Inc., 59 #
3044-# Temple Place, Suite 330, Boston, MA 02111-1307 USA #
3045-###############################################################################
3046+##########################################################################
3047+# OpenLP - Open Source Lyrics Projection #
3048+# ---------------------------------------------------------------------- #
3049+# Copyright (c) 2008-2019 OpenLP Developers #
3050+# ---------------------------------------------------------------------- #
3051+# This program is free software: you can redistribute it and/or modify #
3052+# it under the terms of the GNU General Public License as published by #
3053+# the Free Software Foundation, either version 3 of the License, or #
3054+# (at your option) any later version. #
3055+# #
3056+# This program is distributed in the hope that it will be useful, #
3057+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
3058+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
3059+# GNU General Public License for more details. #
3060+# #
3061+# You should have received a copy of the GNU General Public License #
3062+# along with this program. If not, see <https://www.gnu.org/licenses/>. #
3063+##########################################################################
3064 import logging
3065 import shutil
3066-from contextlib import suppress
3067-
3068-from openlp.core.common import is_win
3069-
3070-
3071-if is_win():
3072- from pathlib import WindowsPath as PathVariant # pragma: nocover
3073-else:
3074- from pathlib import PosixPath as PathVariant # pragma: nocover
3075+from pathlib import Path
3076
3077 log = logging.getLogger(__name__)
3078
3079
3080-class Path(PathVariant):
3081- """
3082- Subclass pathlib.Path, so we can add json conversion methods
3083- """
3084- @staticmethod
3085- def encode_json(obj, base_path=None, **kwargs):
3086- """
3087- Create a Path object from a dictionary representation. The dictionary has been constructed by JSON encoding of
3088- a JSON reprensation of a Path object.
3089-
3090- :param dict[str] obj: The dictionary representation
3091- :param openlp.core.common.path.Path base_path: If specified, an absolute path to base the relative path off of.
3092- :param kwargs: Contains any extra parameters. Not used!
3093- :return: The reconstructed Path object
3094- :rtype: openlp.core.common.path.Path
3095- """
3096- path = Path(*obj['__Path__'])
3097- if base_path and not path.is_absolute():
3098- return base_path / path
3099- return path
3100-
3101- def json_object(self, base_path=None, **kwargs):
3102- """
3103- Create a dictionary that can be JSON decoded.
3104-
3105- :param openlp.core.common.path.Path base_path: If specified, an absolute path to make a relative path from.
3106- :param kwargs: Contains any extra parameters. Not used!
3107- :return: The dictionary representation of this Path object.
3108- :rtype: dict[tuple]
3109- """
3110- path = self
3111- if base_path:
3112- with suppress(ValueError):
3113- path = path.relative_to(base_path)
3114- return {'__Path__': path.parts}
3115-
3116- def rmtree(self, ignore_errors=False, onerror=None):
3117- """
3118- Provide an interface to :func:`shutil.rmtree`
3119-
3120- :param bool ignore_errors: Ignore errors
3121- :param onerror: Handler function to handle any errors
3122- :rtype: None
3123- """
3124- shutil.rmtree(str(self), ignore_errors, onerror)
3125-
3126-
3127 def replace_params(args, kwargs, params):
3128 """
3129 Apply a transformation function to the specified args or kwargs
3130@@ -110,65 +55,11 @@
3131 return tuple(args), kwargs
3132
3133
3134-def copy(*args, **kwargs):
3135- """
3136- Wraps :func:`shutil.copy` so that we can accept Path objects.
3137-
3138- :param src openlp.core.common.path.Path: Takes a Path object which is then converted to a str object
3139- :param dst openlp.core.common.path.Path: Takes a Path object which is then converted to a str object
3140- :return: Converts the str object received from :func:`shutil.copy` to a Path or NoneType object
3141- :rtype: openlp.core.common.path.Path | None
3142-
3143- See the following link for more information on the other parameters:
3144- https://docs.python.org/3/library/shutil.html#shutil.copy
3145- """
3146-
3147- args, kwargs = replace_params(args, kwargs, ((0, 'src', path_to_str), (1, 'dst', path_to_str)))
3148-
3149- return str_to_path(shutil.copy(*args, **kwargs))
3150-
3151-
3152-def copyfile(*args, **kwargs):
3153- """
3154- Wraps :func:`shutil.copyfile` so that we can accept Path objects.
3155-
3156- :param openlp.core.common.path.Path src: Takes a Path object which is then converted to a str object
3157- :param openlp.core.common.path.Path dst: Takes a Path object which is then converted to a str object
3158- :return: Converts the str object received from :func:`shutil.copyfile` to a Path or NoneType object
3159- :rtype: openlp.core.common.path.Path | None
3160-
3161- See the following link for more information on the other parameters:
3162- https://docs.python.org/3/library/shutil.html#shutil.copyfile
3163- """
3164-
3165- args, kwargs = replace_params(args, kwargs, ((0, 'src', path_to_str), (1, 'dst', path_to_str)))
3166-
3167- return str_to_path(shutil.copyfile(*args, **kwargs))
3168-
3169-
3170-def copytree(*args, **kwargs):
3171- """
3172- Wraps :func:shutil.copytree` so that we can accept Path objects.
3173-
3174- :param openlp.core.common.path.Path src : Takes a Path object which is then converted to a str object
3175- :param openlp.core.common.path.Path dst: Takes a Path object which is then converted to a str object
3176- :return: Converts the str object received from :func:`shutil.copytree` to a Path or NoneType object
3177- :rtype: openlp.core.common.path.Path | None
3178-
3179- See the following link for more information on the other parameters:
3180- https://docs.python.org/3/library/shutil.html#shutil.copytree
3181- """
3182-
3183- args, kwargs = replace_params(args, kwargs, ((0, 'src', path_to_str), (1, 'dst', path_to_str)))
3184-
3185- return str_to_path(shutil.copytree(*args, **kwargs))
3186-
3187-
3188 def which(*args, **kwargs):
3189 """
3190 Wraps :func:shutil.which` so that it return a Path objects.
3191
3192- :rtype: openlp.core.common.Path
3193+ :rtype: Path
3194
3195 See the following link for more information on the other parameters:
3196 https://docs.python.org/3/library/shutil.html#shutil.which
3197@@ -183,10 +74,12 @@
3198 """
3199 A utility function to convert a Path object or NoneType to a string equivalent.
3200
3201- :param openlp.core.common.path.Path | None path: The value to convert to a string
3202+ :param Path | None path: The value to convert to a string
3203 :return: An empty string if :param:`path` is None, else a string representation of the :param:`path`
3204 :rtype: str
3205 """
3206+ if isinstance(path, str):
3207+ return path
3208 if not isinstance(path, Path) and path is not None:
3209 raise TypeError('parameter \'path\' must be of type Path or NoneType')
3210 if path is None:
3211@@ -204,7 +97,7 @@
3212
3213 :param str string: The string to convert
3214 :return: None if :param:`string` is empty, or a Path object representation of :param:`string`
3215- :rtype: openlp.core.common.path.Path | None
3216+ :rtype: Path | None
3217 """
3218 if not isinstance(string, str):
3219 log.error('parameter \'string\' must be of type str, got {} which is a {} instead'.format(string, type(string)))
3220@@ -218,7 +111,7 @@
3221 """
3222 Create one or more paths
3223
3224- :param openlp.core.common.path.Path paths: The paths to create
3225+ :param Path paths: The paths to create
3226 :param bool do_not_log: To not log anything. This is need for the start up, when the log isn't ready.
3227 :rtype: None
3228 """
3229@@ -239,7 +132,7 @@
3230
3231 :param list[str] file_names: The list of file names to convert.
3232 :return: The list converted to file paths
3233- :rtype: openlp.core.common.path.Path
3234+ :rtype: Path
3235 """
3236 if file_names:
3237 return [str_to_path(file_name) for file_name in file_names]
3238
3239=== modified file 'openlp/core/common/registry.py'
3240--- openlp/core/common/registry.py 2019-02-14 15:09:09 +0000
3241+++ openlp/core/common/registry.py 2019-07-01 17:47:01 +0000
3242@@ -1,24 +1,24 @@
3243 # -*- coding: utf-8 -*-
3244 # vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4
3245
3246-###############################################################################
3247-# OpenLP - Open Source Lyrics Projection #
3248-# --------------------------------------------------------------------------- #
3249-# Copyright (c) 2008-2019 OpenLP Developers #
3250-# --------------------------------------------------------------------------- #
3251-# This program is free software; you can redistribute it and/or modify it #
3252-# under the terms of the GNU General Public License as published by the Free #
3253-# Software Foundation; version 2 of the License. #
3254-# #
3255-# This program is distributed in the hope that it will be useful, but WITHOUT #
3256-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or #
3257-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for #
3258-# more details. #
3259-# #
3260-# You should have received a copy of the GNU General Public License along #
3261-# with this program; if not, write to the Free Software Foundation, Inc., 59 #
3262-# Temple Place, Suite 330, Boston, MA 02111-1307 USA #
3263-###############################################################################
3264+##########################################################################
3265+# OpenLP - Open Source Lyrics Projection #
3266+# ---------------------------------------------------------------------- #
3267+# Copyright (c) 2008-2019 OpenLP Developers #
3268+# ---------------------------------------------------------------------- #
3269+# This program is free software: you can redistribute it and/or modify #
3270+# it under the terms of the GNU General Public License as published by #
3271+# the Free Software Foundation, either version 3 of the License, or #
3272+# (at your option) any later version. #
3273+# #
3274+# This program is distributed in the hope that it will be useful, #
3275+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
3276+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
3277+# GNU General Public License for more details. #
3278+# #
3279+# You should have received a copy of the GNU General Public License #
3280+# along with this program. If not, see <https://www.gnu.org/licenses/>. #
3281+##########################################################################
3282 """
3283 Provide Registry Services
3284 """
3285@@ -146,7 +146,7 @@
3286 try:
3287 log.debug('Running function {} for {}'.format(function, event))
3288 result = function(*args, **kwargs)
3289- if result:
3290+ if result is not None:
3291 results.append(result)
3292 except TypeError:
3293 # Who has called me can help in debugging
3294
3295=== modified file 'openlp/core/common/settings.py'
3296--- openlp/core/common/settings.py 2019-02-14 15:09:09 +0000
3297+++ openlp/core/common/settings.py 2019-07-01 17:47:01 +0000
3298@@ -1,24 +1,24 @@
3299 # -*- coding: utf-8 -*-
3300 # vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4
3301
3302-###############################################################################
3303-# OpenLP - Open Source Lyrics Projection #
3304-# --------------------------------------------------------------------------- #
3305-# Copyright (c) 2008-2019 OpenLP Developers #
3306-# --------------------------------------------------------------------------- #
3307-# This program is free software; you can redistribute it and/or modify it #
3308-# under the terms of the GNU General Public License as published by the Free #
3309-# Software Foundation; version 2 of the License. #
3310-# #
3311-# This program is distributed in the hope that it will be useful, but WITHOUT #
3312-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or #
3313-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for #
3314-# more details. #
3315-# #
3316-# You should have received a copy of the GNU General Public License along #
3317-# with this program; if not, write to the Free Software Foundation, Inc., 59 #
3318-# Temple Place, Suite 330, Boston, MA 02111-1307 USA #
3319-###############################################################################
3320+##########################################################################
3321+# OpenLP - Open Source Lyrics Projection #
3322+# ---------------------------------------------------------------------- #
3323+# Copyright (c) 2008-2019 OpenLP Developers #
3324+# ---------------------------------------------------------------------- #
3325+# This program is free software: you can redistribute it and/or modify #
3326+# it under the terms of the GNU General Public License as published by #
3327+# the Free Software Foundation, either version 3 of the License, or #
3328+# (at your option) any later version. #
3329+# #
3330+# This program is distributed in the hope that it will be useful, #
3331+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
3332+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
3333+# GNU General Public License for more details. #
3334+# #
3335+# You should have received a copy of the GNU General Public License #
3336+# along with this program. If not, see <https://www.gnu.org/licenses/>. #
3337+##########################################################################
3338 """
3339 This class contains the core default settings.
3340 """
3341@@ -27,13 +27,14 @@
3342 import logging
3343 import os
3344 from enum import IntEnum
3345+from pathlib import Path
3346 from tempfile import gettempdir
3347
3348 from PyQt5 import QtCore, QtGui
3349
3350 from openlp.core.common import SlideLimits, ThemeLevel, is_linux, is_win
3351-from openlp.core.common.json import OpenLPJsonDecoder, OpenLPJsonEncoder
3352-from openlp.core.common.path import Path, files_to_paths, str_to_path
3353+from openlp.core.common.json import OpenLPJSONDecoder, OpenLPJSONEncoder, is_serializable
3354+from openlp.core.common.path import files_to_paths, str_to_path
3355
3356
3357 log = logging.getLogger(__name__)
3358@@ -177,14 +178,13 @@
3359 'api/thumbnails': True,
3360 'crashreport/last directory': None,
3361 'formattingTags/html_tags': '',
3362- 'core/audio repeat list': False,
3363 'core/auto open': False,
3364 'core/auto preview': False,
3365- 'core/audio start paused': True,
3366 'core/auto unblank': False,
3367 'core/click live slide to unblank': False,
3368 'core/blank warning': False,
3369 'core/ccli number': '',
3370+ 'advanced/experimental': False,
3371 'core/has run wizard': False,
3372 'core/language': '[en]',
3373 'core/last version test': '',
3374@@ -202,13 +202,16 @@
3375 'core/view mode': 'default',
3376 # The other display settings (display position and dimensions) are defined in the ScreenList class due to a
3377 # circular dependency.
3378- 'core/display on monitor': True,
3379+ 'core/display on monitor': False,
3380 'core/override position': False,
3381 'core/monitor': {},
3382 'core/application version': '0.0',
3383 'images/background color': '#000000',
3384- 'media/players': 'system,webkit',
3385- 'media/override player': QtCore.Qt.Unchecked,
3386+ 'media/media auto start': QtCore.Qt.Unchecked,
3387+ 'media/stream command': '',
3388+ 'media/vlc arguments': '',
3389+ 'media/video': '',
3390+ 'media/audio': '',
3391 'remotes/download version': '0.0',
3392 'players/background color': '#000000',
3393 'servicemanager/last directory': None,
3394@@ -311,7 +314,11 @@
3395 ('bibles/proxy name', '', []), # Just remove these bible proxy settings. They weren't used in 2.4!
3396 ('bibles/proxy address', '', []),
3397 ('bibles/proxy username', '', []),
3398- ('bibles/proxy password', '', [])
3399+ ('bibles/proxy password', '', []),
3400+ ('media/players', '', []),
3401+ ('media/override player', '', []),
3402+ ('core/audio start paused', '', []),
3403+ ('core/audio repeat list', '', [])
3404 ]
3405
3406 @staticmethod
3407@@ -330,7 +337,7 @@
3408
3409 Does not affect existing Settings objects.
3410
3411- :param openlp.core.common.path.Path ini_path: ini file path
3412+ :param Path ini_path: ini file path
3413 :rtype: None
3414 """
3415 Settings.__file_path__ = str(ini_path)
3416@@ -540,7 +547,7 @@
3417 old_values = [self._convert_value(old_value, default_value)
3418 for old_value, default_value in zip(old_values, default_values)]
3419 # Iterate over our rules and check what the old_value should be "converted" to.
3420- new_value = None
3421+ new_value = old_values[0]
3422 for new_rule, old_rule in rules:
3423 # If the value matches with the condition (rule), then use the provided value. This is used to
3424 # convert values. E. g. an old value 1 results in True, and 0 in False.
3425@@ -577,8 +584,9 @@
3426 :param value: The value to save
3427 :rtype: None
3428 """
3429- if isinstance(value, (Path, dict)) or (isinstance(value, list) and value and isinstance(value[0], Path)):
3430- value = json.dumps(value, cls=OpenLPJsonEncoder)
3431+ if is_serializable(value) or isinstance(value, dict) or \
3432+ (isinstance(value, list) and value and is_serializable(value[0])):
3433+ value = json.dumps(value, cls=OpenLPJSONEncoder)
3434 super().setValue(key, value)
3435
3436 def _convert_value(self, setting, default_value):
3437@@ -604,8 +612,8 @@
3438 elif isinstance(default_value, dict):
3439 return {}
3440 elif isinstance(setting, str):
3441- if '__Path__' in setting or setting.startswith('{'):
3442- return json.loads(setting, cls=OpenLPJsonDecoder)
3443+ if 'json_meta' in setting or '__Path__' in setting or setting.startswith('{'):
3444+ return json.loads(setting, cls=OpenLPJSONDecoder)
3445 # Convert the setting to the correct type.
3446 if isinstance(default_value, bool):
3447 if isinstance(setting, bool):
3448@@ -622,7 +630,7 @@
3449 """
3450 Export the settings to file.
3451
3452- :param openlp.core.common.path.Path dest_path: The file path to create the export file.
3453+ :param Path dest_path: The file path to create the export file.
3454 :return: Success
3455 :rtype: bool
3456 """
3457
3458=== modified file 'openlp/core/display/__init__.py'
3459--- openlp/core/display/__init__.py 2019-02-14 15:09:09 +0000
3460+++ openlp/core/display/__init__.py 2019-07-01 17:47:01 +0000
3461@@ -1,24 +1,24 @@
3462 # -*- coding: utf-8 -*-
3463 # vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4
3464
3465-###############################################################################
3466-# OpenLP - Open Source Lyrics Projection #
3467-# --------------------------------------------------------------------------- #
3468-# Copyright (c) 2008-2019 OpenLP Developers #
3469-# --------------------------------------------------------------------------- #
3470-# This program is free software; you can redistribute it and/or modify it #
3471-# under the terms of the GNU General Public License as published by the Free #
3472-# Software Foundation; version 2 of the License. #
3473-# #
3474-# This program is distributed in the hope that it will be useful, but WITHOUT #
3475-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or #
3476-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for #
3477-# more details. #
3478-# #
3479-# You should have received a copy of the GNU General Public License along #
3480-# with this program; if not, write to the Free Software Foundation, Inc., 59 #
3481-# Temple Place, Suite 330, Boston, MA 02111-1307 USA #
3482-###############################################################################
3483+##########################################################################
3484+# OpenLP - Open Source Lyrics Projection #
3485+# ---------------------------------------------------------------------- #
3486+# Copyright (c) 2008-2019 OpenLP Developers #
3487+# ---------------------------------------------------------------------- #
3488+# This program is free software: you can redistribute it and/or modify #
3489+# it under the terms of the GNU General Public License as published by #
3490+# the Free Software Foundation, either version 3 of the License, or #
3491+# (at your option) any later version. #
3492+# #
3493+# This program is distributed in the hope that it will be useful, #
3494+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
3495+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
3496+# GNU General Public License for more details. #
3497+# #
3498+# You should have received a copy of the GNU General Public License #
3499+# along with this program. If not, see <https://www.gnu.org/licenses/>. #
3500+##########################################################################
3501 """
3502 The :mod:`~openlp.core.display` module contains all the code related to rendering and output
3503 """
3504
3505=== added file 'openlp/core/display/html/display.css'
3506--- openlp/core/display/html/display.css 1970-01-01 00:00:00 +0000
3507+++ openlp/core/display/html/display.css 2019-07-01 17:47:01 +0000
3508@@ -0,0 +1,80 @@
3509+@keyframes alert-scrolling-text {
3510+ 0% { transform: translateX(100%); opacity: 1; }
3511+ 99% { opacity: 1; }
3512+ 100% { transform: translateX(-101%); opacity: 0;}
3513+}
3514+
3515+/* ALERT BACKGROUND STYLING */
3516+.bg-default {
3517+ position: absolute;
3518+ margin: 0;
3519+ padding: 0;
3520+ left: 0;
3521+ z-index: 11;
3522+ width: 100%;
3523+ height: 0;
3524+ min-height: 0;
3525+ overflow: hidden;
3526+ transform: translate(0,0);
3527+ transition: min-height 1s ease-out .5s;
3528+ white-space: nowrap;
3529+ display: flex;
3530+ flex-direction: row;
3531+ align-items: center;
3532+ /* align-content: center; */
3533+}
3534+
3535+.bg-default span {
3536+ display: inline-block;
3537+ padding-left: 120%;
3538+}
3539+
3540+.show-bg {
3541+ /* height: auto; */
3542+ min-height: 25%;
3543+ transition: min-height 1s ease-in .5s;
3544+}
3545+
3546+.middle {
3547+ align-items: center;
3548+}
3549+
3550+.alert-container {
3551+ position: absolute;
3552+ display: flex;
3553+ flex-direction: row;
3554+ height: 100vh;
3555+ width: 100vw;
3556+}
3557+
3558+.top {
3559+ align-items: flex-start;
3560+}
3561+
3562+.bottom {
3563+ align-items: flex-end;
3564+}
3565+
3566+/* ALERT TEXT STYLING */
3567+#alert {
3568+ z-index: 100;
3569+ overflow: visible;
3570+ color: #ffffff;
3571+ font-size: 40pt;
3572+ padding: 0;
3573+ margin: 0;
3574+ opacity: 0;
3575+ transition: opacity .5s linear;
3576+}
3577+
3578+#alert.hide-text {
3579+ opacity: 0;
3580+}
3581+
3582+#alert.show-text {
3583+ transform: none;
3584+ transition: none;
3585+ animation: none;
3586+ padding: auto 5px;
3587+ opacity: 1;
3588+}
3589
3590=== modified file 'openlp/core/display/html/display.html'
3591--- openlp/core/display/html/display.html 2018-10-12 19:51:51 +0000
3592+++ openlp/core/display/html/display.html 2019-07-01 17:47:01 +0000
3593@@ -2,11 +2,11 @@
3594 <html>
3595 <head>
3596 <title>Display Window</title>
3597- <link href="reveal.css" rel="stylesheet">
3598+ <link href="reveal.css" rel="stylesheet">
3599 <style type="text/css">
3600 body {
3601 background: transparent !important;
3602- color: #fff !important;
3603+ color: rgb(255, 255, 255) !important;
3604 }
3605 sup {
3606 vertical-align: super !important;
3607@@ -24,16 +24,21 @@
3608 visibility: visible;
3609 z-index: -1;
3610 }
3611- </style>
3612+ </style>
3613+ <link rel="stylesheet" type="text/css" href="display.css"></link>
3614 <script type="text/javascript" src="qrc:///qtwebchannel/qwebchannel.js"></script>
3615 <script type="text/javascript" src="reveal.js"></script>
3616 <script type="text/javascript" src="display.js"></script>
3617 </head>
3618+
3619 <body>
3620+ <div class="alert-container">
3621+ <div id="alert-background" class="bg-default"><span id="alert">Testing alerts</span></div>
3622+ </div>
3623 <div class="reveal">
3624- <div id="global-background" class="slide-background present" data-loaded="true"></div>
3625+ <div id="global-background" class="slide-background present" data-loaded="true"></div>
3626 <div class="slides"></div>
3627 <div class="footer"></div>
3628- </div>
3629+ </div>
3630 </body>
3631 </html>
3632
3633=== modified file 'openlp/core/display/html/display.js'
3634--- openlp/core/display/html/display.js 2019-02-05 21:26:30 +0000
3635+++ openlp/core/display/html/display.js 2019-07-01 17:47:01 +0000
3636@@ -53,6 +53,50 @@
3637 };
3638
3639 /**
3640+ * Transition state enumeration
3641+ */
3642+var TransitionState = {
3643+ EntranceTransition: "entranceTransition",
3644+ NoTransition: "noTransition",
3645+ ExitTransition: "exitTransition"
3646+};
3647+
3648+/**
3649+ * Animation state enumeration
3650+ */
3651+var AnimationState = {
3652+ NoAnimation: "noAnimation",
3653+ ScrollingText: "scrollingText",
3654+ NonScrollingText: "noScrollingText"
3655+};
3656+
3657+/**
3658+ * Alert location enumeration
3659+ */
3660+var AlertLocation = {
3661+ Top: 0,
3662+ Middle: 1,
3663+ Bottom: 2
3664+};
3665+
3666+/**
3667+ * Alert state enumeration
3668+ */
3669+var AlertState = {
3670+ Displaying: "displaying",
3671+ NotDisplaying: "notDisplaying"
3672+}
3673+
3674+/**
3675+ * Alert delay enumeration
3676+ */
3677+var AlertDelay = {
3678+ FiftyMilliseconds: 50,
3679+ OneSecond: 1000,
3680+ OnePointFiveSeconds: 1500
3681+}
3682+
3683+/**
3684 * Return an array of elements based on the selector query
3685 * @param {string} selector - The selector to find elements
3686 * @returns {array} An array of matching elements
3687@@ -118,20 +162,6 @@
3688 }
3689
3690 /**
3691- * The paths we get are JSON versions of Python Path objects, so let's just fix that.
3692- * @private
3693- * @param {object} path - The Path object
3694- * @returns {string} The actual file path
3695- */
3696-function _pathToString(path) {
3697- var filename = path.__Path__.join("/").replace("//", "/");
3698- if (!filename.startsWith("/")) {
3699- filename = "/" + filename;
3700- }
3701- return filename;
3702-}
3703-
3704-/**
3705 * An audio player with a play list
3706 */
3707 var AudioPlayer = function (audioElement) {
3708@@ -248,7 +278,12 @@
3709 * The Display object is what we use from OpenLP
3710 */
3711 var Display = {
3712+ _alerts: [],
3713 _slides: {},
3714+ _alertSettings: {},
3715+ _alertState: AlertState.NotDisplaying,
3716+ _transitionState: TransitionState.NoTransition,
3717+ _animationState: AnimationState.NoAnimation,
3718 _revealConfig: {
3719 margin: 0.0,
3720 minScale: 1.0,
3721@@ -315,7 +350,7 @@
3722 section.setAttribute("style", "height: 100%; width: 100%; position: relative;");
3723 var img = document.createElement('img');
3724 img.src = image;
3725- img.setAttribute("style", "position: absolute; top: 0; bottom: 0; left: 0; right: 0; margin: auto;");
3726+ img.setAttribute("style", "position: absolute; top: 0; bottom: 0; left: 0; right: 0; margin: auto; max-height: 100%; max-width: 100%");
3727 section.appendChild(img);
3728 slidesDiv.appendChild(section);
3729 Display._slides['0'] = 0;
3730@@ -370,19 +405,197 @@
3731 /**
3732 * Display an alert
3733 * @param {string} text - The alert text
3734- * @param {int} location - The location of the text (top, middle or bottom)
3735- */
3736- alert: function (text, location) {
3737- console.debug(" alert text: " + text, ", location: " + location);
3738- /*
3739- * The implementation should show an alert.
3740- * It should be able to handle receiving a new alert before a previous one is "finished", basically queueing it.
3741- */
3742- return;
3743-},
3744-
3745- /**
3746- * Add a slides. If the slide exists but the HTML is different, update the slide.
3747+ * @param {string} JSON object - The settings for the alert object e.g '{"backgroundColor": "rgb(255, 85, 0)",
3748+ * "location": 1, "fontFace": "Open Sans Condensed", "fontSize": 90, "fontColor": "rgb(255, 255, 255)",
3749+ * "timeout": 10, "repeat": 2, "scroll": true}'
3750+ */
3751+ alert: function (text, alertSettings) {
3752+ var alertBackground = $('#alert-background')[0];
3753+ var alertText = $('#alert')[0];
3754+ if (text == "") {
3755+ return null;
3756+ }
3757+ else {
3758+ if (this._alertState === AlertState.Displaying) {
3759+ Display.addAlertToQueue(text, alert_settings);
3760+ }
3761+ }
3762+ var settings = JSON.parse(alertSettings);
3763+ this._alertSettings = settings;
3764+ Display.setAlertText(text, settings.fontColor, settings.fontFace, settings.fontSize);
3765+ Display.setAlertLocation(settings.location);
3766+ /* Check if the alert is a queued alert */
3767+ if (Display._alertState !== AlertState.DisplayingFromQueue) {
3768+ Display._alertState = AlertState.Displaying;
3769+ }
3770+
3771+ alertBackground.addEventListener('transitionend', Display.alertTransitionEndEvent, false);
3772+ alertText.addEventListener('animationend', Display.alertAnimationEndEvent, false);
3773+
3774+ Display.showAlertBackground(settings.backgroundColor);
3775+ },
3776+ /**
3777+ * Add an alert to the alert queue
3778+ * @param {string} text - The alert text to be displayed
3779+ * @param {string} setttings - JSON object containing the settings for the alert
3780+ */
3781+ addAlertToQueue: function (text, settings) {
3782+ var alertObject = {text: text, settings: settings};
3783+ this._alerts.push(JSON.stringify(alertObject));
3784+ return null;
3785+ },
3786+ /**
3787+ * Set Alert Text
3788+ * @param {string} text - The alert text to display
3789+ */
3790+ setAlertText: function (text, color, fontFace, fontSize) {
3791+ var alertText = $("#alert")[0];
3792+ alertText.textContent = text;
3793+ alertText.style.color = color;
3794+ alertText.style.fontFamily = fontFace;
3795+ alertText.style.fontSize = fontSize + "pt";
3796+ },
3797+ /**
3798+ * The alertTransitionEndEvent called after a transition has ended
3799+ */
3800+ alertTransitionEndEvent: function (e) {
3801+ e.stopPropagation();
3802+ console.debug("Transition end event reached");
3803+ if (Display._transitionState === TransitionState.EntranceTransition) {
3804+ Display._transitionState = TransitionState.NoTransition;
3805+ Display.showAlertText(Display._alertSettings);
3806+ }
3807+ else if (Display._transitionState === TransitionState.ExitTransition) {
3808+ Display._transitionState = TransitionState.NoTransition;
3809+ Display.removeAlertLocation(Display._alertSettings.location);
3810+ Display.clearAlertSettings();
3811+ setTimeout(function () {
3812+ Display.showNextAlert();
3813+ }, AlertDelay.OnePointFiveSeconds);
3814+
3815+ }
3816+ },
3817+ /**
3818+ * The alertAnimationEndEvent called after an animation has ended
3819+ */
3820+ alertAnimationEndEvent: function (e) {
3821+ e.stopPropagation();
3822+ Display.hideAlertText();
3823+ },
3824+ /**
3825+ * Start background entrance transition for display of alert
3826+ * @param {string} hex_color - The background color of the alert
3827+ */
3828+ showAlertBackground: function (bg_color) {
3829+ var alertBackground = $("#alert-background")[0];
3830+ alertBackground.classList.add("show-bg");
3831+ alertBackground.style.backgroundColor = bg_color;
3832+ this._transitionState = TransitionState.EntranceTransition;
3833+ },
3834+ /**
3835+ * Set the location of the alert
3836+ * @param {int} location - Integer number with the location of the alert on screen
3837+ */
3838+ setAlertLocation: function (location) {
3839+ var alertContainer = $(".alert-container")[0];
3840+
3841+ switch (location) {
3842+ case AlertLocation.Top:
3843+ alertContainer.classList.add("top");
3844+ break;
3845+ case AlertLocation.Middle:
3846+ alertContainer.classList.add("middle");
3847+ break;
3848+ case AlertLocation.Bottom:
3849+ default:
3850+ alertContainer.classList.add("bottom");
3851+ break;
3852+ }
3853+ },
3854+ /**
3855+ * Remove the location class set after displaying the alert
3856+ * @param {int} location - Integer number with the location of the alert on screen
3857+ */
3858+ removeAlertLocation: function (location) {
3859+ var alertContainer = $(".alert-container")[0];
3860+ console.debug("The value of location for removal is: " + location);
3861+
3862+ switch (location) {
3863+ case AlertLocation.Top:
3864+ alertContainer.classList.remove("top");
3865+ break;
3866+ case AlertLocation.Middle:
3867+ alertContainer.classList.remove("middle");
3868+ break;
3869+ case AlertLocation.Bottom:
3870+ default:
3871+ alertContainer.classList.remove("bottom");
3872+ break;
3873+ }
3874+ },
3875+ /**
3876+ * Hide the alert background after the alert has been shown
3877+ */
3878+ hideAlertBackground: function () {
3879+ var alertBackground = $("#alert-background")[0];
3880+ alertBackground.classList.remove("show-bg");
3881+ this._transitionState = TransitionState.ExitTransition;
3882+ this._alertState = AlertState.NotDisplaying;
3883+ },
3884+ /**
3885+ * Sets the alert text styles correctly after the entrance transition has ended.
3886+ * @param {json} settings object - The settings to use for the animation
3887+ */
3888+ showAlertText: function (settings) {
3889+ var alertText = $("#alert")[0];
3890+
3891+ if (settings.scroll) {
3892+ var animationSettings = "alert-scrolling-text " + settings.timeout +
3893+ "s linear 0.6s " + settings.repeat + " normal";
3894+ alertText.style.animation = animationSettings;
3895+ Display._animationState = AnimationState.ScrollingText;
3896+ }
3897+ else {
3898+ Display._animationState = AnimationState.NonScrollingText;
3899+ alertText.classList.add("show-text");
3900+ setTimeout (function () {
3901+ Display._animationState = AnimationState.NoAnimation;
3902+ alertText.classList.add("hide-text");
3903+ alertText.classList.remove("show-text");
3904+ Display.hideAlertText();
3905+ }, settings.timeout * AlertDelay.OneSecond);
3906+ }
3907+ },
3908+ /**
3909+ * Reset styling and hide the alert text after displaying the animation
3910+ */
3911+ hideAlertText: function () {
3912+ var alertText = $('#alert')[0];
3913+ Display._animationState = AnimationState.NoAnimation;
3914+ alertText.style.animation = "";
3915+ Display.hideAlertBackground();
3916+ },
3917+ /**
3918+ * Display the next alert in the queue
3919+ */
3920+ showNextAlert: function () {
3921+ if (Display._alerts.length > 0) {
3922+ var alertObject = JSON.parse(this._alerts.shift());
3923+ this._alertState = AlertState.DisplayingFromQueue;
3924+ Display.alert(alertObject.text, alertObject.settings);
3925+ }
3926+ else {
3927+ return null;
3928+ }
3929+ },
3930+ /**
3931+ * Clears the alert settings after displaying an alert
3932+ */
3933+ clearAlertSettings: function () {
3934+ this._alertSettings = {};
3935+ },
3936+ /**
3937+ * Add a slide. If the slide exists but the HTML is different, update the slide.
3938 * @param {string} verse - The verse number, e.g. "v1"
3939 * @param {string} text - The HTML for the verse, e.g. "line1<br>line2"
3940 * @param {string} footer_text - The HTML for the footer"
3941@@ -676,13 +889,13 @@
3942 }
3943 break;
3944 case BackgroundType.Image:
3945- background_filename = _pathToString(theme.background_filename);
3946- backgroundStyle["background-image"] = "url('file://" + background_filename + "')";
3947+ backgroundStyle["background-image"] = "url('" + theme.background_filename + "')";
3948+ console.warn(backgroundStyle["background-image"]);
3949 break;
3950 case BackgroundType.Video:
3951- background_filename = _pathToString(theme.background_filename);
3952 backgroundStyle["background-color"] = theme.background_border_color;
3953- backgroundHtml = "<video loop autoplay muted><source src='file://" + background_filename + "'></video>";
3954+ backgroundHtml = "<video loop autoplay muted><source src='" + theme.background_filename + "'></video>";
3955+ console.warn(backgroundHtml);
3956 break;
3957 default:
3958 backgroundStyle["background"] = "#000";
3959
3960=== modified file 'openlp/core/display/html/reveal.js'
3961--- openlp/core/display/html/reveal.js 2019-02-11 20:34:20 +0000
3962+++ openlp/core/display/html/reveal.js 2019-07-01 17:47:01 +0000
3963@@ -3,7 +3,7 @@
3964 * http://revealjs.com
3965 * MIT licensed
3966 *
3967- * Copyright (C) 2018 Hakim El Hattab, http://hakim.se
3968+ * Copyright (C) 2019 Hakim El Hattab, http://hakim.se
3969 */
3970 (function( root, factory ) {
3971 if( typeof define === 'function' && define.amd ) {
3972@@ -26,7 +26,7 @@
3973 var Reveal;
3974
3975 // The reveal.js version
3976- var VERSION = '3.7.0';
3977+ var VERSION = '3.8.0';
3978
3979 var SLIDES_SELECTOR = '.slides section',
3980 HORIZONTAL_SLIDES_SELECTOR = '.slides>section',
3981@@ -67,16 +67,36 @@
3982 progress: true,
3983
3984 // Display the page number of the current slide
3985+ // - true: Show slide number
3986+ // - false: Hide slide number
3987+ //
3988+ // Can optionally be set as a string that specifies the number formatting:
3989+ // - "h.v": Horizontal . vertical slide number (default)
3990+ // - "h/v": Horizontal / vertical slide number
3991+ // - "c": Flattened slide number
3992+ // - "c/t": Flattened slide number / total slides
3993+ //
3994+ // Alternatively, you can provide a function that returns the slide
3995+ // number for the current slide. The function needs to return an array
3996+ // with one string [slideNumber] or three strings [n1,delimiter,n2].
3997+ // See #formatSlideNumber().
3998 slideNumber: false,
3999
4000+ // Can be used to limit the contexts in which the slide number appears
4001+ // - "all": Always show the slide number
4002+ // - "print": Only when printing to PDF
4003+ // - "speaker": Only in the speaker view
4004+ showSlideNumber: 'all',
4005+
4006 // Use 1 based indexing for # links to match slide number (default is zero
4007 // based)
4008 hashOneBasedIndex: false,
4009
4010- // Determine which displays to show the slide number on
4011- showSlideNumber: 'all',
4012+ // Add the current slide number to the URL hash so that reloading the
4013+ // page/copying the URL will return you to the same slide
4014+ hash: false,
4015
4016- // Push each slide change to the browser history
4017+ // Push each slide change to the browser history. Implies `hash: true`
4018 history: false,
4019
4020 // Enable keyboard shortcuts for navigation
4021@@ -104,6 +124,32 @@
4022 // Change the presentation direction to be RTL
4023 rtl: false,
4024
4025+ // Changes the behavior of our navigation directions.
4026+ //
4027+ // "default"
4028+ // Left/right arrow keys step between horizontal slides, up/down
4029+ // arrow keys step between vertical slides. Space key steps through
4030+ // all slides (both horizontal and vertical).
4031+ //
4032+ // "linear"
4033+ // Removes the up/down arrows. Left/right arrows step through all
4034+ // slides (both horizontal and vertical).
4035+ //
4036+ // "grid"
4037+ // When this is enabled, stepping left/right from a vertical stack
4038+ // to an adjacent vertical stack will land you at the same vertical
4039+ // index.
4040+ //
4041+ // Consider a deck with six slides ordered in two vertical stacks:
4042+ // 1.1 2.1
4043+ // 1.2 2.2
4044+ // 1.3 2.3
4045+ //
4046+ // If you're on slide 1.3 and navigate right, you will normally move
4047+ // from 1.3 -> 2.1. If "grid" is used, the same navigation takes you
4048+ // from 1.3 -> 2.3.
4049+ navigationMode: 'default',
4050+
4051 // Randomizes the order of slides each time the presentation loads
4052 shuffle: false,
4053
4054@@ -134,6 +180,13 @@
4055 // - false: No media will autoplay, regardless of individual setting
4056 autoPlayMedia: null,
4057
4058+ // Global override for preloading lazy-loaded iframes
4059+ // - null: Iframes with data-src AND data-preload will be loaded when within
4060+ // the viewDistance, iframes with only data-src will be loaded when visible
4061+ // - true: All iframes with data-src will be loaded when within the viewDistance
4062+ // - false: All iframes with data-src will be loaded only when visible
4063+ preloadIframes: null,
4064+
4065 // Controls automatic progression to the next slide
4066 // - 0: Auto-sliding only happens if the data-autoslide HTML attribute
4067 // is present on the current slide or fragment
4068@@ -220,6 +273,12 @@
4069 // The display mode that will be used to show slides
4070 display: 'block',
4071
4072+ // Hide cursor if inactive
4073+ hideInactiveCursor: true,
4074+
4075+ // Time before the cursor is hidden (in ms)
4076+ hideCursorTime: 5000,
4077+
4078 // Script dependencies to load
4079 dependencies: []
4080
4081@@ -267,6 +326,12 @@
4082 // Cached references to DOM elements
4083 dom = {},
4084
4085+ // A list of registered reveal.js plugins
4086+ plugins = {},
4087+
4088+ // List of asynchronously loaded reveal.js dependencies
4089+ asyncDependencies = [],
4090+
4091 // Features supported by the browser, see #checkCapabilities()
4092 features = {},
4093
4094@@ -282,6 +347,12 @@
4095 // Delays updates to the URL due to a Chrome thumbnailer bug
4096 writeURLTimeout = 0,
4097
4098+ // Is the mouse pointer currently hidden from view
4099+ cursorHidden = false,
4100+
4101+ // Timeout used to determine when the cursor is inactive
4102+ cursorInactiveTimeout = 0,
4103+
4104 // Flags if the interaction event listeners are bound
4105 eventsAreBound = false,
4106
4107@@ -298,26 +369,14 @@
4108 touch = {
4109 startX: 0,
4110 startY: 0,
4111- startSpan: 0,
4112 startCount: 0,
4113 captured: false,
4114 threshold: 40
4115 },
4116
4117- // Holds information about the keyboard shortcuts
4118- keyboardShortcuts = {
4119- 'N , SPACE': 'Next slide',
4120- 'P': 'Previous slide',
4121- '&#8592; , H': 'Navigate left',
4122- '&#8594; , L': 'Navigate right',
4123- '&#8593; , K': 'Navigate up',
4124- '&#8595; , J': 'Navigate down',
4125- 'Home': 'First slide',
4126- 'End': 'Last slide',
4127- 'B , .': 'Pause',
4128- 'F': 'Fullscreen',
4129- 'ESC, O': 'Slide overview'
4130- },
4131+ // A key:value map of shortcut keyboard keys and descriptions of
4132+ // the actions they trigger, generated in #configure()
4133+ keyboardShortcuts = {},
4134
4135 // Holds custom key code mappings
4136 registeredKeyBindings = {};
4137@@ -377,7 +436,7 @@
4138 // Hide the address bar in mobile browsers
4139 hideAddressBar();
4140
4141- // Loads the dependencies and continues to #start() once done
4142+ // Loads dependencies and continues to #start() once done
4143 load();
4144
4145 }
4146@@ -440,57 +499,148 @@
4147 function load() {
4148
4149 var scripts = [],
4150- scriptsAsync = [],
4151- scriptsToPreload = 0;
4152-
4153- // Called once synchronous scripts finish loading
4154- function proceed() {
4155- if( scriptsAsync.length ) {
4156- // Load asynchronous scripts
4157- head.js.apply( null, scriptsAsync );
4158- }
4159-
4160- start();
4161- }
4162-
4163- function loadScript( s ) {
4164- head.ready( s.src.match( /([\w\d_\-]*)\.?js(\?[\w\d.=&]*)?$|[^\\\/]*$/i )[0], function() {
4165- // Extension may contain callback functions
4166- if( typeof s.callback === 'function' ) {
4167- s.callback.apply( this );
4168- }
4169-
4170- if( --scriptsToPreload === 0 ) {
4171- proceed();
4172- }
4173- });
4174- }
4175-
4176- for( var i = 0, len = config.dependencies.length; i < len; i++ ) {
4177- var s = config.dependencies[i];
4178-
4179+ scriptsToLoad = 0;
4180+
4181+ config.dependencies.forEach( function( s ) {
4182 // Load if there's no condition or the condition is truthy
4183 if( !s.condition || s.condition() ) {
4184 if( s.async ) {
4185- scriptsAsync.push( s.src );
4186+ asyncDependencies.push( s );
4187 }
4188 else {
4189- scripts.push( s.src );
4190+ scripts.push( s );
4191 }
4192-
4193- loadScript( s );
4194 }
4195- }
4196+ } );
4197
4198 if( scripts.length ) {
4199- scriptsToPreload = scripts.length;
4200+ scriptsToLoad = scripts.length;
4201
4202 // Load synchronous scripts
4203- head.js.apply( null, scripts );
4204- }
4205- else {
4206- proceed();
4207- }
4208+ scripts.forEach( function( s ) {
4209+ loadScript( s.src, function() {
4210+
4211+ if( typeof s.callback === 'function' ) s.callback();
4212+
4213+ if( --scriptsToLoad === 0 ) {
4214+ initPlugins();
4215+ }
4216+
4217+ } );
4218+ } );
4219+ }
4220+ else {
4221+ initPlugins();
4222+ }
4223+
4224+ }
4225+
4226+ /**
4227+ * Initializes our plugins and waits for them to be ready
4228+ * before proceeding.
4229+ */
4230+ function initPlugins() {
4231+
4232+ var pluginsToInitialize = Object.keys( plugins ).length;
4233+
4234+ // If there are no plugins, skip this step
4235+ if( pluginsToInitialize === 0 ) {
4236+ loadAsyncDependencies();
4237+ }
4238+ // ... otherwise initialize plugins
4239+ else {
4240+
4241+ var afterPlugInitialized = function() {
4242+ if( --pluginsToInitialize === 0 ) {
4243+ loadAsyncDependencies();
4244+ }
4245+ };
4246+
4247+ for( var i in plugins ) {
4248+
4249+ var plugin = plugins[i];
4250+
4251+ // If the plugin has an 'init' method, invoke it
4252+ if( typeof plugin.init === 'function' ) {
4253+ var callback = plugin.init();
4254+
4255+ // If the plugin returned a Promise, wait for it
4256+ if( callback && typeof callback.then === 'function' ) {
4257+ callback.then( afterPlugInitialized );
4258+ }
4259+ else {
4260+ afterPlugInitialized();
4261+ }
4262+ }
4263+ else {
4264+ afterPlugInitialized();
4265+ }
4266+
4267+ }
4268+
4269+ }
4270+
4271+ }
4272+
4273+ /**
4274+ * Loads all async reveal.js dependencies.
4275+ */
4276+ function loadAsyncDependencies() {
4277+
4278+ if( asyncDependencies.length ) {
4279+ asyncDependencies.forEach( function( s ) {
4280+ loadScript( s.src, s.callback );
4281+ } );
4282+ }
4283+
4284+ start();
4285+
4286+ }
4287+
4288+ /**
4289+ * Loads a JavaScript file from the given URL and executes it.
4290+ *
4291+ * @param {string} url Address of the .js file to load
4292+ * @param {function} callback Method to invoke when the script
4293+ * has loaded and executed
4294+ */
4295+ function loadScript( url, callback ) {
4296+
4297+ var script = document.createElement( 'script' );
4298+ script.type = 'text/javascript';
4299+ script.async = false;
4300+ script.defer = false;
4301+ script.src = url;
4302+
4303+ if( callback ) {
4304+
4305+ // Success callback
4306+ script.onload = script.onreadystatechange = function( event ) {
4307+ if( event.type === "load" || (/loaded|complete/.test( script.readyState ) ) ) {
4308+
4309+ // Kill event listeners
4310+ script.onload = script.onreadystatechange = script.onerror = null;
4311+
4312+ callback();
4313+
4314+ }
4315+ };
4316+
4317+ // Error callback
4318+ script.onerror = function( err ) {
4319+
4320+ // Kill event listeners
4321+ script.onload = script.onreadystatechange = script.onerror = null;
4322+
4323+ callback( new Error( 'Failed loading script: ' + script.src + '\n' + err) );
4324+
4325+ };
4326+
4327+ }
4328+
4329+ // Append the script at the end of <head>
4330+ var head = document.querySelector( 'head' );
4331+ head.insertBefore( script, head.lastChild );
4332
4333 }
4334
4335@@ -601,8 +751,7 @@
4336 dom.speakerNotes.setAttribute( 'tabindex', '0' );
4337
4338 // Overlay graphic which is displayed during the paused mode
4339- dom.pauseOverlay = createSingletonNode( dom.wrapper, 'div', 'pause-overlay', '<button class="resume-button">Resume presentation</button>' );
4340- dom.resumeButton = dom.pauseOverlay.querySelector( '.resume-button' );
4341+ dom.pauseOverlay = createSingletonNode( dom.wrapper, 'div', 'pause-overlay', config.controls ? '<button class="resume-button">Resume presentation</button>' : null );
4342
4343 dom.wrapper.setAttribute( 'role', 'application' );
4344
4345@@ -1082,18 +1231,27 @@
4346 if( data.backgroundPosition ) contentElement.style.backgroundPosition = data.backgroundPosition;
4347 if( data.backgroundOpacity ) contentElement.style.opacity = data.backgroundOpacity;
4348
4349- // If this slide has a background color, add a class that
4350+ // If this slide has a background color, we add a class that
4351 // signals if it is light or dark. If the slide has no background
4352- // color, no class will be set
4353- var computedBackgroundStyle = window.getComputedStyle( element );
4354- if( computedBackgroundStyle && computedBackgroundStyle.backgroundColor ) {
4355- var rgb = colorToRgb( computedBackgroundStyle.backgroundColor );
4356+ // color, no class will be added
4357+ var contrastColor = data.backgroundColor;
4358+
4359+ // If no bg color was found, check the computed background
4360+ if( !contrastColor ) {
4361+ var computedBackgroundStyle = window.getComputedStyle( element );
4362+ if( computedBackgroundStyle && computedBackgroundStyle.backgroundColor ) {
4363+ contrastColor = computedBackgroundStyle.backgroundColor;
4364+ }
4365+ }
4366+
4367+ if( contrastColor ) {
4368+ var rgb = colorToRgb( contrastColor );
4369
4370 // Ignore fully transparent backgrounds. Some browsers return
4371 // rgba(0,0,0,0) when reading the computed background color of
4372 // an element with no background
4373 if( rgb && rgb.a !== 0 ) {
4374- if( colorBrightness( computedBackgroundStyle.backgroundColor ) < 128 ) {
4375+ if( colorBrightness( contrastColor ) < 128 ) {
4376 slide.classList.add( 'has-dark-background' );
4377 }
4378 else {
4379@@ -1216,6 +1374,18 @@
4380 disableRollingLinks();
4381 }
4382
4383+ // Auto-hide the mouse pointer when its inactive
4384+ if( config.hideInactiveCursor ) {
4385+ document.addEventListener( 'mousemove', onDocumentCursorActive, false );
4386+ document.addEventListener( 'mousedown', onDocumentCursorActive, false );
4387+ }
4388+ else {
4389+ showCursor();
4390+
4391+ document.removeEventListener( 'mousemove', onDocumentCursorActive, false );
4392+ document.removeEventListener( 'mousedown', onDocumentCursorActive, false );
4393+ }
4394+
4395 // Iframe link previews
4396 if( config.previewLinks ) {
4397 enablePreviewLinks();
4398@@ -1263,6 +1433,34 @@
4399
4400 dom.slideNumber.style.display = slideNumberDisplay;
4401
4402+ // Add the navigation mode to the DOM so we can adjust styling
4403+ if( config.navigationMode !== 'default' ) {
4404+ dom.wrapper.setAttribute( 'data-navigation-mode', config.navigationMode );
4405+ }
4406+ else {
4407+ dom.wrapper.removeAttribute( 'data-navigation-mode' );
4408+ }
4409+
4410+ // Define our contextual list of keyboard shortcuts
4411+ if( config.navigationMode === 'linear' ) {
4412+ keyboardShortcuts['&#8594; , &#8595; , SPACE , N , L , J'] = 'Next slide';
4413+ keyboardShortcuts['&#8592; , &#8593; , P , H , K'] = 'Previous slide';
4414+ }
4415+ else {
4416+ keyboardShortcuts['N , SPACE'] = 'Next slide';
4417+ keyboardShortcuts['P'] = 'Previous slide';
4418+ keyboardShortcuts['&#8592; , H'] = 'Navigate left';
4419+ keyboardShortcuts['&#8594; , L'] = 'Navigate right';
4420+ keyboardShortcuts['&#8593; , K'] = 'Navigate up';
4421+ keyboardShortcuts['&#8595; , J'] = 'Navigate down';
4422+ }
4423+
4424+ keyboardShortcuts['Home , &#8984;/CTRL &#8592;'] = 'First slide';
4425+ keyboardShortcuts['End , &#8984;/CTRL &#8594;'] = 'Last slide';
4426+ keyboardShortcuts['B , .'] = 'Pause';
4427+ keyboardShortcuts['F'] = 'Fullscreen';
4428+ keyboardShortcuts['ESC, O'] = 'Slide overview';
4429+
4430 sync();
4431
4432 }
4433@@ -1307,7 +1505,7 @@
4434 dom.progress.addEventListener( 'click', onProgressClicked, false );
4435 }
4436
4437- dom.resumeButton.addEventListener( 'click', resume, false );
4438+ dom.pauseOverlay.addEventListener( 'click', resume, false );
4439
4440 if( config.focusBodyOnPageVisibilityChange ) {
4441 var visibilityChange;
4442@@ -1372,7 +1570,7 @@
4443 dom.wrapper.removeEventListener( 'touchmove', onTouchMove, false );
4444 dom.wrapper.removeEventListener( 'touchend', onTouchEnd, false );
4445
4446- dom.resumeButton.removeEventListener( 'click', resume, false );
4447+ dom.pauseOverlay.removeEventListener( 'click', resume, false );
4448
4449 if ( config.progress && dom.progress ) {
4450 dom.progress.removeEventListener( 'click', onProgressClicked, false );
4451@@ -1390,6 +1588,53 @@
4452 }
4453
4454 /**
4455+ * Registers a new plugin with this reveal.js instance.
4456+ *
4457+ * reveal.js waits for all regisered plugins to initialize
4458+ * before considering itself ready, as long as the plugin
4459+ * is registered before calling `Reveal.initialize()`.
4460+ */
4461+ function registerPlugin( id, plugin ) {
4462+
4463+ if( plugins[id] === undefined ) {
4464+ plugins[id] = plugin;
4465+
4466+ // If a plugin is registered after reveal.js is loaded,
4467+ // initialize it right away
4468+ if( loaded && typeof plugin.init === 'function' ) {
4469+ plugin.init();
4470+ }
4471+ }
4472+ else {
4473+ console.warn( 'reveal.js: "'+ id +'" plugin has already been registered' );
4474+ }
4475+
4476+ }
4477+
4478+ /**
4479+ * Checks if a specific plugin has been registered.
4480+ *
4481+ * @param {String} id Unique plugin identifier
4482+ */
4483+ function hasPlugin( id ) {
4484+
4485+ return !!plugins[id];
4486+
4487+ }
4488+
4489+ /**
4490+ * Returns the specific plugin instance, if a plugin
4491+ * with the given ID has been registered.
4492+ *
4493+ * @param {String} id Unique plugin identifier
4494+ */
4495+ function getPlugin( id ) {
4496+
4497+ return plugins[id];
4498+
4499+ }
4500+
4501+ /**
4502 * Add a custom key binding with optional description to
4503 * be added to the help screen.
4504 */
4505@@ -1677,11 +1922,19 @@
4506 // Change the .stretch element height to 0 in order find the height of all
4507 // the other elements
4508 element.style.height = '0px';
4509+
4510+ // In Overview mode, the parent (.slide) height is set of 700px.
4511+ // Restore it temporarily to its natural height.
4512+ element.parentNode.style.height = 'auto';
4513+
4514 newHeight = height - element.parentNode.offsetHeight;
4515
4516 // Restore the old height, just in case
4517 element.style.height = oldHeight + 'px';
4518
4519+ // Clear the parent (.slide) height. .removeProperty works in IE9+
4520+ element.parentNode.style.removeProperty('height');
4521+
4522 return newHeight;
4523 }
4524
4525@@ -1699,15 +1952,6 @@
4526 }
4527
4528 /**
4529- * Check if this instance is being used to print a PDF with fragments.
4530- */
4531- function isPrintingPDFFragments() {
4532-
4533- return ( /print-pdf-fragments/gi ).test( window.location.search );
4534-
4535- }
4536-
4537- /**
4538 * Hides the address bar if we're on a mobile device.
4539 */
4540 function hideAddressBar() {
4541@@ -1970,8 +2214,20 @@
4542
4543 if( !config.disableLayout ) {
4544
4545+ // On some mobile devices '100vh' is taller than the visible
4546+ // viewport which leads to part of the presentation being
4547+ // cut off. To work around this we define our own '--vh' custom
4548+ // property where 100x adds up to the correct height.
4549+ //
4550+ // https://css-tricks.com/the-trick-to-viewport-units-on-mobile/
4551+ if( isMobileDevice ) {
4552+ document.documentElement.style.setProperty( '--vh', ( window.innerHeight * 0.01 ) + 'px' );
4553+ }
4554+
4555 var size = getComputedSlideSize();
4556
4557+ var oldScale = scale;
4558+
4559 // Layout the contents of the slides
4560 layoutSlideContents( config.width, config.height );
4561
4562@@ -2044,6 +2300,13 @@
4563
4564 }
4565
4566+ if( oldScale !== scale ) {
4567+ dispatchEvent( 'resize', {
4568+ 'oldScale': oldScale,
4569+ 'scale': scale,
4570+ 'size': size
4571+ } );
4572+ }
4573 }
4574
4575 updateProgress();
4576@@ -2443,6 +2706,32 @@
4577 }
4578
4579 /**
4580+ * Shows the mouse pointer after it has been hidden with
4581+ * #hideCursor.
4582+ */
4583+ function showCursor() {
4584+
4585+ if( cursorHidden ) {
4586+ cursorHidden = false;
4587+ dom.wrapper.style.cursor = '';
4588+ }
4589+
4590+ }
4591+
4592+ /**
4593+ * Hides the mouse pointer when it's on top of the .reveal
4594+ * container.
4595+ */
4596+ function hideCursor() {
4597+
4598+ if( cursorHidden === false ) {
4599+ cursorHidden = true;
4600+ dom.wrapper.style.cursor = 'none';
4601+ }
4602+
4603+ }
4604+
4605+ /**
4606 * Enters the paused mode which fades everything on screen to
4607 * black.
4608 */
4609@@ -2584,28 +2873,6 @@
4610
4611 layout();
4612
4613- // Apply the new state
4614- stateLoop: for( var i = 0, len = state.length; i < len; i++ ) {
4615- // Check if this state existed on the previous slide. If it
4616- // did, we will avoid adding it repeatedly
4617- for( var j = 0; j < stateBefore.length; j++ ) {
4618- if( stateBefore[j] === state[i] ) {
4619- stateBefore.splice( j, 1 );
4620- continue stateLoop;
4621- }
4622- }
4623-
4624- document.documentElement.classList.add( state[i] );
4625-
4626- // Dispatch custom event matching the state's name
4627- dispatchEvent( state[i] );
4628- }
4629-
4630- // Clean up the remains of the previous state
4631- while( stateBefore.length ) {
4632- document.documentElement.classList.remove( stateBefore.pop() );
4633- }
4634-
4635 // Update the overview if it's currently active
4636 if( isOverview() ) {
4637 updateOverview();
4638@@ -2654,6 +2921,28 @@
4639 }
4640 }
4641
4642+ // Apply the new state
4643+ stateLoop: for( var i = 0, len = state.length; i < len; i++ ) {
4644+ // Check if this state existed on the previous slide. If it
4645+ // did, we will avoid adding it repeatedly
4646+ for( var j = 0; j < stateBefore.length; j++ ) {
4647+ if( stateBefore[j] === state[i] ) {
4648+ stateBefore.splice( j, 1 );
4649+ continue stateLoop;
4650+ }
4651+ }
4652+
4653+ document.documentElement.classList.add( state[i] );
4654+
4655+ // Dispatch custom event matching the state's name
4656+ dispatchEvent( state[i] );
4657+ }
4658+
4659+ // Clean up the remains of the previous state
4660+ while( stateBefore.length ) {
4661+ document.documentElement.classList.remove( stateBefore.pop() );
4662+ }
4663+
4664 if( slideChanged ) {
4665 dispatchEvent( 'slidechanged', {
4666 'indexh': indexh,
4667@@ -2679,6 +2968,7 @@
4668 updateParallax();
4669 updateSlideNumber();
4670 updateNotes();
4671+ updateFragments();
4672
4673 // Update the URL hash
4674 writeURL();
4675@@ -2751,6 +3041,9 @@
4676 */
4677 function syncSlide( slide ) {
4678
4679+ // Default to the current slide
4680+ slide = slide || currentSlide;
4681+
4682 syncBackground( slide );
4683 syncFragments( slide );
4684
4685@@ -2767,10 +3060,14 @@
4686 * after reveal.js has already initialized.
4687 *
4688 * @param {HTMLElement} slide
4689+ * @return {Array} a list of the HTML fragments that were synced
4690 */
4691 function syncFragments( slide ) {
4692
4693- sortFragments( slide.querySelectorAll( '.fragment' ) );
4694+ // Default to the current slide
4695+ slide = slide || currentSlide;
4696+
4697+ return sortFragments( slide.querySelectorAll( '.fragment' ) );
4698
4699 }
4700
4701@@ -2903,14 +3200,11 @@
4702 element.classList.add( reverse ? 'future' : 'past' );
4703
4704 if( config.fragments ) {
4705- var pastFragments = toArray( element.querySelectorAll( '.fragment' ) );
4706-
4707- // Show all fragments on prior slides
4708- while( pastFragments.length ) {
4709- var pastFragment = pastFragments.pop();
4710- pastFragment.classList.add( 'visible' );
4711- pastFragment.classList.remove( 'current-fragment' );
4712- }
4713+ // Show all fragments in prior slides
4714+ toArray( element.querySelectorAll( '.fragment' ) ).forEach( function( fragment ) {
4715+ fragment.classList.add( 'visible' );
4716+ fragment.classList.remove( 'current-fragment' );
4717+ } );
4718 }
4719 }
4720 else if( i > index ) {
4721@@ -2918,14 +3212,11 @@
4722 element.classList.add( reverse ? 'past' : 'future' );
4723
4724 if( config.fragments ) {
4725- var futureFragments = toArray( element.querySelectorAll( '.fragment.visible' ) );
4726-
4727- // No fragments in future slides should be visible ahead of time
4728- while( futureFragments.length ) {
4729- var futureFragment = futureFragments.pop();
4730- futureFragment.classList.remove( 'visible' );
4731- futureFragment.classList.remove( 'current-fragment' );
4732- }
4733+ // Hide all fragments in future slides
4734+ toArray( element.querySelectorAll( '.fragment.visible' ) ).forEach( function( fragment ) {
4735+ fragment.classList.remove( 'visible' );
4736+ fragment.classList.remove( 'current-fragment' );
4737+ } );
4738 }
4739 }
4740 }
4741@@ -3104,47 +3395,47 @@
4742
4743
4744 /**
4745- * Updates the slide number div to reflect the current slide.
4746- *
4747- * The following slide number formats are available:
4748- * "h.v": horizontal . vertical slide number (default)
4749- * "h/v": horizontal / vertical slide number
4750- * "c": flattened slide number
4751- * "c/t": flattened slide number / total slides
4752+ * Updates the slide number to match the current slide.
4753 */
4754 function updateSlideNumber() {
4755
4756 // Update slide number if enabled
4757 if( config.slideNumber && dom.slideNumber ) {
4758
4759- var value = [];
4760+ var value;
4761 var format = 'h.v';
4762
4763- // Check if a custom number format is available
4764- if( typeof config.slideNumber === 'string' ) {
4765- format = config.slideNumber;
4766- }
4767-
4768- // If there are ONLY vertical slides in this deck, always use
4769- // a flattened slide number
4770- if( !/c/.test( format ) && dom.wrapper.querySelectorAll( HORIZONTAL_SLIDES_SELECTOR ).length === 1 ) {
4771- format = 'c';
4772- }
4773-
4774- switch( format ) {
4775- case 'c':
4776- value.push( getSlidePastCount() + 1 );
4777- break;
4778- case 'c/t':
4779- value.push( getSlidePastCount() + 1, '/', getTotalSlides() );
4780- break;
4781- case 'h/v':
4782- value.push( indexh + 1 );
4783- if( isVerticalSlide() ) value.push( '/', indexv + 1 );
4784- break;
4785- default:
4786- value.push( indexh + 1 );
4787- if( isVerticalSlide() ) value.push( '.', indexv + 1 );
4788+ if( typeof config.slideNumber === 'function' ) {
4789+ value = config.slideNumber();
4790+ }
4791+ else {
4792+ // Check if a custom number format is available
4793+ if( typeof config.slideNumber === 'string' ) {
4794+ format = config.slideNumber;
4795+ }
4796+
4797+ // If there are ONLY vertical slides in this deck, always use
4798+ // a flattened slide number
4799+ if( !/c/.test( format ) && dom.wrapper.querySelectorAll( HORIZONTAL_SLIDES_SELECTOR ).length === 1 ) {
4800+ format = 'c';
4801+ }
4802+
4803+ value = [];
4804+ switch( format ) {
4805+ case 'c':
4806+ value.push( getSlidePastCount() + 1 );
4807+ break;
4808+ case 'c/t':
4809+ value.push( getSlidePastCount() + 1, '/', getTotalSlides() );
4810+ break;
4811+ case 'h/v':
4812+ value.push( indexh + 1 );
4813+ if( isVerticalSlide() ) value.push( '/', indexv + 1 );
4814+ break;
4815+ default:
4816+ value.push( indexh + 1 );
4817+ if( isVerticalSlide() ) value.push( '.', indexv + 1 );
4818+ }
4819 }
4820
4821 dom.slideNumber.innerHTML = formatSlideNumber( value[0], value[1], value[2] );
4822@@ -3428,6 +3719,26 @@
4823 }
4824
4825 /**
4826+ * Should the given element be preloaded?
4827+ * Decides based on local element attributes and global config.
4828+ *
4829+ * @param {HTMLElement} element
4830+ */
4831+ function shouldPreload( element ) {
4832+
4833+ // Prefer an explicit global preload setting
4834+ var preload = config.preloadIframes;
4835+
4836+ // If no global setting is available, fall back on the element's
4837+ // own preload setting
4838+ if( typeof preload !== 'boolean' ) {
4839+ preload = element.hasAttribute( 'data-preload' );
4840+ }
4841+
4842+ return preload;
4843+ }
4844+
4845+ /**
4846 * Called when the given slide is within the configured view
4847 * distance. Shows the slide element and loads any content
4848 * that is set to load lazily (data-src).
4849@@ -3442,10 +3753,12 @@
4850 slide.style.display = config.display;
4851
4852 // Media elements with data-src attributes
4853- toArray( slide.querySelectorAll( 'img[data-src], video[data-src], audio[data-src]' ) ).forEach( function( element ) {
4854- element.setAttribute( 'src', element.getAttribute( 'data-src' ) );
4855- element.setAttribute( 'data-lazy-loaded', '' );
4856- element.removeAttribute( 'data-src' );
4857+ toArray( slide.querySelectorAll( 'img[data-src], video[data-src], audio[data-src], iframe[data-src]' ) ).forEach( function( element ) {
4858+ if( element.tagName !== 'IFRAME' || shouldPreload( element ) ) {
4859+ element.setAttribute( 'src', element.getAttribute( 'data-src' ) );
4860+ element.setAttribute( 'data-lazy-loaded', '' );
4861+ element.removeAttribute( 'data-src' );
4862+ }
4863 } );
4864
4865 // Media elements with <source> children
4866@@ -3563,7 +3876,7 @@
4867 }
4868
4869 // Reset lazy-loaded media elements with src attributes
4870- toArray( slide.querySelectorAll( 'video[data-lazy-loaded][src], audio[data-lazy-loaded][src]' ) ).forEach( function( element ) {
4871+ toArray( slide.querySelectorAll( 'video[data-lazy-loaded][src], audio[data-lazy-loaded][src], iframe[data-lazy-loaded][src]' ) ).forEach( function( element ) {
4872 element.setAttribute( 'data-src', element.getAttribute( 'src' ) );
4873 element.removeAttribute( 'src' );
4874 } );
4875@@ -3663,13 +3976,6 @@
4876 _appendParamToIframeSource( 'src', 'player.vimeo.com/', 'api=1' );
4877 _appendParamToIframeSource( 'data-src', 'player.vimeo.com/', 'api=1' );
4878
4879- // Always show media controls on mobile devices
4880- if( isMobileDevice ) {
4881- toArray( dom.slides.querySelectorAll( 'video, audio' ) ).forEach( function( el ) {
4882- el.controls = true;
4883- } );
4884- }
4885-
4886 }
4887
4888 /**
4889@@ -3713,7 +4019,20 @@
4890 // Mobile devices never fire a loaded event so instead
4891 // of waiting, we initiate playback
4892 else if( isMobileDevice ) {
4893- el.play();
4894+ var promise = el.play();
4895+
4896+ // If autoplay does not work, ensure that the controls are visible so
4897+ // that the viewer can start the media on their own
4898+ if( promise && typeof promise.catch === 'function' && el.controls === false ) {
4899+ promise.catch( function() {
4900+ el.controls = true;
4901+
4902+ // Once the video does start playing, hide the controls again
4903+ el.addEventListener( 'play', function() {
4904+ el.controls = false;
4905+ } );
4906+ } );
4907+ }
4908 }
4909 // If the media isn't loaded, wait before playing
4910 else {
4911@@ -3947,7 +4266,7 @@
4912
4913 }
4914
4915- return pastCount / ( totalCount - 1 );
4916+ return Math.min( pastCount / ( totalCount - 1 ), 1 );
4917
4918 }
4919
4920@@ -3974,9 +4293,9 @@
4921 var bits = hash.slice( 2 ).split( '/' ),
4922 name = hash.replace( /#|\//gi, '' );
4923
4924- // If the first bit is invalid and there is a name we can
4925- // assume that this is a named link
4926- if( isNaN( parseInt( bits[0], 10 ) ) && name.length ) {
4927+ // If the first bit is not fully numeric and there is a name we
4928+ // can assume that this is a named link
4929+ if( !/^[0-9]*$/.test( bits[0] ) && name.length ) {
4930 var element;
4931
4932 // Ensure the named link is a valid HTML ID attribute
4933@@ -3988,10 +4307,13 @@
4934 // Ensure that we're not already on a slide with the same name
4935 var isSameNameAsCurrentSlide = currentSlide ? currentSlide.getAttribute( 'id' ) === name : false;
4936
4937- if( element && !isSameNameAsCurrentSlide ) {
4938- // Find the position of the named slide and navigate to it
4939- var indices = Reveal.getIndices( element );
4940- slide( indices.h, indices.v );
4941+ if( element ) {
4942+ // If the slide exists and is not the current slide...
4943+ if ( !isSameNameAsCurrentSlide ) {
4944+ // ...find the position of the named slide and navigate to it
4945+ var indices = Reveal.getIndices(element);
4946+ slide(indices.h, indices.v);
4947+ }
4948 }
4949 // If the slide doesn't exist, navigate to the current slide
4950 else {
4951@@ -4029,18 +4351,30 @@
4952 */
4953 function writeURL( delay ) {
4954
4955- if( config.history ) {
4956-
4957- // Make sure there's never more than one timeout running
4958- clearTimeout( writeURLTimeout );
4959-
4960- // If a delay is specified, timeout this call
4961- if( typeof delay === 'number' ) {
4962- writeURLTimeout = setTimeout( writeURL, delay );
4963- }
4964- else if( currentSlide ) {
4965+ // Make sure there's never more than one timeout running
4966+ clearTimeout( writeURLTimeout );
4967+
4968+ // If a delay is specified, timeout this call
4969+ if( typeof delay === 'number' ) {
4970+ writeURLTimeout = setTimeout( writeURL, delay );
4971+ }
4972+ else if( currentSlide ) {
4973+ // If we're configured to push to history OR the history
4974+ // API is not avaialble.
4975+ if( config.history || !window.history ) {
4976 window.location.hash = locationHash();
4977 }
4978+ // If we're configured to reflect the current slide in the
4979+ // URL without pushing to history.
4980+ else if( config.hash ) {
4981+ window.history.replaceState( null, null, '#' + locationHash() );
4982+ }
4983+ // If history and hash are both disabled, a hash may still
4984+ // be added to the URL by clicking on a href with a hash
4985+ // target. Counter this by always removing the hash.
4986+ else {
4987+ window.history.replaceState( null, null, window.location.pathname + window.location.search );
4988+ }
4989 }
4990
4991 }
4992@@ -4108,6 +4442,25 @@
4993 }
4994
4995 /**
4996+ * Returns an array of objects where each object represents the
4997+ * attributes on its respective slide.
4998+ */
4999+ function getSlidesAttributes() {
5000+
The diff has been truncated for viewing.

Subscribers

People subscribed via source and target branches

to all changes: