def _space_prefix(pref, full, sep=None, indent=None, include_sep=True):
 if (sep is None):
  sep = os.path.sep
 pref = pref.split(sep)
 full = full.split(sep)
 padding = []
 while (pref and full and (pref[0] == full[0])):
  if (indent is None):
   padding.append((' ' * (len(full[0]) + len(sep))))
  else:
   padding.append((' ' * indent))
  full.pop(0)
  pref.pop(0)
 if padding:
  if include_sep:
   return ((''.join(padding) + sep) + sep.join(full))
  else:
   return (''.join(padding) + sep.join(full))
 else:
  return sep.join(full)

def _space_prefix ( pref , full , sep = None , indent = None , include_sep = True ) : if ( sep is None ) : sep = os . path . sep pref = pref . split ( sep ) full = full . split ( sep ) padding = [ ] while ( pref and full and ( pref [ 0 ] == full [ 0 ] ) ) : if ( indent is None ) : padding . append ( ( ' ' * ( len ( full [ 0 ] ) + len ( sep ) ) ) ) else : padding . append ( ( ' ' * indent ) ) full . pop ( 0 ) pref . pop ( 0 ) if padding : if include_sep : return ( ( '' . join ( padding ) + sep ) + sep . join ( full ) ) else : return ( '' . join ( padding ) + sep . join ( full ) ) else : return sep . join ( full )
anything shared by pref and full will be replaced with spaces in full .