def path_to_local_directory_uri(relpath):
 if isinstance(relpath, compat.text_type):
  relpath = relpath.encode(u'utf-8')
 return (u'local:directory:%s' % urllib.quote(relpath))

def path_to_local_directory_uri ( relpath ) : if isinstance ( relpath , compat . text_type ) : relpath = relpath . encode ( u'utf-8' ) return ( u'local:directory:%s' % urllib . quote ( relpath ) )
convert path relative to :confval:local/media_dir to directory uri .