Example #1
0
 def url_to_modpath(url):
     if not url.lower().startswith("file:"):
         schema, rest = HDF5FileList.split_url(url)
         return [schema] + rest[0:1] + [urllib.unquote(part) for part in rest[1:]]
     path = urllib.url2pathname(url[5:])
     parts = []
     while True:
         new_path, part = os.path.split(path)
         if len(new_path) == 0 or len(part) == 0:
             parts.insert(0, path)
             break
         parts.insert(0, part)
         path = new_path
     return parts
Example #2
0
 def url_to_modpath(url):
     if not url.lower().startswith("file:"):
         schema, rest = HDF5FileList.split_url(url)
         return [schema] + rest[0:1] + [urllib.unquote(part) for part in rest[1:]]
     path = urllib.url2pathname(url[5:])
     parts = []
     while True:
         new_path, part = os.path.split(path)
         if len(new_path) == 0 or len(part) == 0:
             parts.insert(0, path)
             break
         parts.insert(0, part)
         path = new_path
     return parts