def path_info_split(path_info):
 if (not path_info):
  return (None, '')
 assert path_info.startswith('/'), ('PATH_INFO should start with /: %r' % path_info)
 path_info = path_info.lstrip('/')
 if ('/' in path_info):
  (first, rest) = path_info.split('/', 1)
  return (first, ('/' + rest))
 else:
  return (path_info, '')

def path_info_split ( path_info ) : if ( not path_info ) : return ( None , '' ) assert path_info . startswith ( '/' ) , ( 'PATH_INFO should start with /: %r' % path_info ) path_info = path_info . lstrip ( '/' ) if ( '/' in path_info ) : ( first , rest ) = path_info . split ( '/' , 1 ) return ( first , ( '/' + rest ) ) else : return ( path_info , '' )
splits off the first segment of the path .