def get_path_sortkey(path):
 if ((path == '') or path.endswith('/')):
  return path
 head = os.path.split(path)[0]
 return u'~'.join([head, path])

def get_path_sortkey ( path ) : if ( ( path == '' ) or path . endswith ( '/' ) ) : return path head = os . path . split ( path ) [ 0 ] return u'~' . join ( [ head , path ] )
returns the sortkey to use for a path .