code: def get_path_url(path, relative=False):
      
      if relative:
          return os.path.relpath(path)
      else:
          return 'file://%s' % os.path.abspath(path)
docs: Returns an absolute or relative path url given a path