Changeset 1462
- Timestamp:
- 07/07/08 07:41:10 (2 months ago)
- Location:
- trunk
- Files:
-
- 4 modified
-
peppy/frame.py (modified) (1 diff)
-
peppy/fundamental.py (modified) (1 diff)
-
peppy/vfs/itools/uri/generic.py (modified) (2 diffs)
-
tests/test_vfs.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/peppy/frame.py
r1457 r1462 690 690 @return: True if URL was found, False if not. 691 691 """ 692 mode = self.tabs.moveSelectionToURL(url) 692 normalized = vfs.normalize(url) 693 self.dprint("url=%s normalized=%s" % (url, normalized)) 694 mode = self.tabs.moveSelectionToURL(normalized) 693 695 if mode: 694 url = vfs.normalize(url) 695 mode.showInitialPosition(url) 696 mode.showInitialPosition(normalized) 696 697 return mode is not None 697 698 -
trunk/peppy/fundamental.py
r1458 r1462 593 593 594 594 def showInitialPosition(self, url): 595 self.dprint("url=%s scheme=%s auth=%s path=%s query=%s fragment=%s" % (url, url.scheme, url.authority, url.path, url.query, url.fragment)) 595 596 if url.fragment: 596 597 line = int(url.fragment) -
trunk/peppy/vfs/itools/uri/generic.py
r1026 r1462 738 738 scheme, authority, path, query, fragment = urlsplit(data) 739 739 740 # Some special cases for Windows paths 740 # Some special cases for Windows paths c:/a/b#4 and file:///c:/a/b#4. 741 # urlsplit has problems with the scheme, leading slashes in the path, 742 # and doesn't split out the fragment properly 741 743 if len(scheme) == 1: 742 744 # found a windows drive name instead of path, because urlsplit 743 745 # thinks the scheme is "c" for Windows paths like "c:/a/b" 746 if "#" in path: 747 # the fragment is improperly placed in the path 748 path, fragment = path.rsplit("#", 1) 744 749 path = "%s:%s" % (scheme, path) 745 750 scheme = "file" … … 748 753 # like "file:///c:/a/b" -- it thinks the path is "/c:/a/b", which 749 754 # to be correct requires removing the leading slash. 750 path = "%s:%s" % (path[1].lower(), path[3:]) 755 drive = path[1].lower() 756 path = path[3:] 757 if "#" in path: 758 path, fragment = path.rsplit("#", 1) 759 path = "%s:%s" % (drive, path) 751 760 752 761 # The path -
trunk/tests/test_vfs.py
r929 r1462 187 187 self.assertEqual('c:/stuff/blah', uri.path) 188 188 self.assertEqual('file', uri.scheme) 189 uri = vfs.get_reference('c:/stuff/blah#5') 190 self.assertEqual('c:/stuff/blah', str(uri.path)) 191 self.assertEqual('5', uri.fragment) 192 self.assertEqual('file', uri.scheme) 189 193 190 194 def test_windows_normalize(self):
