[Checkins] SVN: lovely.buildouthttp/trunk/ logging and license

Bernd Dorn bernd.dorn at lovelysystems.com
Mon Jun 18 02:18:54 EDT 2007


Log message for revision 76751:
  logging and license

Changed:
  U   lovely.buildouthttp/trunk/CHANGES.txt
  U   lovely.buildouthttp/trunk/setup.py
  U   lovely.buildouthttp/trunk/src/lovely/buildouthttp/buildouthttp.py

-=-
Modified: lovely.buildouthttp/trunk/CHANGES.txt
===================================================================
--- lovely.buildouthttp/trunk/CHANGES.txt	2007-06-18 01:02:19 UTC (rev 76750)
+++ lovely.buildouthttp/trunk/CHANGES.txt	2007-06-18 06:18:54 UTC (rev 76751)
@@ -2,6 +2,13 @@
 Changes for lovely.buildouthttp
 ===============================
 
+After 0.1.0a1:
+==============
+
+- Fixed license header
+
+- Log connections on debug.
+
 2007/06/14 0.1.0a1:
 ===================
 

Modified: lovely.buildouthttp/trunk/setup.py
===================================================================
--- lovely.buildouthttp/trunk/setup.py	2007-06-18 01:02:19 UTC (rev 76750)
+++ lovely.buildouthttp/trunk/setup.py	2007-06-18 06:18:54 UTC (rev 76751)
@@ -3,7 +3,7 @@
 name='lovely.buildouthttp'
 setup(
     name=name,
-    version = "0.1.0a1",
+    version = "0.1.0a2",
     author = "Lovely Systems",
     author_email = "office at lovelysystems.com",
     description = "Specialized zc.buildout plugin to add http basic" \

Modified: lovely.buildouthttp/trunk/src/lovely/buildouthttp/buildouthttp.py
===================================================================
--- lovely.buildouthttp/trunk/src/lovely/buildouthttp/buildouthttp.py	2007-06-18 01:02:19 UTC (rev 76750)
+++ lovely.buildouthttp/trunk/src/lovely/buildouthttp/buildouthttp.py	2007-06-18 06:18:54 UTC (rev 76751)
@@ -1,6 +1,6 @@
 ##############################################################################
 #
-# Copyright (c) 2006 Zope Corporation and Contributors.
+# Copyright (c) 2007 Lovely Systems and Contributors.
 # All Rights Reserved.
 #
 # This software is subject to the provisions of the Zope Public License,
@@ -11,6 +11,9 @@
 # FOR A PARTICULAR PURPOSE.
 #
 ##############################################################################
+"""
+$Id$
+"""
 
 import urllib2
 import os
@@ -19,6 +22,15 @@
 import logging
 log = logging.getLogger('lovely.buildouthttp')
 
+class CredHandler(urllib2.HTTPBasicAuthHandler):
+
+    def http_error_401(self, req, fp, code, msg, headers):
+        log.debug('getting url: %r' % req.get_full_url())
+        res =  urllib2.HTTPBasicAuthHandler.http_error_401(self,req, fp, code,
+                                                           msg, headers)
+        log.debug('got url: %r %r' % (res.url, res.code))
+        return res
+
 def install(buildout=None):
     try:
         pwdsf = file(os.path.join(os.path.expanduser('~'),
@@ -28,9 +40,10 @@
         log.warn('Could not load authentication information: %s' % e)
         return
     reader = csv.reader(pwdsf)
-    auth_handler = urllib2.HTTPBasicAuthHandler()
+    auth_handler = CredHandler()
     for row in reader:
         realm, uris, user, password = row
+        log.debug('Added credentials %r, %r' % (realm, uris))
         auth_handler.add_password(realm, uris, user, password)
     opener = urllib2.build_opener(auth_handler)
     urllib2.install_opener(opener)



More information about the Checkins mailing list