def _doc_components_from_url(url, required_locale=None, check_host=True):
 parsed = urlparse(url)
 if (check_host and parsed.netloc):
  return False
 (locale, path) = split_path(parsed.path)
 if (required_locale and (locale != required_locale)):
  return False
 path = ('/' + path)
 try:
  (view, view_args, view_kwargs) = resolve(path)
 except Http404:
  return False
 import kitsune.wiki.views
 if (view != kitsune.wiki.views.document):
  raise _NotDocumentView
 return (locale, path, view_kwargs['document_slug'])

def _doc_components_from_url ( url , required_locale = None , check_host = True ) : parsed = urlparse ( url ) if ( check_host and parsed . netloc ) : return False ( locale , path ) = split_path ( parsed . path ) if ( required_locale and ( locale != required_locale ) ) : return False path = ( '/' + path ) try : ( view , view_args , view_kwargs ) = resolve ( path ) except Http404 : return False import kitsune . wiki . views if ( view != kitsune . wiki . views . document ) : raise _NotDocumentView return ( locale , path , view_kwargs [ 'document_slug' ] )
return if url is a document .