← Back to team overview

spv-dev team mailing list archive

[Branch ~bouf10/slidepresenterview/refactor-pres-design] Rev 60: Rename URI to Uri

 

------------------------------------------------------------
revno: 60
committer: F.A. Bourbonnais <bouf10pub@xxxxxxxxxxx>
branch nick: refactor-pres-design
timestamp: Sat 2010-05-08 23:18:25 -0400
message:
  Rename URI to Uri
modified:
  slidepresenterview/tests/unit/utils/tests_uri.py
  slidepresenterview/utils/uri.py


--
lp:~bouf10/slidepresenterview/refactor-pres-design
https://code.launchpad.net/~bouf10/slidepresenterview/refactor-pres-design

Your team SlidePresenterView Development Team is subscribed to branch lp:~bouf10/slidepresenterview/refactor-pres-design.
To unsubscribe from this branch go to https://code.launchpad.net/~bouf10/slidepresenterview/refactor-pres-design/+edit-subscription
=== modified file 'slidepresenterview/tests/unit/utils/tests_uri.py'
--- slidepresenterview/tests/unit/utils/tests_uri.py	2010-05-09 02:56:23 +0000
+++ slidepresenterview/tests/unit/utils/tests_uri.py	2010-05-09 03:18:25 +0000
@@ -24,13 +24,13 @@
 
 import unittest
 
-from slidepresenterview.utils.uri import URI
+from slidepresenterview.utils.uri import Uri
 
 class TestGivenFullAsciiUri(unittest.TestCase):
     
     def setUp(self):
         self.uri_str = "http://example.com/path/to/resource.pdf?a=1&b";
-        self.uri = URI(self.uri_str)
+        self.uri = Uri(self.uri_str)
     
     
     def should_be_parsed(self):
@@ -60,7 +60,7 @@
     
     def setUp(self):
         self.uri_unicode = u"http://exaéple.com/path/t o/résource.pdf?a=é&b"
-        self.uri = URI(self.uri_unicode)
+        self.uri = Uri(self.uri_unicode)
     
     
     def should_be_parsed(self):
@@ -91,7 +91,7 @@
     
     def setUp(self):
         self.uri_unicode = u"file:///path/to/résource?a=é"
-        self.uri = URI(self.uri_unicode)
+        self.uri = Uri(self.uri_unicode)
         
         
     def should_have_file_as_scheme(self):
@@ -111,7 +111,7 @@
     
     def setUp(self):
         self.uri_unicode = u"file://c:/a é\a.pdf"
-        self.uri = URI(self.uri_unicode)
+        self.uri = Uri(self.uri_unicode)
         
         
     def should_have_file_as_scheme(self):
@@ -145,14 +145,14 @@
 class TestUriComparisons_GivenHttpScheme(unittest.TestCase):
     
     def setUp(self):
-        self.uri_base = URI(u"http://éxample.com/patéh?a=é";)
-        self.uri_same = URI(u"http://éxample.com/patéh?a=é";)
-        self.uri_same_str = URI("http://éxample.com/patéh?a=é";)
-        self.uri_diff_scheme = URI(u"https://éxample.com/patéh?a=é";)
-        self.uri_diff_netloc = URI(u"http://example.com/patéh?a=é";)
-        self.uri_diff_path = URI(u"http://éxample.com/pateh?a=é";)
-        self.uri_diff_query = URI(u"http://éxample.com/patéh?a=e";)
-        self.uri_diff_all = URI(u"https://example.com/pateh?a=e";)
+        self.uri_base = Uri(u"http://éxample.com/patéh?a=é";)
+        self.uri_same = Uri(u"http://éxample.com/patéh?a=é";)
+        self.uri_same_str = Uri("http://éxample.com/patéh?a=é";)
+        self.uri_diff_scheme = Uri(u"https://éxample.com/patéh?a=é";)
+        self.uri_diff_netloc = Uri(u"http://example.com/patéh?a=é";)
+        self.uri_diff_path = Uri(u"http://éxample.com/pateh?a=é";)
+        self.uri_diff_query = Uri(u"http://éxample.com/patéh?a=e";)
+        self.uri_diff_all = Uri(u"https://example.com/pateh?a=e";)
         
         
     def test_same_instance_should_be_equal(self):
@@ -183,11 +183,11 @@
 class TestUriComparisons_GivenFileScheme(unittest.TestCase):
     
     def setUp(self):
-        self.uri_unix_base = URI(u"file:///path/a é/fé.pdf")
-        self.uri_unix_diff_path = URI(u"file:///path/a e/fé.pdf")
-        self.uri_win_base = URI(u"file://c:\path\a é\fé.pdf")
-        self.uri_win_diff_path = URI(u"file://c:\path\a é\fe.pdf")
-        self.uri_win_base_norm = URI(u"file://c:/path/a é/fé.pdf")
+        self.uri_unix_base = Uri(u"file:///path/a é/fé.pdf")
+        self.uri_unix_diff_path = Uri(u"file:///path/a e/fé.pdf")
+        self.uri_win_base = Uri(u"file://c:\path\a é\fé.pdf")
+        self.uri_win_diff_path = Uri(u"file://c:\path\a é\fe.pdf")
+        self.uri_win_base_norm = Uri(u"file://c:/path/a é/fé.pdf")
         
         
     def test_normalisation_should_be_ignored(self):

=== modified file 'slidepresenterview/utils/uri.py'
--- slidepresenterview/utils/uri.py	2010-05-09 02:56:23 +0000
+++ slidepresenterview/utils/uri.py	2010-05-09 03:18:25 +0000
@@ -24,14 +24,14 @@
 
 from urllib2 import urlparse
 
-__all__ = ['URI']
-
-
-class URI(object):
+__all__ = ['Uri']
+
+
+class Uri(object):
     """
-    Represents an URI. 
+    Represents an Uri. 
     
-    The comparison between URI objects is content based so it is done by 
+    The comparison between Uri objects is content based so it is done by 
     comparing the uri strings.
     
     Note: Paths are not normalised (path is as is)
@@ -46,7 +46,7 @@
     Decomposition
     -------------
     
-    URI are decomposed in parts [http://example.com/path/to/resouce.pdf?a=1&b]:
+    Uri are decomposed in parts [http://example.com/path/to/resouce.pdf?a=1&b]:
       - A protocol/scheme (scheme). [http]
       - A network location (netloc) [example.com]
       - A resource path (the heading / is kept) [/path/to/resource.pdf]