def _relpath_posix(path, start=os.path.curdir):
 if (not path):
  raise ValueError('no path specified')
 start_list = os.path.abspath(start).split(os.path.sep)
 path_list = os.path.abspath(path).split(os.path.sep)
 i = len(os.path.commonprefix([start_list, path_list]))
 rel_list = (([os.path.pardir] * (len(start_list) - i)) + path_list[i:])
 if (not rel_list):
  return os.path.curdir
 return os.path.join(*rel_list)

def _relpath_posix ( path , start = os . path . curdir ) : if ( not path ) : raise ValueError ( 'no path specified' ) start_list = os . path . abspath ( start ) . split ( os . path . sep ) path_list = os . path . abspath ( path ) . split ( os . path . sep ) i = len ( os . path . commonprefix ( [ start_list , path_list ] ) ) rel_list = ( ( [ os . path . pardir ] * ( len ( start_list ) - i ) ) + path_list [ i : ] ) if ( not rel_list ) : return os . path . curdir return os . path . join ( * rel_list )
return a relative version of a path .