OSDN Git Service

Add HTTP header output.
[fukui-no-namari/fukui-no-namari.git] / src / FukuiNoNamari / thread_window.py
index 153d85e..ad7e392 100644 (file)
@@ -39,7 +39,7 @@ import idxfile
 import session
 import board_window
 import uri_opener
-from http_sub import HTTPRedirectHandler302
+from http_sub import HTTPRedirectHandler302, HTTPDebugHandler
 from BbsType import bbs_type_judge_uri
 from BbsType import bbs_type_exception
 import config
@@ -262,18 +262,15 @@ class WinWrap(winwrapbase.WinWrapBase):
             req.add_header("If-Modified-Since", lastmod)
         if etag:
             req.add_header("If-None-Match", etag)
-        print req.headers
 
-        opener = urllib2.build_opener(HTTPRedirectHandler302)
+        opener = urllib2.build_opener(HTTPRedirectHandler302, HTTPDebugHandler)
         try:
             res = opener.open(req)
         except urllib2.HTTPError, e:
-            print e.info()
             gobject.idle_add(
                 self.statusbar.set_status, "%d %s" % (e.code, e.msg))
         else:
             headers = res.info()
-            print headers
             gobject.idle_add(
                 self.statusbar.set_status, "%d %s" % (res.code, res.msg))