Skip to content

Commit

Permalink
Merge branch 'fix_popup_collection' of git://github.com/EverythingMe/…
Browse files Browse the repository at this point in the history
…Ghost.py into EverythingMe-fix_popup_collection

Conflicts:
	ghost/ghost.py
  • Loading branch information
jeanphix committed May 4, 2013
2 parents ddfc356 + 33fd016 commit 30f6e9f
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions ghost/ghost.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@ def javaScriptConfirm(self, frame, message):
message)
self.ghost.append_popup_message(message)
confirmation, callback = Ghost._confirm_expected
Ghost._confirm_expected = None
Logger.log("confirm('%s')" % message, sender="Frame")
if callback is not None:
return callback()
Expand All @@ -134,11 +133,11 @@ def javaScriptPrompt(self, frame, message, defaultValue, result=None):
if result_value == '':
Logger.log("'%s' prompt filled with empty string" % message,
level='warning')
Ghost._prompt_expected = None

if result is None:
# PySide
return True, result_value
result.append(result_value)
result.append(unicode(result_value))
return True

def setUserAgent(self, user_agent):
Expand Down Expand Up @@ -581,8 +580,10 @@ def open(self, address, method='get', headers={}, auth=None, body=None,

self.main_frame.load(request, method, body)
self.loaded = False
Ghost._prompt_expected = (default_popup_response, None)
Ghost._confirm_expected = (default_popup_response, None)

if default_popup_response is not None:
Ghost._prompt_expected = (default_popup_response, None)
Ghost._confirm_expected = (default_popup_response, None)

return self.wait_for_page_loaded()

Expand Down Expand Up @@ -764,7 +765,7 @@ def set_viewport_size(self, width, height):
self.page.setViewportSize(QSize(width, height))

def append_popup_message(self, message):
self.popup_messages.append(str(message))
self.popup_messages.append(unicode(message))

def show(self):
"""Show current page inside a QWebView.
Expand Down

0 comments on commit 30f6e9f

Please sign in to comment.