Sun, 03 Apr 2016 17:07:25 +0200
Corrected some code style issues.
--- a/Preferences/ConfigurationDialog.py Sun Apr 03 16:33:37 2016 +0200 +++ b/Preferences/ConfigurationDialog.py Sun Apr 03 17:07:25 2016 +0200 @@ -910,6 +910,9 @@ def isUsingWebEngine(self): """ Public method to get an indication, if QtWebEngine is being used. + + @return flag indicating the use of QtWebEngine + @rtype bool """ return self.__webEngine or \ self.displayMode == ConfigurationWidget.WebBrowserMode
--- a/Preferences/ConfigurationPages/WebBrowserPage.py Sun Apr 03 16:33:37 2016 +0200 +++ b/Preferences/ConfigurationPages/WebBrowserPage.py Sun Apr 03 17:07:25 2016 +0200 @@ -7,6 +7,8 @@ Module implementing the Web Browser configuration page. """ +from __future__ import unicode_literals + from PyQt5.QtCore import pyqtSlot, QLocale from .ConfigurationPageBase import ConfigurationPageBase
--- a/Preferences/__init__.py Sun Apr 03 16:33:37 2016 +0200 +++ b/Preferences/__init__.py Sun Apr 03 17:07:25 2016 +0200 @@ -62,6 +62,7 @@ from WebBrowser.FlashCookieManager.FlashCookieUtilities import \ flashDataPathForOS + class Prefs(object): """ A class to hold all configuration items for the application. @@ -2783,7 +2784,7 @@ value = prefClass.helpDefaults[key] return value elif key in ["StartupBehavior", "HistoryLimit", - "DownloadManagerRemovePolicy","SyncType", "SyncFtpPort", + "DownloadManagerRemovePolicy", "SyncType", "SyncFtpPort", "SyncFtpIdleTimeout", "SyncEncryptionKeyLength", "SearchLanguage", "WebInspectorPort", "DefaultFontSize", "DefaultFixedFontSize",
--- a/QScintilla/Editor.py Sun Apr 03 16:33:37 2016 +0200 +++ b/QScintilla/Editor.py Sun Apr 03 17:07:25 2016 +0200 @@ -5354,7 +5354,7 @@ @return flag indicating this editor should be saved (boolean) """ - return bool (self.fileName) and \ + return bool(self.fileName) and \ not self.autosaveManuallyDisabled and \ not self.isReadOnly()
--- a/ViewManager/ViewManager.py Sun Apr 03 16:33:37 2016 +0200 +++ b/ViewManager/ViewManager.py Sun Apr 03 17:07:25 2016 +0200 @@ -85,7 +85,7 @@ super(QuickSearchLineEdit, self).focusInEvent(evt) # pass it on -class ViewManager(QWidget):##QObject): +class ViewManager(QWidget): """ Base class inherited by all specific viewmanager classes. @@ -450,8 +450,6 @@ Public method to return a reference to the main Widget of a specific view manager subclass. - @return reference to the main widget - @rtype QWidget @exception RuntimeError Not implemented """ raise RuntimeError('Not implemented')
--- a/WebBrowser/AdBlock/AdBlockManager.py Sun Apr 03 16:33:37 2016 +0200 +++ b/WebBrowser/AdBlock/AdBlockManager.py Sun Apr 03 17:07:25 2016 +0200 @@ -285,7 +285,7 @@ def addSubscriptionFromUrl(self, url): """ - Public method to ad an AdBlock subscription given the abp URL: + Public method to ad an AdBlock subscription given the abp URL. @param url URL to subscribe an AdBlock subscription @type QUrl
--- a/WebBrowser/AdBlock/AdBlockUrlInterceptor.py Sun Apr 03 16:33:37 2016 +0200 +++ b/WebBrowser/AdBlock/AdBlockUrlInterceptor.py Sun Apr 03 17:07:25 2016 +0200 @@ -11,6 +11,7 @@ from ..Network.UrlInterceptor import UrlInterceptor + class AdBlockUrlInterceptor(UrlInterceptor): """ Class implementing an URL interceptor for AdBlock.
--- a/WebBrowser/CookieJar/CookieJar.py Sun Apr 03 16:33:37 2016 +0200 +++ b/WebBrowser/CookieJar/CookieJar.py Sun Apr 03 17:07:25 2016 +0200 @@ -179,7 +179,7 @@ def __rejectCookie(self, cookie, cookieDomain): """ - Public method to test, if a cookie shall be rejected. + Private method to test, if a cookie shall be rejected. @param cookie cookie to be tested @type QNetworkCookie
--- a/WebBrowser/Download/DownloadItem.py Sun Apr 03 16:33:37 2016 +0200 +++ b/WebBrowser/Download/DownloadItem.py Sun Apr 03 17:07:25 2016 +0200 @@ -423,7 +423,7 @@ """ self.__finishedDownloading = True - noError = (self.__downloadItem.state() == + noError = (self.__downloadItem.state() == QWebEngineDownloadItem.DownloadCompleted) self.progressBar.setVisible(False)
--- a/WebBrowser/Download/DownloadManager.py Sun Apr 03 16:33:37 2016 +0200 +++ b/WebBrowser/Download/DownloadManager.py Sun Apr 03 17:07:25 2016 +0200 @@ -97,7 +97,7 @@ menu.addSeparator() menu.addAction( self.tr("Open Containing Folder"), - self.__contextMenuOpenFolder) + self.__contextMenuOpenFolder) menu.addSeparator() menu.addAction( self.tr("Go to Download Page"),
--- a/WebBrowser/FeaturePermissions/FeaturePermissionsDialog.py Sun Apr 03 16:33:37 2016 +0200 +++ b/WebBrowser/FeaturePermissions/FeaturePermissionsDialog.py Sun Apr 03 17:07:25 2016 +0200 @@ -49,7 +49,7 @@ ## self.notifList.headerItem().setText(0, self.tr("Host")) ## self.notifList.headerItem().setText(1, self.tr("Permission")) ## self.tabWidget.addTab( -## self.notifList, +## self.notifList, ## UI.PixmapCache.getIcon("notification.png"), ## self.tr("Notifications")) @@ -115,7 +115,8 @@ self.mouseLockList = QTreeWidget() self.mouseLockList.setAlternatingRowColors(True) - self.mouseLockList.setSelectionMode(QAbstractItemView.ExtendedSelection) + self.mouseLockList.setSelectionMode( + QAbstractItemView.ExtendedSelection) self.mouseLockList.setRootIsDecorated(False) self.mouseLockList.setItemsExpandable(False) self.mouseLockList.setAllColumnsShowFocus(True)
--- a/WebBrowser/GreaseMonkey/GreaseMonkeyManager.py Sun Apr 03 16:33:37 2016 +0200 +++ b/WebBrowser/GreaseMonkey/GreaseMonkeyManager.py Sun Apr 03 17:07:25 2016 +0200 @@ -76,6 +76,16 @@ @pyqtSlot(QUrl) def doDownloadScript(self, url): + """ + Public slot to download a GreaseMonkey script. + + Note: The download needed to be separated in the invoking part + (s.a.) and the one doing the real download because the invoking + part runs in a different thread (i.e. the web engine thread). + + @param url URL to download script from + @type QUrl + """ from .GreaseMonkeyDownloader import GreaseMonkeyDownloader downloader = GreaseMonkeyDownloader(url, self) downloader.finished.connect(self.__downloaderFinished)
--- a/WebBrowser/GreaseMonkey/GreaseMonkeyScript.py Sun Apr 03 16:33:37 2016 +0200 +++ b/WebBrowser/GreaseMonkey/GreaseMonkeyScript.py Sun Apr 03 17:07:25 2016 +0200 @@ -10,7 +10,7 @@ from __future__ import unicode_literals from PyQt5.QtCore import pyqtSignal, pyqtSlot, QObject, QUrl, QRegExp, \ - QByteArray, QCryptographicHash + QByteArray, QCryptographicHash from PyQt5.QtWebEngineWidgets import QWebEngineScript from .GreaseMonkeyJavaScript import bootstrap_js, values_js @@ -331,9 +331,9 @@ return; }} delete __eric_includes;""".format( - self.__toJavaScriptList(self.__exclude[:]), - self.__toJavaScriptList(self.__include[:]) - ) + self.__toJavaScriptList(self.__exclude[:]), + self.__toJavaScriptList(self.__include[:]) + ) runCheck = "" self.__script = "(function(){{{0}\n{1}\n{2}\n{3}\n}})();".format( runCheck, valuesScript, @@ -347,6 +347,7 @@ @return prepared script object @rtype QWebEngineScript + @exception ValueError raised to indicate an unsupported start point """ if self.startAt() == GreaseMonkeyScript.DocumentStart: injectionPoint = QWebEngineScript.DocumentCreation
--- a/WebBrowser/JavaScript/StartPageJsObject.py Sun Apr 03 16:33:37 2016 +0200 +++ b/WebBrowser/JavaScript/StartPageJsObject.py Sun Apr 03 17:07:25 2016 +0200 @@ -35,8 +35,8 @@ @return string for the search provider (string) """ return (self.tr("Search results provided by {0}") - .format(self.__external.page().view().mainWindow() - .openSearchManager().currentEngineName())) + .format(self.__external.page().view().mainWindow() + .openSearchManager().currentEngineName())) @pyqtSlot(str, result=str) def searchUrl(self, searchStr):
--- a/WebBrowser/Network/EricSchemeHandler.py Sun Apr 03 16:33:37 2016 +0200 +++ b/WebBrowser/Network/EricSchemeHandler.py Sun Apr 03 17:07:25 2016 +0200 @@ -16,6 +16,7 @@ from ..Tools.WebBrowserTools import readAllFileContents + class EricSchemeHandler(QWebEngineUrlSchemeHandler): """ Class implementing a scheme handler for the eric: scheme. @@ -219,7 +220,7 @@ .replace("@TITLE-RELOAD@", self.tr("Reload")) .replace("@TITLE-WARN@", self.tr("Are you sure to remove this speed dial?")) - .replace("@TITLE-WARN-REL@", + .replace("@TITLE-WARN-REL@", self.tr("Are you sure you want to reload all speed" " dials?")) .replace("@TITLE-FETCHTITLE@",
--- a/WebBrowser/Network/NetworkManager.py Sun Apr 03 16:33:37 2016 +0200 +++ b/WebBrowser/Network/NetworkManager.py Sun Apr 03 17:07:25 2016 +0200 @@ -243,7 +243,7 @@ auth.setPassword(password) if Preferences.getUser("SavePasswords"): WebBrowser.WebBrowserWindow.WebBrowserWindow.passwordManager()\ - .setLogin(url, realm, username, password) + .setLogin(url, realm, username, password) def proxyAuthentication(self, requestUrl, auth, proxyHost): """ @@ -253,7 +253,7 @@ @type QUrl @param auth reference to the authenticator object @type QAuthenticator - @param hostname name of the proxy host + @param proxyHost name of the proxy host @type str """ proxy = QNetworkProxy.applicationProxy()
--- a/WebBrowser/Network/NetworkUrlInterceptor.py Sun Apr 03 16:33:37 2016 +0200 +++ b/WebBrowser/Network/NetworkUrlInterceptor.py Sun Apr 03 17:07:25 2016 +0200 @@ -68,7 +68,7 @@ if interceptor not in self.__interceptors: self.__interceptors.append(interceptor) - def removeUrlInterceptor(self, interceptor): + def removeUrlInterceptor(self, interceptor): """ Public method to remove an URL interceptor.
--- a/WebBrowser/Network/UrlInterceptor.py Sun Apr 03 16:33:37 2016 +0200 +++ b/WebBrowser/Network/UrlInterceptor.py Sun Apr 03 17:07:25 2016 +0200 @@ -11,6 +11,7 @@ from PyQt5.QtCore import QObject + class UrlInterceptor(QObject): """ Class implementing an URL interceptor base class.
--- a/WebBrowser/OpenSearch/OpenSearchManager.py Sun Apr 03 16:33:37 2016 +0200 +++ b/WebBrowser/OpenSearch/OpenSearchManager.py Sun Apr 03 17:07:25 2016 +0200 @@ -228,7 +228,7 @@ def addEngineFromForm(self, res, view): """ - Private method to add a new search engine from a form. + Public method to add a new search engine from a form. @param res result of the JavaScript run on by WebBrowserView.__addSearchEngine()
--- a/WebBrowser/Passwords/PasswordManager.py Sun Apr 03 16:33:37 2016 +0200 +++ b/WebBrowser/Passwords/PasswordManager.py Sun Apr 03 17:07:25 2016 +0200 @@ -368,7 +368,7 @@ return postData = QByteArray(Utilities.crypto.pwConvert( - form.postData, encode=False).encode("utf-8")) + form.postData, encode=False).encode("utf-8")) script = Scripts.completeFormData(postData) page.runJavaScript(script)
--- a/WebBrowser/PersonalInformationManager/PersonalInformationManager.py Sun Apr 03 16:33:37 2016 +0200 +++ b/WebBrowser/PersonalInformationManager/PersonalInformationManager.py Sun Apr 03 17:07:25 2016 +0200 @@ -258,7 +258,7 @@ continue; if (key == input.name || input.name.indexOf(key) != -1) {{ input.style['-webkit-appearance'] = 'none'; - input.style['-webkit-box-shadow'] = + input.style['-webkit-box-shadow'] = 'inset 0 0 2px 1px #000EEE'; break; }}
--- a/WebBrowser/SiteInfo/SiteInfoDialog.py Sun Apr 03 16:33:37 2016 +0200 +++ b/WebBrowser/SiteInfo/SiteInfoDialog.py Sun Apr 03 17:07:25 2016 +0200 @@ -71,7 +71,7 @@ self.__processMetaAttributes) # populate Media tab - browser.page().runJavaScript(Scripts.getAllImages(), + browser.page().runJavaScript(Scripts.getAllImages(), self.__processImageTags) def __processImageTags(self, res):
--- a/WebBrowser/SpeedDial/PageThumbnailer.py Sun Apr 03 16:33:37 2016 +0200 +++ b/WebBrowser/SpeedDial/PageThumbnailer.py Sun Apr 03 17:07:25 2016 +0200 @@ -112,7 +112,7 @@ @pyqtSlot(bool) def createThumbnail(self, status): """ - Private slot creating the thumbnail of the web site. + Public slot creating the thumbnail of the web site. @param status flag indicating a successful load of the web site (boolean)
--- a/WebBrowser/Sync/DirectorySyncHandler.py Sun Apr 03 16:33:37 2016 +0200 +++ b/WebBrowser/Sync/DirectorySyncHandler.py Sun Apr 03 17:07:25 2016 +0200 @@ -92,8 +92,8 @@ self.syncStatus.emit(type_, self._messages[type_]["RemoteExists"]) try: f = open(os.path.join( - Preferences.getWebBrowser("SyncDirectoryPath"), - self._remoteFiles[type_]), "rb") + Preferences.getWebBrowser("SyncDirectoryPath"), + self._remoteFiles[type_]), "rb") data = f.read() f.close() except IOError as err:
--- a/WebBrowser/Tools/WebHitTestResult.py Sun Apr 03 16:33:37 2016 +0200 +++ b/WebBrowser/Tools/WebHitTestResult.py Sun Apr 03 17:07:25 2016 +0200 @@ -16,6 +16,7 @@ from PyQt5.QtCore import QPoint, QRect, QUrl + class WebHitTestResult(object): """ Class implementing an object for testing certain aspects of a web page.
--- a/WebBrowser/Tools/WebIconDialog.py Sun Apr 03 16:33:37 2016 +0200 +++ b/WebBrowser/Tools/WebIconDialog.py Sun Apr 03 17:07:25 2016 +0200 @@ -7,6 +7,8 @@ Module implementing a dialog to manage the Favicons. """ +from __future__ import unicode_literals + from PyQt5.QtCore import pyqtSlot, Qt, QPoint from PyQt5.QtWidgets import QDialog, QListWidgetItem, QMenu
--- a/WebBrowser/WebBrowserJavaScriptConsole.py Sun Apr 03 16:33:37 2016 +0200 +++ b/WebBrowser/WebBrowserJavaScriptConsole.py Sun Apr 03 17:07:25 2016 +0200 @@ -83,7 +83,7 @@ evt.accept() return - def javaScriptConsoleMessage(self, level, message, lineNumber, sourceId): + def javaScriptConsoleMessage(self, level, message, lineNumber, sourceId): """ Public method to show a console message.
--- a/WebBrowser/WebBrowserPage.py Sun Apr 03 16:33:37 2016 +0200 +++ b/WebBrowser/WebBrowserPage.py Sun Apr 03 17:07:25 2016 +0200 @@ -144,7 +144,7 @@ """ loop = QEventLoop() resultDict = {"res": None} - QTimer.singleShot(500, loop.quit); + QTimer.singleShot(500, loop.quit) def resultCallback(res, resDict=resultDict): if loop and loop.isRunning(): @@ -209,6 +209,9 @@ def __fullScreenRequested(self, request): """ Private slot handling a full screen request. + + @param request reference to the full screen request + @type QWebEngineFullScreenRequest """ self.view().requestFullScreen(request.toggleOn()) @@ -223,7 +226,7 @@ ## Methods below deal with JavaScript messages ############################################## - def javaScriptConsoleMessage(self, level, message, lineNumber, sourceId): + def javaScriptConsoleMessage(self, level, message, lineNumber, sourceId): """ Public method to show a console message. @@ -237,4 +240,4 @@ @type str """ self.view().mainWindow().javascriptConsole().javaScriptConsoleMessage( - level, message, lineNumber, sourceId) + level, message, lineNumber, sourceId)
--- a/WebBrowser/WebBrowserView.py Sun Apr 03 16:33:37 2016 +0200 +++ b/WebBrowser/WebBrowserView.py Sun Apr 03 17:07:25 2016 +0200 @@ -424,7 +424,7 @@ def contextMenuEvent(self, evt): """ - Public method called to create a context menu. + Protected method called to create a context menu. This method is overridden from QWebEngineView. @@ -664,7 +664,7 @@ engineName = self.__mw.openSearchManager().currentEngineName() if engineName: - menu.addAction(self.tr("Search with '{0}'").format(engineName), + menu.addAction(self.tr("Search with '{0}'").format(engineName), self.__searchDefaultRequested) from .OpenSearch.OpenSearchEngineAction import \ @@ -718,7 +718,6 @@ @param menu reference to the menu to be populated @type QMenu """ - menu.addAction(self.__mw.newTabAct) menu.addAction(self.__mw.newAct) menu.addSeparator() @@ -1063,11 +1062,8 @@ """ Private callback method of __addBookmark(). - @param url URL for the bookmark - @type str - @param title title for the bookmark - @type str - @param res result of the JavaScript + @param res reference to the result list containing all + meta attributes @type list """ description = ""
--- a/WebBrowser/WebBrowserWindow.py Sun Apr 03 16:33:37 2016 +0200 +++ b/WebBrowser/WebBrowserWindow.py Sun Apr 03 17:07:25 2016 +0200 @@ -2592,7 +2592,7 @@ @classmethod def isPrivate(cls): """ - Public method to check the private browsing mode. + Class method to check the private browsing mode. @return flag indicating private browsing mode @rtype bool @@ -3769,7 +3769,7 @@ # enter full screen mode self.__windowStates = evt.oldState() elif bool(evt.oldState() & Qt.WindowFullScreen) and \ - not bool(self.windowState() & Qt.WindowFullScreen): + not bool(self.windowState() & Qt.WindowFullScreen): # leave full screen mode self.setWindowState(self.__windowStates) self.__htmlFullScreen = False @@ -3942,14 +3942,14 @@ ################################### @classmethod - def downloadRequested(self, download): + def downloadRequested(cls, download): """ Class method to handle a download request. @param download reference to the download data @type QWebEngineDownloadItem """ - self.downloadManager().download(download) + cls.downloadManager().download(download) ######################################## ## Support for web engine profiles below @@ -3982,8 +3982,8 @@ cls._webProfile.setHttpCacheType( QWebEngineProfile.DiskHttpCache) cls._webProfile.setHttpCacheMaximumSize( - Preferences.getWebBrowser("DiskCacheSize") - * 1024 * 1024) + Preferences.getWebBrowser("DiskCacheSize") * + 1024 * 1024) cls._webProfile.setCachePath(os.path.join( Utilities.getConfigDir(), "web_browser")) else: