def tslash(apath):
 if (apath and (apath != '.') and (not apath.endswith('/')) and (not apath.endswith('\\'))):
  return (apath + '/')
 else:
  return apath

def tslash ( apath ) : if ( apath and ( apath != '.' ) and ( not apath . endswith ( '/' ) ) and ( not apath . endswith ( '\\' ) ) ) : return ( apath + '/' ) else : return apath
add a trailing slash to a path if it needs one .