mirror of https://github.com/vitalif/phantomjs
Revert most of commit c8f45c2d
parent
c8f45c2d15
commit
3581fae3c0
|
@ -133,7 +133,7 @@ class QPyFile(QFile):
|
|||
def __enter__(self):
|
||||
return self
|
||||
|
||||
def __exit__(self, _, _, _):
|
||||
def __exit__(self, exc_type, exc_value, traceback):
|
||||
self.close()
|
||||
|
||||
def __init__(self, filename, mode='r'):
|
||||
|
|
|
@ -87,20 +87,20 @@ class CustomPage(QWebPage):
|
|||
|
||||
do_action('CustomPageInit')
|
||||
|
||||
def chooseFile(self, _, _):
|
||||
def chooseFile(self, originatingFrame, oldFile):
|
||||
return self.m_uploadFile
|
||||
|
||||
def shouldInterruptJavaScript(self):
|
||||
QApplication.processEvents(QEventLoop.AllEvents, 42)
|
||||
return False
|
||||
|
||||
def javaScriptAlert(self, _, msg):
|
||||
def javaScriptAlert(self, originatingFrame, msg):
|
||||
self.parent().javaScriptAlertSent.emit(msg)
|
||||
|
||||
def javaScriptConsoleMessage(self, message, lineNumber, sourceID):
|
||||
self.parent().javaScriptConsoleMessageSent.emit(message, lineNumber, sourceID)
|
||||
|
||||
def userAgentForUrl(self, _):
|
||||
def userAgentForUrl(self, url):
|
||||
return self.m_userAgent
|
||||
|
||||
do_action('CustomPage')
|
||||
|
|
Loading…
Reference in New Issue