summaryrefslogtreecommitdiff
path: root/pies/urllib
diff options
context:
space:
mode:
authorTimothy Crosley <timothy.crosley@gmail.com>2013-11-13 21:59:05 -0500
committerTimothy Crosley <timothy.crosley@gmail.com>2013-11-13 21:59:05 -0500
commitf7780c91f8e50719ed8b3be641942f2db8b564e9 (patch)
tree0eeb0b72bcc8c18f700cde60de13c2c69f856480 /pies/urllib
parent4badd66c595e8d90e8ffa80ce44ab4de228ab393 (diff)
downloadpies-f7780c91f8e50719ed8b3be641942f2db8b564e9.tar.gz
First steps to pies 2.0
Diffstat (limited to 'pies/urllib')
-rw-r--r--pies/urllib/__init__.py8
-rw-r--r--pies/urllib/error.py9
-rw-r--r--pies/urllib/parse.py8
-rw-r--r--pies/urllib/request.py16
-rw-r--r--pies/urllib/robotparser.py8
5 files changed, 49 insertions, 0 deletions
diff --git a/pies/urllib/__init__.py b/pies/urllib/__init__.py
new file mode 100644
index 0000000..d6a12ff
--- /dev/null
+++ b/pies/urllib/__init__.py
@@ -0,0 +1,8 @@
+from __future__ import absolute_import
+
+from urllib import *
+
+from ..version_info import PY2
+
+if PY2:
+ from . import error, parse, request, robotparser
diff --git a/pies/urllib/error.py b/pies/urllib/error.py
new file mode 100644
index 0000000..73c85f1
--- /dev/null
+++ b/pies/urllib/error.py
@@ -0,0 +1,9 @@
+from __future__ import absolute_import
+
+from ..version_info import PY3
+
+if PY3:
+ from urllib.error import *
+else:
+ from urllib import ContentTooShortError
+ from urllib2 import HTTPError, URLError
diff --git a/pies/urllib/parse.py b/pies/urllib/parse.py
new file mode 100644
index 0000000..9cbbff3
--- /dev/null
+++ b/pies/urllib/parse.py
@@ -0,0 +1,8 @@
+from __future__ import absolute_import
+
+from ..version_info import PY3
+
+if PY3:
+ from urllib.parse import *
+else:
+ from urllib import quote, unquote, quote_plus, unquote_plus, urlencode
diff --git a/pies/urllib/request.py b/pies/urllib/request.py
new file mode 100644
index 0000000..a1470f1
--- /dev/null
+++ b/pies/urllib/request.py
@@ -0,0 +1,16 @@
+
+
+from __future__ import absolute_import
+
+from ..version_info import PY3
+
+if PY3:
+ from urllib.request import *
+else:
+ from urllib import FancyURLopener, getproxies, pathname2url, url2pathname, urlcleanup, URLopener, urlretrieve
+ from urllib2 import (AbstractBasicAuthHandler, AbstractDigestAuthHandler, BaseHandler, build_opener,
+ CacheFTPHandler, FileHandler, FTPHandler, HTTPBasicAuthHandler, HTTPCookieProcessor,
+ HTTPDefaultErrorHandler, HTTPDigestAuthHandler, HTTPHandler, HTTPPasswordMgr,
+ HTTPPasswordMgrWithDefaultRealm, HTTPRedirectHandler, HTTPSHandler, install_opener,
+ OpenerDirector, ProxyBasicAuthHandler, ProxyDigestAuthHandler, ProxyHandler, Request,
+ UnknownHandler, urlopen)
diff --git a/pies/urllib/robotparser.py b/pies/urllib/robotparser.py
new file mode 100644
index 0000000..e45b609
--- /dev/null
+++ b/pies/urllib/robotparser.py
@@ -0,0 +1,8 @@
+from __future__ import absolute_import
+
+from ..version_info import PY3
+
+if PY3:
+ from urllib.parse import *
+else:
+ from robotparser import *