]> git.phdru.name Git - bookmarks_db.git/commitdiff
Do not split/decode query and tag - only split host and path and recode the host.
authorOleg Broytman <phd@phdru.name>
Tue, 12 Jul 2011 15:18:10 +0000 (15:18 +0000)
committerOleg Broytman <phd@phdru.name>
Tue, 12 Jul 2011 15:18:10 +0000 (15:18 +0000)
git-svn-id: file:///home/phd/archive/SVN/bookmarks_db/trunk@339 fdd5c36f-1aea-0310-aeeb-c58d7e2b6c23

bkmk_objects.py

index be139edb3e205379733c8e7d38f8db42f2ce4c77..281b95c0f57747f0a728b27046b587bd49556c89 100644 (file)
@@ -67,13 +67,6 @@ class Bookmark:
             user, password = urllib.splitpasswd(user)
          host, port = urllib.splitport(host)
          if port: port = int(port)
-      path, tag = urllib.splittag(path)
-      path, query = urllib.splitquery(path)
-      path = urllib.unquote(path)
-      if tag: tag = urllib.unquote_plus(tag)
-
-      if host: # host can be None for Mozilla's place: URLs
-          host = host.decode(parser_charset or 'utf-8').encode('idna')
 
       href = protocol + "://"
       if user:
@@ -82,18 +75,11 @@ class Bookmark:
             href += ':' + urllib.quote(password)
          href += '@'
       if host:
-         href += host
+         href += host.decode(parser_charset or 'utf-8').encode('idna')
          if port:
             href += ':%d' % port
       if path:
-         if protocol == "file":
-            href += urllib.quote(path)
-         else:
-            href += urllib.quote(path)
-      if query:
-         href += '?' + query
-      if tag:
-         href += '#' + urllib.quote_plus(tag)
+         href += path
 
       self.href = href
       self.add_date = add_date