From cd42de28dc5ab4439628a8a91be09e08e2bdb331 Mon Sep 17 00:00:00 2001 From: epage Date: Thu, 1 Oct 2009 00:43:24 +0000 Subject: [PATCH] Updating changelog git-svn-id: file:///svnroot/gc-dialer/trunk@492 c39d3808-3fe2-4d86-a59f-b7f623ee9f21 --- src/gv_views.py | 1 - support/builddeb.py | 2 + tests/gv_samples/generate_gv_samples.py | 141 +++++++++++++++++-------------- 3 files changed, 78 insertions(+), 66 deletions(-) diff --git a/src/gv_views.py b/src/gv_views.py index dabc7d2..0c07cd1 100644 --- a/src/gv_views.py +++ b/src/gv_views.py @@ -19,7 +19,6 @@ License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA @todo Alternate UI for dialogs (stackables) -@todo Get descriptions with the callback number """ from __future__ import with_statement diff --git a/support/builddeb.py b/support/builddeb.py index ec14d75..feb7aa3 100755 --- a/support/builddeb.py +++ b/support/builddeb.py @@ -23,6 +23,8 @@ __version__ = constants.__version__ __build__ = constants.__build__ __changelog__ = """ 1.0.7 +* Sped up various login cases +* Added descriptions to the callback numbers * Debugging: Improved logging output 1.0.6 diff --git a/tests/gv_samples/generate_gv_samples.py b/tests/gv_samples/generate_gv_samples.py index 0953779..2a1fbf3 100755 --- a/tests/gv_samples/generate_gv_samples.py +++ b/tests/gv_samples/generate_gv_samples.py @@ -1,10 +1,13 @@ #!/usr/bin/env python +from __future__ import with_statement + import os import urllib import urllib2 import traceback import warnings +import logging import sys sys.path.append("/usr/lib/dialcentral") @@ -13,70 +16,78 @@ sys.path.append("../../src") import browser_emu import gv_backend -webpages = [ - ("login", gv_backend.GVDialer._loginURL), - ("contacts", gv_backend.GVDialer._contactsURL), - ("voicemail", gv_backend.GVDialer._voicemailURL), - ("sms", gv_backend.GVDialer._smsURL), - ("forward", gv_backend.GVDialer._forwardURL), - ("recent", gv_backend.GVDialer._recentCallsURL), - ("placed", gv_backend.GVDialer._placedCallsURL), - ("recieved", gv_backend.GVDialer._receivedCallsURL), - ("missed", gv_backend.GVDialer._missedCallsURL), -] - - -# Create Browser -browser = browser_emu.MozillaEmulator(1) -cookieFile = os.path.join(".", ".gv_cookies.txt") -browser.cookies.filename = cookieFile - -# Get Pages -for name, url in webpages: - try: - page = browser.download(url) - except StandardError, e: - print e.message - continue - with open("not_loggedin_%s.txt" % name, "w") as f: - f.write(page) - -# Login -username = sys.argv[1] -password = sys.argv[2] - -loginPostData = urllib.urlencode({ - 'Email' : username, - 'Passwd' : password, - 'service': "grandcentral", - "ltmpl": "mobile", - "btmpl": "mobile", - "PersistentCookie": "yes", -}) - -try: - loginSuccessOrFailurePage = browser.download(gv_backend.GVDialer._loginURL, loginPostData) -except urllib2.URLError, e: - warnings.warn(traceback.format_exc()) - raise RuntimeError("%s is not accesible" % gv_backend.GVDialer._loginURL) -with open("loggingin.txt", "w") as f: - f.write(loginSuccessOrFailurePage) - -forwardPage = browser.download(gv_backend.GVDialer._forwardURL) - -tokenGroup = gv_backend.GVDialer._tokenRe.search(forwardPage) -if tokenGroup is None: - print forwardPage - raise RuntimeError("Could not extract authentication token from GoogleVoice") -token = tokenGroup.group(1) - -# Get Pages -for name, url in webpages: + +def main(): + webpages = [ + ("login", gv_backend.GVDialer._loginURL), + ("contacts", gv_backend.GVDialer._contactsURL), + ("voicemail", gv_backend.GVDialer._voicemailURL), + ("sms", gv_backend.GVDialer._smsURL), + ("forward", gv_backend.GVDialer._forwardURL), + ("recent", gv_backend.GVDialer._recentCallsURL), + ("placed", gv_backend.GVDialer._placedCallsURL), + ("recieved", gv_backend.GVDialer._receivedCallsURL), + ("missed", gv_backend.GVDialer._missedCallsURL), + ] + + + # Create Browser + browser = browser_emu.MozillaEmulator(1) + cookieFile = os.path.join(".", ".gv_cookies.txt") + browser.cookies.filename = cookieFile + + # Get Pages + for name, url in webpages: + try: + page = browser.download(url) + except StandardError, e: + print e.message + continue + print "Writing to file" + with open("not_loggedin_%s.txt" % name, "w") as f: + f.write(page) + + # Login + username = sys.argv[1] + password = sys.argv[2] + + loginPostData = urllib.urlencode({ + 'Email' : username, + 'Passwd' : password, + 'service': "grandcentral", + "ltmpl": "mobile", + "btmpl": "mobile", + "PersistentCookie": "yes", + }) + try: - page = browser.download(url) - except StandardError, e: + loginSuccessOrFailurePage = browser.download(gv_backend.GVDialer._loginURL, loginPostData) + except urllib2.URLError, e: warnings.warn(traceback.format_exc()) - continue - print "Writing to file" - with open("loggedin_%s.txt" % name, "w") as f: - f.write(page) + raise RuntimeError("%s is not accesible" % gv_backend.GVDialer._loginURL) + with open("loggingin.txt", "w") as f: + f.write(loginSuccessOrFailurePage) + + forwardPage = browser.download(gv_backend.GVDialer._forwardURL) + + tokenGroup = gv_backend.GVDialer._tokenRe.search(forwardPage) + if tokenGroup is None: + print forwardPage + raise RuntimeError("Could not extract authentication token from GoogleVoice") + token = tokenGroup.group(1) + + # Get Pages + for name, url in webpages: + try: + page = browser.download(url) + except StandardError, e: + warnings.warn(traceback.format_exc()) + continue + print "Writing to file" + with open("loggedin_%s.txt" % name, "w") as f: + f.write(page) + + +if __name__ == "__main__": + logging.basicConfig(level=logging.DEBUG) + main() -- 1.7.9.5