diff --git a/openlp.py b/openlp.py index 0732fb066..ae0b88168 100755 --- a/openlp.py +++ b/openlp.py @@ -27,15 +27,7 @@ # Temple Place, Suite 330, Boston, MA 02111-1307 USA # ############################################################################### -import sip import sys -sip.setapi(u'QDate', 2) -sip.setapi(u'QDateTime', 2) -sip.setapi(u'QString', 2) -sip.setapi(u'QTextStream', 2) -sip.setapi(u'QTime', 2) -sip.setapi(u'QUrl', 2) -sip.setapi(u'QVariant', 2) from openlp.core import main diff --git a/openlp/__init__.py b/openlp/__init__.py index 606d4ef9d..1d84ab53c 100644 --- a/openlp/__init__.py +++ b/openlp/__init__.py @@ -30,7 +30,7 @@ The :mod:`openlp` module contains all the project produced OpenLP functionality """ -import core -import plugins +from . import core +from . import plugins __all__ = [u'core', u'plugins'] diff --git a/openlp/core/lib/db.py b/openlp/core/lib/db.py index c6bce2a00..e7cee208d 100644 --- a/openlp/core/lib/db.py +++ b/openlp/core/lib/db.py @@ -105,7 +105,8 @@ def upgrade_db(url, upgrade): if version > upgrade.__version__: return version, upgrade.__version__ version += 1 - if load_changes: + #FIXME: python3 - dislable upgrade + if load_changes and False: while hasattr(upgrade, u'upgrade_%d' % version): log.debug(u'Running upgrade_%d', version) try: diff --git a/openlp/core/lib/theme.py b/openlp/core/lib/theme.py index 401ab3cac..5be99854f 100644 --- a/openlp/core/lib/theme.py +++ b/openlp/core/lib/theme.py @@ -473,7 +473,7 @@ class ThemeXML(object): Pull out the XML string formatted for human consumption """ self._build_xml_from_attrs() - return self.theme_xml.toprettyxml(indent=u' ', newl=u'\n', encoding=u'utf-8') + return self.theme_xml.toprettyxml(indent=' ', newl='\n', encoding='utf-8') def parse(self, xml): """ diff --git a/openlp/core/ui/exceptionform.py b/openlp/core/ui/exceptionform.py index 25f8201b1..f7dc83d29 100644 --- a/openlp/core/ui/exceptionform.py +++ b/openlp/core/ui/exceptionform.py @@ -35,7 +35,7 @@ import os import platform import sqlalchemy -import BeautifulSoup +from bs4 import BeautifulSoup from lxml import etree from PyQt4 import Qt, QtCore, QtGui, QtWebKit diff --git a/openlp/core/ui/filerenameform.py b/openlp/core/ui/filerenameform.py index 273d314fb..885824c38 100644 --- a/openlp/core/ui/filerenameform.py +++ b/openlp/core/ui/filerenameform.py @@ -45,7 +45,9 @@ class FileRenameForm(QtGui.QDialog, Ui_FileRenameDialog): """ Constructor """ - QtGui.QDialog.__init__(self, self.main_window) + super().__init__() + # TODO: python3 - parent correct? + #QtGui.QDialog.__init__(self, self.main_window) self.setupUi(self) def exec_(self, copy=False): diff --git a/openlp/core/utils/actions.py b/openlp/core/utils/actions.py index d6a335ac2..56a6cf76e 100644 --- a/openlp/core/utils/actions.py +++ b/openlp/core/utils/actions.py @@ -103,12 +103,6 @@ class CategoryActionList(object): self.index += 1 return self.actions[self.index - 1][1] - def next(self): - """ - Python 2 "next" method. - """ - return self.__next__() - def has_key(self, key): """ Implement the has_key() method to make this class a dictionary type @@ -196,12 +190,6 @@ class CategoryList(object): self.index += 1 return self.categories[self.index - 1] - def next(self): - """ - Python 2 "next" method for iterator. - """ - return self.__next__() - def has_key(self, key): """ Implement the has_key() method to make this class like a dictionary diff --git a/openlp/plugins/bibles/lib/http.py b/openlp/plugins/bibles/lib/http.py index b01377a05..872180170 100644 --- a/openlp/plugins/bibles/lib/http.py +++ b/openlp/plugins/bibles/lib/http.py @@ -36,7 +36,7 @@ import socket import urllib from HTMLParser import HTMLParseError -from BeautifulSoup import BeautifulSoup, NavigableString, Tag +from BeautifulSoup from bs4 import BeautifulSoup, NavigableString, Tag from openlp.core.lib import Registry, translate from openlp.core.lib.ui import critical_error_message_box diff --git a/scripts/generate_resources.sh b/scripts/generate_resources.sh index d1717507d..c58e0ef61 100755 --- a/scripts/generate_resources.sh +++ b/scripts/generate_resources.sh @@ -44,7 +44,7 @@ mv openlp/core/resources.py openlp/core/resources.py.old # Create the new data from the updated qrc -pyrcc4 -o openlp/core/resources.py.new resources/images/openlp-2.qrc +pyrcc4 -py3 -o openlp/core/resources.py.new resources/images/openlp-2.qrc # Remove patch breaking lines cat openlp/core/resources.py.new | sed '/# Created: /d;/# by: /d' \