From 68916a228de0a2594ae52475d527d876a5cc6499 Mon Sep 17 00:00:00 2001 From: Tim Abbott Date: Wed, 3 Oct 2012 17:21:09 -0400 Subject: [PATCH] API: Disable history in the mechanize browser. (imported from commit 8907f3af6283ab3ac72a22e936952757af56d1c3) --- common.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/common.py b/common.py index d7b47de..9c59ff8 100644 --- a/common.py +++ b/common.py @@ -6,9 +6,14 @@ from urllib2 import HTTPError import time import traceback +# TODO: Just switch to pycurl +class NoHistory(object): + def add(self, *a, **k): pass + def clear(self): pass + class HumbugAPI(): def __init__(self, email, api_key, verbose=False, site="https://app.humbughq.com"): - self.browser = mechanize.Browser() + self.browser = mechanize.Browser(history=NoHistory()) self.browser.set_handle_robots(False) self.browser.add_password("https://app.humbughq.com/", "tabbott", "xxxxxxxxxxxxxxxxx", "wiki") self.api_key = api_key