bundled SOAPpy-0.12.5
[p2pool.git] / SOAPpy / URLopener.py
diff --git a/SOAPpy/URLopener.py b/SOAPpy/URLopener.py
new file mode 100644 (file)
index 0000000..2c04c86
--- /dev/null
@@ -0,0 +1,23 @@
+"""Provide a class for loading data from URL's that handles basic
+authentication"""
+
+ident = '$Id: URLopener.py 541 2004-01-31 04:20:06Z warnes $'
+from version import __version__
+
+from Config import Config
+from urllib import FancyURLopener
+
+class URLopener(FancyURLopener):
+
+    username = None
+    passwd = None
+
+
+    def __init__(self, username=None, passwd=None, *args, **kw):
+        FancyURLopener.__init__( self, *args, **kw)
+        self.username = username
+        self.passwd = passwd
+
+
+    def prompt_user_passwd(self, host, realm):
+       return self.username, self.passwd