Fri, 24 Jul 2015 18:44:45 +0200
Deactivated the VirusTotal function because of v2 of the API (should be back in eric 6.1).
--- a/Helpviewer/Download/DownloadAskActionDialog.py Fri Jul 24 18:28:13 2015 +0200 +++ b/Helpviewer/Download/DownloadAskActionDialog.py Fri Jul 24 18:44:45 2015 +0200 @@ -13,8 +13,6 @@ from .Ui_DownloadAskActionDialog import Ui_DownloadAskActionDialog -import Preferences - class DownloadAskActionDialog(QDialog, Ui_DownloadAskActionDialog): """ @@ -36,9 +34,7 @@ self.typeLabel.setText(mimeType) self.siteLabel.setText(baseUrl) - if not Preferences.getHelp("VirusTotalEnabled") or \ - Preferences.getHelp("VirusTotalServiceKey") == "": - self.scanButton.setHidden(True) + self.scanButton.setHidden(True) msh = self.minimumSizeHint() self.resize(max(self.width(), msh.width()), msh.height())
--- a/Helpviewer/Download/DownloadItem.py Fri Jul 24 18:28:13 2015 +0200 +++ b/Helpviewer/Download/DownloadItem.py Fri Jul 24 18:44:45 2015 +0200 @@ -197,18 +197,18 @@ self.__canceledFileSelect = True return - if dlg.getAction() == "scan": - self.__mainWindow.requestVirusTotalScan(url) - - self.progressBar.setVisible(False) - self.__reply.close() - self.on_stopButton_clicked() - self.filenameLabel.setText( - self.tr("VirusTotal scan scheduled: {0}").format( - QFileInfo(defaultFileName).fileName())) - self.__canceledFileSelect = True - return - +## if dlg.getAction() == "scan": +## self.__mainWindow.requestVirusTotalScan(url) +## +## self.progressBar.setVisible(False) +## self.__reply.close() +## self.on_stopButton_clicked() +## self.filenameLabel.setText( +## self.tr("VirusTotal scan scheduled: {0}").format( +## QFileInfo(defaultFileName).fileName())) +## self.__canceledFileSelect = True +## return +## self.__autoOpen = dlg.getAction() == "open" if PYQT_VERSION_STR >= "5.0.0": from PyQt5.QtCore import QStandardPaths
--- a/Helpviewer/HelpBrowserWV.py Fri Jul 24 18:28:13 2015 +0200 +++ b/Helpviewer/HelpBrowserWV.py Fri Jul 24 18:44:45 2015 +0200 @@ -1107,12 +1107,12 @@ UI.PixmapCache.getIcon("mailSend.png"), self.tr("Send Link"), self.__sendLink).setData(hit.linkUrl()) - if Preferences.getHelp("VirusTotalEnabled") and \ - Preferences.getHelp("VirusTotalServiceKey") != "": - menu.addAction( - UI.PixmapCache.getIcon("virustotal.png"), - self.tr("Scan Link with VirusTotal"), - self.__virusTotal).setData(hit.linkUrl()) +## if Preferences.getHelp("VirusTotalEnabled") and \ +## Preferences.getHelp("VirusTotalServiceKey") != "": +## menu.addAction( +## UI.PixmapCache.getIcon("virustotal.png"), +## self.tr("Scan Link with VirusTotal"), +## self.__virusTotal).setData(hit.linkUrl()) if not hit.imageUrl().isEmpty(): if not menu.isEmpty(): @@ -1140,12 +1140,12 @@ UI.PixmapCache.getIcon("adBlockPlus.png"), self.tr("Block Image"), self.__blockImage)\ .setData(hit.imageUrl().toString()) - if Preferences.getHelp("VirusTotalEnabled") and \ - Preferences.getHelp("VirusTotalServiceKey") != "": - menu.addAction( - UI.PixmapCache.getIcon("virustotal.png"), - self.tr("Scan Image with VirusTotal"), - self.__virusTotal).setData(hit.imageUrl()) +## if Preferences.getHelp("VirusTotalEnabled") and \ +## Preferences.getHelp("VirusTotalServiceKey") != "": +## menu.addAction( +## UI.PixmapCache.getIcon("virustotal.png"), +## self.tr("Scan Image with VirusTotal"), +## self.__virusTotal).setData(hit.imageUrl()) element = hit.element() if not element.isNull(): @@ -1477,14 +1477,14 @@ else: self.__clickedMediaElement.evaluateJavaScript("this.muted = true") - def __virusTotal(self): - """ - Private slot to scan the selected URL with VirusTotal. - """ - act = self.sender() - url = act.data() - self.mw.requestVirusTotalScan(url) - +## def __virusTotal(self): +## """ +## Private slot to scan the selected URL with VirusTotal. +## """ +## act = self.sender() +## url = act.data() +## self.mw.requestVirusTotalScan(url) +## def __searchRequested(self, act): """ Private slot to search for some text with a selected search engine.
--- a/Helpviewer/HelpWindow.py Fri Jul 24 18:28:13 2015 +0200 +++ b/Helpviewer/HelpWindow.py Fri Jul 24 18:44:45 2015 +0200 @@ -128,7 +128,7 @@ from .HelpBrowserWV import HelpBrowser from .HelpTabWidget import HelpTabWidget from .AdBlock.AdBlockIcon import AdBlockIcon - from .VirusTotalApi import VirusTotalAPI +## from .VirusTotalApi import VirusTotalAPI HelpWindow.setUseQtHelp(self.fromEric) @@ -270,14 +270,14 @@ self.__initHelpDb() - self.__virusTotal = VirusTotalAPI(self) - self.__virusTotal.submitUrlError.connect( - self.__virusTotalSubmitUrlError) - self.__virusTotal.urlScanReport.connect( - self.__virusTotalUrlScanReport) - self.__virusTotal.fileScanReport.connect( - self.__virusTotalFileScanReport) - +## self.__virusTotal = VirusTotalAPI(self) +## self.__virusTotal.submitUrlError.connect( +## self.__virusTotalSubmitUrlError) +## self.__virusTotal.urlScanReport.connect( +## self.__virusTotalUrlScanReport) +## self.__virusTotal.fileScanReport.connect( +## self.__virusTotalFileScanReport) +## self.__previewer = None self.__shutdownCalled = False @@ -1823,76 +1823,76 @@ self.bookmarksToolBar.newUrl.connect(self.openUrlNewTab) self.addToolBarBreak() self.addToolBar(self.bookmarksToolBar) - - self.addToolBarBreak() - vttb = self.addToolBar(self.tr("VirusTotal")) - vttb.setObjectName("VirusTotalToolBar") - vttb.setIconSize(UI.Config.ToolBarIconSize) - vttb.setToolButtonStyle(Qt.ToolButtonTextBesideIcon) - self.virustotalSearchEdit = QLineEdit() - self.virustotalSearchEdit.setMaximumWidth(250) - self.virustotalSearchEdit.setWhatsThis(self.tr( - """<h2>File search</h2>""" - """<p>In order to search for the last VirusTotal report on a""" - """ given file just enter its hash. Currently the allowed""" - """ hashes are MD5, SHA1 and SHA256. You can also search for""" - """ a particular file report by typing in its permalink id.</p>""" - """<h2>URL search</h2>""" - """<p>URL searches are simple, just type in the given URL, the""" - """ application will normalize it and compare it with the""" - """ entries in VirusTotal's database. Alternatively you may""" - """ enter the MD5 hash of an URL preceded by "url:", e.g.""" - """ url:7f911bbcf618f052ac6b9928600d2820.</p>""" - """<h2>User search</h2>""" - """<p>Do you want to know whether a friend has a VT Community""" - """ account? Simply type in his nick preceded by the symbol""" - """ "@", e.g. @EmilianoMartinez.</p>""" - """<h2>Search through comments</h2>""" - """<p>The comments in VT Community may often help in""" - """ disinfecting your PC or may proof themselves useful when""" - """ analysing a particular malware sample, comment tags enable""" - """ users to search through the VT Community reviews. The""" - """ standard file tags are: {0} The standard URL tags are: {1}""" - """User generated tags are preceded by the symbol "#", e.g.""" - """ #disinfect.</p>""" - ).format( - """<ul>""" - """<li>goodware</li>""" - """<li>malware</li>""" - """<li>spamattachmentorlink</li>""" - """<li>p2pdownload</li>""" - """<li>impropagating</li>""" - """<li>networkworm</li>""" - """<li>drivebydownload</li>""" - """</ul>""", - """<ul>""" - """<li>malicious</li>""" - """<li>benign</li>""" - """<li>malewaredownload</li>""" - """<li>phishingsite</li>""" - """<li>browserexploit</li>""" - """<li>spamlink</li>""" - """</ul>""", - )) - self.virustotalSearchEdit.textChanged.connect( - self.__virusTotalSearchChanged) - self.virustotalSearchEdit.returnPressed.connect( - self.__virusTotalSearch) - vttb.addWidget(self.virustotalSearchEdit) - self.virustotalSearchAct = vttb.addAction( - UI.PixmapCache.getIcon("virustotal.png"), - self.tr("Search VirusTotal"), - self.__virusTotalSearch) - self.virustotalSearchAct.setEnabled(False) - vttb.addSeparator() - self.virustotalScanCurrentAct = vttb.addAction( - UI.PixmapCache.getIcon("virustotal.png"), - self.tr("Scan current site"), - self.__virusTotalScanCurrentSite) - if not Preferences.getHelp("VirusTotalEnabled") or \ - Preferences.getHelp("VirusTotalServiceKey") == "": - self.virustotalSearchEdit.setEnabled(False) - self.virustotalScanCurrentAct.setEnabled(False) +## +## self.addToolBarBreak() +## vttb = self.addToolBar(self.tr("VirusTotal")) +## vttb.setObjectName("VirusTotalToolBar") +## vttb.setIconSize(UI.Config.ToolBarIconSize) +## vttb.setToolButtonStyle(Qt.ToolButtonTextBesideIcon) +## self.virustotalSearchEdit = QLineEdit() +## self.virustotalSearchEdit.setMaximumWidth(250) +## self.virustotalSearchEdit.setWhatsThis(self.tr( +## """<h2>File search</h2>""" +## """<p>In order to search for the last VirusTotal report on a""" +## """ given file just enter its hash. Currently the allowed""" +## """ hashes are MD5, SHA1 and SHA256. You can also search for""" +## """ a particular file report by typing in its permalink id.</p>""" +## """<h2>URL search</h2>""" +## """<p>URL searches are simple, just type in the given URL, the""" +## """ application will normalize it and compare it with the""" +## """ entries in VirusTotal's database. Alternatively you may""" +## """ enter the MD5 hash of an URL preceded by "url:", e.g.""" +## """ url:7f911bbcf618f052ac6b9928600d2820.</p>""" +## """<h2>User search</h2>""" +## """<p>Do you want to know whether a friend has a VT Community""" +## """ account? Simply type in his nick preceded by the symbol""" +## """ "@", e.g. @EmilianoMartinez.</p>""" +## """<h2>Search through comments</h2>""" +## """<p>The comments in VT Community may often help in""" +## """ disinfecting your PC or may proof themselves useful when""" +## """ analysing a particular malware sample, comment tags enable""" +## """ users to search through the VT Community reviews. The""" +## """ standard file tags are: {0} The standard URL tags are: {1}""" +## """User generated tags are preceded by the symbol "#", e.g.""" +## """ #disinfect.</p>""" +## ).format( +## """<ul>""" +## """<li>goodware</li>""" +## """<li>malware</li>""" +## """<li>spamattachmentorlink</li>""" +## """<li>p2pdownload</li>""" +## """<li>impropagating</li>""" +## """<li>networkworm</li>""" +## """<li>drivebydownload</li>""" +## """</ul>""", +## """<ul>""" +## """<li>malicious</li>""" +## """<li>benign</li>""" +## """<li>malewaredownload</li>""" +## """<li>phishingsite</li>""" +## """<li>browserexploit</li>""" +## """<li>spamlink</li>""" +## """</ul>""", +## )) +## self.virustotalSearchEdit.textChanged.connect( +## self.__virusTotalSearchChanged) +## self.virustotalSearchEdit.returnPressed.connect( +## self.__virusTotalSearch) +## vttb.addWidget(self.virustotalSearchEdit) +## self.virustotalSearchAct = vttb.addAction( +## UI.PixmapCache.getIcon("virustotal.png"), +## self.tr("Search VirusTotal"), +## self.__virusTotalSearch) +## self.virustotalSearchAct.setEnabled(False) +## vttb.addSeparator() +## self.virustotalScanCurrentAct = vttb.addAction( +## UI.PixmapCache.getIcon("virustotal.png"), +## self.tr("Scan current site"), +## self.__virusTotalScanCurrentSite) +## if not Preferences.getHelp("VirusTotalEnabled") or \ +## Preferences.getHelp("VirusTotalServiceKey") == "": +## self.virustotalSearchEdit.setEnabled(False) +## self.virustotalScanCurrentAct.setEnabled(False) def __nextTab(self): """ @@ -2506,16 +2506,16 @@ self.tabWidget.preferencesChanged() self.searchEdit.preferencesChanged() - - self.__virusTotal.preferencesChanged() - if not Preferences.getHelp("VirusTotalEnabled") or \ - Preferences.getHelp("VirusTotalServiceKey") == "": - self.virustotalSearchEdit.setEnabled(False) - self.virustotalScanCurrentAct.setEnabled(False) - else: - self.virustotalSearchEdit.setEnabled(True) - self.virustotalScanCurrentAct.setEnabled(True) - self.__virusTotalSearchChanged(self.virustotalSearchEdit.text()) +## +## self.__virusTotal.preferencesChanged() +## if not Preferences.getHelp("VirusTotalEnabled") or \ +## Preferences.getHelp("VirusTotalServiceKey") == "": +## self.virustotalSearchEdit.setEnabled(False) +## self.virustotalScanCurrentAct.setEnabled(False) +## else: +## self.virustotalSearchEdit.setEnabled(True) +## self.virustotalScanCurrentAct.setEnabled(True) +## self.__virusTotalSearchChanged(self.virustotalSearchEdit.text()) def masterPasswordChanged(self, oldPassword, newPassword): """ @@ -3580,78 +3580,78 @@ super(HelpWindow, self).keyPressEvent(evt) - ########################################################################### - ## Interface to VirusTotal below ## - ########################################################################### - - def __virusTotalSearchChanged(self, txt): - """ - Private slot to react upon changes of the VirusTotal search text. - - @param txt contents of the search (string) - """ - self.virustotalSearchAct.setEnabled( - txt != "" and - Preferences.getHelp("VirusTotalEnabled") and - Preferences.getHelp("VirusTotalServiceKey") != "") - - def __virusTotalSearch(self): - """ - Private slot to search VirusTotal for a given entry. - """ - search = self.virustotalSearchEdit.text() - if search: - from .VirusTotalApi import VirusTotalAPI - requestData = VirusTotalAPI.getSearchRequestData(search) - self.newTab(requestData=requestData) - - def __virusTotalScanCurrentSite(self): - """ - Private slot to ask VirusTotal for a scan of the URL of the current - browser. - """ - cb = self.currentBrowser() - if cb is not None: - url = cb.url() - if url.scheme() in ["http", "https", "ftp"]: - self.requestVirusTotalScan(url) - - def requestVirusTotalScan(self, url): - """ - Public method to submit a request to scan an URL by VirusTotal. - - @param url URL to be scanned (QUrl) - """ - self.__virusTotal.submitUrl(url) - - def __virusTotalSubmitUrlError(self, msg): - """ - Private slot to handle an URL scan submission error. - - @param msg error message (str) - """ - E5MessageBox.critical( - self, - self.tr("VirusTotal Scan"), - self.tr("""<p>The VirusTotal scan could not be""" - """ scheduled.<p>\n<p>Reason: {0}</p>""").format(msg)) - - def __virusTotalUrlScanReport(self, url): - """ - Private slot to initiate the display of the URL scan report page. - - @param url URL of the URL scan report page (string) - """ - self.newTab(url) - - def __virusTotalFileScanReport(self, url): - """ - Private slot to initiate the display of the file scan report page. - - @param url URL of the file scan report page (string) - """ - self.newTab(url) - +## ########################################################################### +## ## Interface to VirusTotal below ## +## ########################################################################### +## +## def __virusTotalSearchChanged(self, txt): +## """ +## Private slot to react upon changes of the VirusTotal search text. +## +## @param txt contents of the search (string) +## """ +## self.virustotalSearchAct.setEnabled( +## txt != "" and +## Preferences.getHelp("VirusTotalEnabled") and +## Preferences.getHelp("VirusTotalServiceKey") != "") +## +## def __virusTotalSearch(self): +## """ +## Private slot to search VirusTotal for a given entry. +## """ +## search = self.virustotalSearchEdit.text() +## if search: +## from .VirusTotalApi import VirusTotalAPI +## requestData = VirusTotalAPI.getSearchRequestData(search) +## self.newTab(requestData=requestData) +## +## def __virusTotalScanCurrentSite(self): +## """ +## Private slot to ask VirusTotal for a scan of the URL of the current +## browser. +## """ +## cb = self.currentBrowser() +## if cb is not None: +## url = cb.url() +## if url.scheme() in ["http", "https", "ftp"]: +## self.requestVirusTotalScan(url) +## +## def requestVirusTotalScan(self, url): +## """ +## Public method to submit a request to scan an URL by VirusTotal. +## +## @param url URL to be scanned (QUrl) +## """ +## self.__virusTotal.submitUrl(url) +## +## def __virusTotalSubmitUrlError(self, msg): +## """ +## Private slot to handle an URL scan submission error. +## +## @param msg error message (str) +## """ +## E5MessageBox.critical( +## self, +## self.tr("VirusTotal Scan"), +## self.tr("""<p>The VirusTotal scan could not be""" +## """ scheduled.<p>\n<p>Reason: {0}</p>""").format(msg)) +## +## def __virusTotalUrlScanReport(self, url): +## """ +## Private slot to initiate the display of the URL scan report page. +## +## @param url URL of the URL scan report page (string) +## """ +## self.newTab(url) +## +## def __virusTotalFileScanReport(self, url): +## """ +## Private slot to initiate the display of the file scan report page. +## +## @param url URL of the file scan report page (string) +## """ +## self.newTab(url) +## def reloadUserStyleSheet(self): """ Public method to reload the user style sheet.
--- a/Preferences/ConfigurationDialog.py Fri Jul 24 18:28:13 2015 +0200 +++ b/Preferences/ConfigurationDialog.py Fri Jul 24 18:44:45 2015 +0200 @@ -277,9 +277,9 @@ [self.tr("Help Viewers"), "preferences-helpviewers.png", "HelpViewersPage", "0helpPage", None], - "helpVirusTotalPage": - [self.tr("VirusTotal Interface"), "virustotal.png", - "HelpVirusTotalPage", "0helpPage", None], +## "helpVirusTotalPage": +## [self.tr("VirusTotal Interface"), "virustotal.png", +## "HelpVirusTotalPage", "0helpPage", None], "helpWebBrowserPage": [self.tr("eric6 Web Browser"), "ericWeb.png", "HelpWebBrowserPage", "0helpPage", None], @@ -342,9 +342,9 @@ [self.tr("Help Documentation"), "preferences-helpdocumentation.png", "HelpDocumentationPage", "0helpPage", None], - "helpVirusTotalPage": - [self.tr("VirusTotal Interface"), "virustotal.png", - "HelpVirusTotalPage", "0helpPage", None], +## "helpVirusTotalPage": +## [self.tr("VirusTotal Interface"), "virustotal.png", +## "HelpVirusTotalPage", "0helpPage", None], "helpWebBrowserPage": [self.tr("eric6 Web Browser"), "ericWeb.png", "HelpWebBrowserPage", "0helpPage", None],