Skip to content

Commit

Permalink
javaScriptConsoleMessage change in Qt 5.6
Browse files Browse the repository at this point in the history
  • Loading branch information
jim-easterbrook committed Aug 13, 2018
1 parent 7f88f37 commit b62b118
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/photini/__init__.py
@@ -1,4 +1,4 @@
from __future__ import unicode_literals

__version__ = '2018.8.1'
build = '1166 (6c38f05)'
build = '1167 (7f88f37)'
13 changes: 9 additions & 4 deletions src/photini/photinimap.py
Expand Up @@ -31,8 +31,8 @@
from photini.imagelist import DRAG_MIMETYPE
from photini.pyqt import (
Busy, catch_all, ComboBox, CompactButton, Qt, QtCore, QtGui, QtWebChannel,
QtWebEngineWidgets, QtWebKit, QtWebKitWidgets, QtWidgets, scale_font,
set_symbol_font, SingleLineEdit, SquareButton)
QtWebEngineWidgets, QtWebKit, QtWebKitWidgets, QtWidgets, qt_version_info,
scale_font, set_symbol_font, SingleLineEdit, SquareButton)

logger = logging.getLogger(__name__)
translate = QtCore.QCoreApplication.translate
Expand All @@ -58,8 +58,13 @@ def createWindow(self, type_):


class WebPage(WebPageBase):
def javaScriptConsoleMessage(self, msg, line, source):
logger.error('%s line %d: %s', source, line, msg)
if qt_version_info >= (5, 6):
def javaScriptConsoleMessage(self, level, msg, line, source):
logger.log(logging.INFO + (level * 10),
'%s line %d: %s', source, line, msg)
else:
def javaScriptConsoleMessage(self, msg, line, source):
logger.error('%s line %d: %s', source, line, msg)


class WebView(WebViewBase):
Expand Down

0 comments on commit b62b118

Please sign in to comment.