From c5f63dfec9cd16a90894d9b2c62bd148dfa5a01e Mon Sep 17 00:00:00 2001 From: Evan Battaglia Date: Thu, 27 Dec 2007 18:37:50 +0000 Subject: [PATCH] DEBUG option for gcget. --- ChangeLog | 5 +++++ tools/gcget | 12 +++++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index bc0dcdca..e464e39b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2007-12-27: +Evan Battaglia + * Minor fixes/debugging to gcget. Add gcget-perl + * Full screen mode. + 2007-12-27: Guilhem Bonnefille : * Add GpxWritingOptions to control GPX file writing diff --git a/tools/gcget b/tools/gcget index 37231d54..05aecb5c 100755 --- a/tools/gcget +++ b/tools/gcget @@ -45,12 +45,14 @@ Happy caching!!! # # try: - opts, args = getopt.gnu_getopt(sys.argv[1:], "u:p:", ["help"]) + opts, args = getopt.gnu_getopt(sys.argv[1:], "u:p:d", ["help"]) except getopt.GetoptError: # print help information and exit: help() sys.exit(2) +DEBUG = False + for o, a in opts: if o == "-p": PASS = a @@ -59,6 +61,8 @@ for o, a in opts: if o == "--help" or o == "-h": help() sys.exit() + if o == "-d": + DEBUG = True if len(args) < 2: help() @@ -109,7 +113,13 @@ try: b.select_form("form4") except: print >> sys.stderr, "Invalid username/password" + if DEBUG: + f=open("gcget.badlogin.html","w") + f.write(b.response().get_data()) + f.close() + print >> sys.stderr, "Dumping last HTML page recieved into gcget.badlogin.html" sys.exit() + b["origin_lat"] = lat b["origin_long"] = lon b["dist"] = maxdist -- 2.39.5