[kupfer: 44/67] Use urllib instead of urllib2



commit c8514feacad836af6266f2d16fa052f009696c1a
Author: Ulrik Sverdrup <ulrik sverdrup gmail com>
Date:   Wed Mar 16 23:01:10 2011 +0100

    Use urllib instead of urllib2

 kupfer/plugin/core/text.py  |    4 ++--
 kupfer/plugin/urlactions.py |    4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/kupfer/plugin/core/text.py b/kupfer/plugin/core/text.py
index f246ece..3f991ef 100644
--- a/kupfer/plugin/core/text.py
+++ b/kupfer/plugin/core/text.py
@@ -1,6 +1,6 @@
 import os
 import urlparse
-import urllib2
+import urllib
 
 import gobject
 
@@ -80,7 +80,7 @@ def try_unquote_url(url):
 	except UnicodeEncodeError:
 		return url
 	try:
-		return urllib2.unquote(burl).decode("UTF-8")
+		return urllib.unquote(burl).decode("UTF-8")
 	except UnicodeDecodeError:
 		return url
 
diff --git a/kupfer/plugin/urlactions.py b/kupfer/plugin/urlactions.py
index 9dcf4e9..4b2f674 100644
--- a/kupfer/plugin/urlactions.py
+++ b/kupfer/plugin/urlactions.py
@@ -11,7 +11,7 @@ __author__ = "Ulrik Sverdrup <ulrik sverdrup gmail com>"
 
 import os
 import shutil
-import urllib2
+import urllib
 
 from kupfer.objects import Action, Source, UrlLeaf, FileLeaf, OperationError
 from kupfer import utils, pretty, task
@@ -27,7 +27,7 @@ class DownloadTask (task.ThreadTask):
 		self.use_tempfile = tempfile
 
 	def thread_do(self):
-		self.response = urllib2.urlopen(self.uri)
+		self.response = urllib.urlopen(self.uri)
 
 		def url_name(url):
 			return os.path.basename(url.rstrip("/"))



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]