Module Expr Str Import alias Import alias Import alias Import alias ImportFrom alias Import alias ImportFrom alias Import alias Import alias ImportFrom alias Import alias Import alias Import alias Expr Call AttributeLoad NameLoad attr Str Str Expr Call AttributeLoad NameLoad attr Str Str ImportFrom alias Import alias Assign NameStore TupleLoad Num Num Num Num ClassDef bases NameLoad body Assign NameStore Num Assign NameStore NameLoad Assign NameStore Dict Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults Str ListLoad body Expr Str Assign NameStore ListLoad TupleLoad Str Str If NameLoad body Assign NameStore Call NameLoad NameLoad For NameStore NameLoad body Assign SubscriptStore NameLoad Index SubscriptLoad NameLoad Index Num Call AttributeLoad Str attr SubscriptLoad NameLoad Slice Num Expr Call NameLoad SubscriptLoad AttributeLoad NameLoad attr Index NameLoad NameLoad Return ListLoad Str decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults ListLoad body Assign NameStore NameLoad Assign NameStore ListLoad TupleLoad Str Str Assign NameStore Call NameLoad NameLoad For NameStore NameLoad body Assign SubscriptStore NameLoad Index SubscriptLoad NameLoad Index Num Call AttributeLoad Str attr SubscriptLoad NameLoad Slice Num If BoolOpAnd Call NameLoad NameLoad Str CompareIn Str NameLoad body Expr Call AttributeLoad NameLoad attr Num Assign NameStore Call SubscriptLoad NameLoad Index Str NameLoad AttributeLoad NameLoad attr orelse If Call NameLoad NameLoad Str body Expr Call AttributeLoad NameLoad attr Num Assign NameStore Call NameLoad Lambda arguments args defaults Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Str orelse Assign NameStore NameLoad Expr Call NameLoad Str NameLoad Return NameLoad decorator_list decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam defaults Str body Expr Str Assign AttributeStore NameLoad attr ListLoad Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults NameLoad kwarg body Expr Str If NameLoad body Assign NameStore Call NameLoad Lambda arguments args defaults NameLoad Call AttributeLoad NameLoad attr orelse Assign NameStore Call AttributeLoad NameLoad attr Expr Call AttributeLoad AttributeLoad NameLoad attr attr TupleLoad Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Str NameLoad CompareGt Call AttributeLoad NameLoad attr Str Num decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Assign NameStore Call AttributeLoad Call AttributeLoad NameLoad attr Str Str attr Str Assign NameStore NameLoad Assign NameStore NameLoad Assign NameStore Call NameLoad Assign NameStore BoolOpOr Call AttributeLoad NameLoad attr Str Str Assign NameStore Call AttributeLoad NameLoad attr Str Call AttributeLoad NameLoad attr Str Str Call AttributeLoad NameLoad attr Str If UnaryOpNot Call AttributeLoad NameLoad attr Str body For TupleStore NameStore NameStore NameStore AttributeLoad NameLoad attr body If NameLoad body Assign NameStore Call AttributeLoad NameLoad attr BinOpAdd BinOpAdd NameLoad Str NameLoad orelse Assign NameStore Call AttributeLoad NameLoad attr NameLoad If NameLoad body Assign NameStore SubscriptLoad NameLoad Index Call AttributeLoad NameLoad attr Str Str If NameLoad body Break orelse Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr If NameLoad body Assign SubscriptStore NameLoad Index Str Call AttributeLoad NameLoad attr Str Assign NameStore Call NameLoad BoolOpOr Call AttributeLoad NameLoad attr Str TupleLoad ListLoad Dict Assign SubscriptStore NameLoad Index Num TupleLoad Call AttributeLoad Call NameLoad SubscriptLoad NameLoad Index Num attr Call AttributeLoad NameLoad attr Expr Call AttributeLoad SubscriptLoad NameLoad Index Num attr Call AttributeLoad NameLoad attr Assign SubscriptStore NameLoad Index Str Call NameLoad NameLoad Return Call NameLoad NameLoad NameLoad orelse If NameLoad body Return Call AttributeLoad NameLoad attr NameLoad NameLoad Str keyword ListLoad TupleLoad Str Call AttributeLoad Str attr NameLoad orelse Return Call AttributeLoad NameLoad attr NameLoad NameLoad Str decorator_list decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam defaults kwarg body Expr Str Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Assign NameStore SubscriptLoad BoolOpOr Call AttributeLoad NameLoad attr Str TupleLoad ListLoad Dict Index Num If CompareIn Str NameLoad body Assign NameStore Call AttributeLoad SubscriptLoad NameLoad Index Str attr Str orelse Assign NameStore Call AttributeLoad Call AttributeLoad NameLoad attr Str Str attr Str Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Str Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr If UnaryOpNot Call AttributeLoad NameLoad attr NameLoad body Return Call AttributeLoad NameLoad attr NameLoad NameLoad Str If UnaryOpNot Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad body Return Call AttributeLoad NameLoad attr NameLoad NameLoad Str Assign NameStore AttributeLoad Call AttributeLoad NameLoad attr NameLoad attr Assign TupleStore NameStore NameStore TupleLoad Call NameLoad NameLoad Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Assign NameStore ListLoad TupleLoad Str Str TupleLoad Str Call AttributeLoad AttributeLoad NameLoad attr attr Call AttributeLoad NameLoad attr TupleLoad Str NameLoad TupleLoad Str NameLoad Assign NameStore Call NameLoad NameLoad Assign SubscriptStore NameLoad Index Str BoolOpOr SubscriptLoad Call AttributeLoad NameLoad attr NameLoad Index Num Str Assign NameStore Call AttributeLoad NameLoad attr Str If BoolOpAnd NameLoad CompareGtE Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad body Return Call AttributeLoad NameLoad attr NameLoad NameLoad Str NameLoad Assign NameStore Call AttributeLoad NameLoad attr Str If BoolOpAnd NameLoad BoolOpOr CompareEq NameLoad Str CompareIn NameLoad NameLoad body Return Call AttributeLoad NameLoad attr NameLoad NameLoad Str NameLoad Assign NameStore Call NameLoad NameLoad Str Return Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad NameLoad decorator_list decorator_list ClassDef bases NameLoad body Assign NameStore Call NameLoad ListLoad Str Str Str Str Str Assign NameStore NameLoad FunctionDef arguments args NameParam defaults kwarg body Expr Str Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults body Expr Str Assign NameStore SubscriptLoad BoolOpOr Call AttributeLoad NameLoad attr Str TupleLoad ListLoad Dict Index Num Assign NameStore BoolOpOr Call AttributeLoad NameLoad attr Str Str If CompareNotIn NameLoad ListLoad Str Str body Return Call AttributeLoad NameLoad attr NameLoad NameLoad Str Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr Call AttributeLoad Call AttributeLoad Call AttributeLoad BoolOpOr Call AttributeLoad NameLoad attr Str Str attr Str attr Str attr Str Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr If UnaryOpNot Call AttributeLoad NameLoad attr NameLoad body Return Call AttributeLoad NameLoad attr NameLoad NameLoad Str If UnaryOpNot Call AttributeLoad NameLoad attr keyword NameLoad keyword NameLoad keyword NameLoad body Return Call AttributeLoad NameLoad attr NameLoad NameLoad Str TryExcept body Assign NameStore Call AttributeLoad NameLoad attr NameLoad handlers ExceptHandler body Assign NameStore ListLoad If UnaryOpNot Call AttributeLoad AttributeLoad NameLoad attr attr ListComp Call AttributeLoad NameLoad attr comprehension NameStore NameLoad body If UnaryOpNot BoolOpAnd AttributeLoad NameLoad attr CompareEq NameLoad Str body Return Call AttributeLoad NameLoad attr NameLoad NameLoad Str orelse Assign NameStore NameLoad Assign NameStore BoolOpOr Call AttributeLoad Call AttributeLoad SubscriptLoad NameLoad Slice Call NameLoad NameLoad attr AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr ListLoad Str For NameStore NameLoad body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad If UnaryOpNot Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad body TryExcept body Expr Call AttributeLoad NameLoad attr NameLoad handlers ExceptHandler body Return Call AttributeLoad NameLoad attr NameLoad NameLoad Str Break orelse If BoolOpOr UnaryOpNot Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Call AttributeLoad AttributeLoad NameLoad attr attr ListComp Call AttributeLoad NameLoad attr comprehension NameStore Call AttributeLoad NameLoad attr NameLoad body Return Call AttributeLoad NameLoad attr NameLoad NameLoad Str If Call AttributeLoad NameLoad attr BinOpMod Str NameLoad keyword NameLoad body Return Call AttributeLoad NameLoad attr NameLoad NameLoad Str Assign SubscriptStore NameLoad Index Str NameLoad Assign SubscriptStore NameLoad Index Str NameLoad Return NameLoad decorator_list decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam defaults kwarg body Expr Str Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Assign NameStore Dict Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad If NameLoad body Return NameLoad Assign NameStore SubscriptLoad NameLoad Index Str Assign NameStore SubscriptLoad NameLoad Index Str Assign NameStore BinOpMod Str NameLoad TryExcept body Assign NameStore Call AttributeLoad NameLoad attr BinOpMod Str TupleLoad SubscriptLoad NameLoad Slice Num NameLoad keyword ListLoad Call NameLoad BinOpAdd BinOpAdd Call AttributeLoad SubscriptLoad Call NameLoad BinOpAdd Call NameLoad NameLoad Num Slice Num attr Num Str NameLoad Str keyword Call NameLoad keyword Call AttributeLoad NameLoad attr Str Str handlers ExceptHandler type NameLoad name NameStore body Expr Call AttributeLoad SubscriptLoad NameLoad Index Str attr Call NameLoad NameLoad Return Call AttributeLoad NameLoad attr NameLoad NameLoad Str Assign NameStore ListLoad TupleLoad Str BinOpMod Str Call NameLoad NameLoad Return Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad NameLoad decorator_list decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam defaults kwarg body Expr Str Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Assign NameStore Dict Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad If NameLoad body Return NameLoad Assign NameStore SubscriptLoad NameLoad Index Str Assign NameStore SubscriptLoad NameLoad Index Str TryExcept body Assign NameStore Call NameLoad Call AttributeLoad NameLoad attr Str Str handlers ExceptHandler body Assign NameStore NameLoad Assign NameStore Call AttributeLoad NameLoad attr Str TupleLoad Num Num If BoolOpAnd CompareGtE SubscriptLoad NameLoad Index Num Num CompareGtE SubscriptLoad NameLoad Index Num Num body Assign NameStore NameLoad orelse Assign NameStore NameLoad Assign NameStore Call AttributeLoad NameLoad attr Str If NameLoad body Assign NameStore NameLoad orelse If CompareGt NameLoad AttributeLoad NameLoad attr body Assign NameStore AttributeLoad NameLoad attr Assign NameStore NameLoad Assign NameStore Call AttributeLoad NameLoad attr While CompareGtE NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad AugAssignSub NameStore NameLoad Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Num orelse Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore BinOpMod Str TupleLoad SubscriptLoad NameLoad Slice Num NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad keyword Num keyword NameLoad keyword AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr keyword Call NameLoad keyword Call AttributeLoad NameLoad attr Str Str If Call NameLoad NameLoad NameLoad body Assign TupleStore NameStore NameStore Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr orelse TryExcept body Assign NameStore Call AttributeLoad NameLoad attr keyword Call NameLoad NameLoad Assign TupleStore NameStore NameStore Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr handlers ExceptHandler type NameLoad body Assign TupleStore NameStore NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call NameLoad NameLoad If CompareEq NameLoad Str body Expr Call AttributeLoad NameLoad attr BinOpMod Str NameLoad keyword NameLoad Assign NameStore ListLoad TupleLoad Str BinOpMod Str Call AttributeLoad NameLoad attr Str Return Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad NameLoad decorator_list decorator_list FunctionDef arguments args defaults vararg kwarg body Expr Str Assign NameStore ListLoad ListLoad Str Str ListLoad Str Str Assign NameStore Call NameLoad NameLoad Assign NameStore Call NameLoad NameLoad Expr Call AttributeLoad NameLoad attr NameLoad While BoolOpAnd NameLoad NameLoad body Assign NameStore Call AttributeLoad NameLoad attr Num Assign NameStore Call AttributeLoad NameLoad attr Num Assign SubscriptStore NameLoad Index SubscriptLoad NameLoad Index Num NameLoad Assign SubscriptStore NameLoad Index Str Call AttributeLoad AttributeLoad NameLoad attr attr Call AttributeLoad SubscriptLoad NameLoad Index Str attr Str Assign SubscriptStore NameLoad Index Str Call AttributeLoad SubscriptLoad NameLoad Index Str attr Str Assign NameStore Call NameLoad Assign NameStore Call NameLoad NameLoad Assign NameStore Call NameLoad NameLoad Assign NameStore Call NameLoad NameLoad If SubscriptLoad NameLoad Index Str body Assign NameStore BinOpAdd BinOpAdd Str SubscriptLoad NameLoad Index Str Str orelse Assign NameStore Str Expr Call AttributeLoad NameLoad attr BinOpAdd NameLoad Str keyword NameLoad keyword NameLoad Expr Call AttributeLoad NameLoad attr BinOpAdd NameLoad Str keyword NameLoad Expr Call AttributeLoad NameLoad attr BinOpAdd NameLoad Str keyword NameLoad keyword NameLoad Return NameLoad decorator_list If CompareEq NameLoad Str body Assign NameStore Str Import alias Assign NameStore Dict Str Str Str Str Str Str Assign NameStore NameLoad For NameStore AttributeLoad NameLoad attr body If Call AttributeLoad NameLoad attr Str body Assign SubscriptStore NameLoad Index SubscriptLoad NameLoad Slice Num NameLoad Assign NameStore SubscriptLoad NameLoad Slice Num orelse If NameLoad body Assign SubscriptStore NameLoad Index NameLoad Call AttributeLoad Call AttributeLoad NameLoad attr Str attr Str Assign NameStore NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr SubscriptLoad NameLoad Index Str If CompareIn Str NameLoad body Print NameLoad orelse Assign NameStore Call NameLoad keyword NameLoad keyword SubscriptLoad NameLoad Index Str keyword Dict Str NameLoad ImportFrom alias Assign NameStore Call AttributeLoad NameLoad attr TupleLoad Str Call NameLoad SubscriptLoad NameLoad Index Str NameLoad If SubscriptLoad NameLoad Index Str body Assign NameStore BinOpMod Str SubscriptLoad NameLoad Index Str Assign NameStore BinOpMod Str TupleLoad SubscriptLoad NameLoad Index Str SubscriptLoad NameLoad Index Str SubscriptLoad NameLoad Index Str orelse Assign NameStore Str Assign NameStore BinOpMod Str SubscriptLoad NameLoad Index Str Print BinOpMod Str TupleLoad SubscriptLoad NameLoad Index Str NameLoad NameLoad NameLoad TryFinally body TryExcept body Expr Call AttributeLoad NameLoad attr handlers ExceptHandler type NameLoad body Pass finalbody Expr Call AttributeLoad NameLoad attr
N/A N/A 
Module provides WSGI-based methods for handling HTTP Get and Post requests that
are specific only to git-http-backend's Smart HTTP protocol.

See __version__ statement below for indication of what version of Git's
Smart HTTP server this backend is (designed to be) compatible with.

Copyright (c) 2010  Daniel Dotsenko <dotsa@hotmail.com>
Selected, specifically marked so classes are also
  Copyright (C) 2006 Luke Arno - http://lukearno.com/

This file is part of git_http_backend.py Project.

git_http_backend.py Project is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 2.1 of the License, or
(at your option) any later version.

git_http_backend.py Project is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License
along with git_http_backend.py Project.  If not, see <http://www.gnu.org/licenses/>.
 N/A io N/A os N/A sys N/A subprocess N/A subprocessio N/A tempfile wsgiref.headers Headers N/A re N/A urlparse collections defaultdict N/A time N/A email.utils N/A mimetypes N/A N/A N/A mimetypes add_type application/x-git-packed-objects-toc .idx N/A N/A N/A mimetypes add_type application/x-git-packed-objects .pack cStringIO StringIO N/A gzip N/A __version__ N/A 1 7 0 4 BaseWSGIClass N/A object N/A N/A bufsize 65536 N/A gzip_response False N/A canned_collection N/A 304 not_modified 301 moved 400 bad_request 401 access_denied 401.4 403 forbidden 404 not_found 405 method_not_allowed 417 execution_failed 200 501 not_implemented 304 Not Modified 304 Not Modified 301 Moved Permanently 301 Moved Permanently 400 Bad request 400 Bad request 401 Access denied 401 Access denied 401.4 Authorization failed by filter 403 Forbidden 403 Forbidden 404 Not Found 404 Not Found 405 Method Not Allowed 405 Method Not Allowed 417 Execution failed 417 Execution failed 200 OK 501 Not Implemented 501 Not Implemented canned_handlers N/A N/A self environ start_response code headers N/A 200 N/A N/A N/A 
        We convert an error code into
        certain action over start_response and return a WSGI-compliant payload.
         N/A headerbase N/A N/A Content-Type text/plain N/A headers N/A N/A hObj N/A Headers headerbase N/A header headers N/A N/A N/A hObj N/A N/A header N/A 0 N/A N/A ;  join N/A header N/A 1 N/A N/A start_response N/A N/A self canned_collection N/A code headerbase N/A N/A N/A package_response N/A N/A self outIO environ start_response headers N/A N/A N/A N/A newheaders headers N/A headers N/A N/A Content-type application/octet-stream N/A headersIface N/A Headers headers N/A header newheaders N/A N/A N/A headersIface N/A N/A header N/A 0 N/A N/A ;  join N/A header N/A 1 N/A N/A N/A hasattr outIO fileno N/A wsgi.file_wrapper environ N/A N/A N/A N/A outIO seek 0 N/A retobj N/A N/A environ N/A wsgi.file_wrapper outIO N/A self bufsize N/A N/A N/A hasattr outIO read N/A N/A N/A N/A outIO seek 0 N/A retobj N/A iter N/A N/A N/A N/A N/A N/A outIO read N/A self bufsize N/A N/A retobj outIO N/A N/A start_response 200 OK headers N/A retobj N/A N/A WSGIHandlerSelector N/A BaseWSGIClass N/A N/A 
    WSGI middleware for URL paths and HTTP method based delegation.

    This middleware is commonly called a "selector" or "router."

    Features:

    Regex-based patterns:
    Normally these are implemented as meta-url-language-to-regex
    translators, where you describe a URI matching pattern in
    URI-looking way, with regex-like pattern group name areas.
    These later are converted to plain regex by the selector's code.
    Since you need to learn that meta-URI-matching-language and
    have the usual routers translate those to regex, I have decided
    to cut out the middle-man and just define the URI patterns in
    regex from the start.
    This way a WSGI app programmer needs to learn only one meta-URI-matching
    language - standard Python regex. Thus, the insanity should stop here.

    Support for matching based on HTTP verb:
    Want to handle POSTs and GETs on the same URI by different wsgi app? Sure!

    Support for routing based on URI query parameters:
    Want "host/app?special_arg=value" to be routed to different wsgi app
    compared to "host/app?other_arg=value" or "host/app"? Sure!

    See documentation for .add() method for examples.

    Based on Selector from http://lukearno.com/projects/selector/

    Copyright (c) 2010 Daniel Dotsenko <dotsa@hotmail.com>
    Copyright (C) 2006 Luke Arno - http://lukearno.com/
     __init__ N/A N/A self WSGI_env_key N/A WSGIHandlerSelector N/A N/A 
        WSGIHandlerSelector instance initializer.

        WSGIHandlerSelector(WSGI_env_key = 'WSGIHandlerSelector')

        Inputs:
         WSGI_env_key (optional)
          name of the key selector injects into WSGI's environ.
          The key will be the base for other dicts, like .matches - the key-value pairs of
          name-matchedtext matched groups. Defaults to 'WSGIHandlerSelector'
         N/A N/A self mappings N/A N/A N/A self WSGI_env_key WSGI_env_key N/A add N/A N/A self path default_handler N/A None http_methods N/A N/A 
        Add a selector mapping.

        add(path, default_handler, **named_handlers)

        Adding order is important. Firt added = first matched.
        If you want to hand special case URI handled by one app and shorter
        version of the same regex string by anoter app,
        .add() special case first.

        Inputs:
         path - A regex string. We will compile it.
          Highly recommend using grouping of type: "(?P<groupname>.+)"
          These will be exposed to WSGI app through environment key
          per http://www.wsgi.org/wsgi/Specifications/routing_args

         default_handler - (optional) A pointer to the function / iterable
          class instance that will handle ALL HTTP methods (verbs)

         **named_handlers - (optional) An unlimited list of named args or
          an unpacked dict of handlers allocated to handle specific HTTP
          methods (HTTP verbs). See "Examples" below.

        Matched named method handlers override default handler.

        If neither default_handler nor named_handlers point to any methods,
        "Method not implemented" is returned for the requests on this URI.

        Examples:
        selectorInstance.add('^(?P<working_path>.*)$',generic_handler,
                              POST=post_handler, HEAD=head_handler)

        custom_assembled_dict = {'GET':wsgi_app_a,'POST':wsgi_app_b}:
        ## note the unpacking - "**" - of the dict in this case.
        selectorInstance.add('^(?P<working_path>.*)$', **custom_assembled_dict)


        If the string contains '\?' (escaped ?, which translates to '?' in
        non-regex strings) we understand that as "do regex matching on
        QUERY_PATH + '?' + QUERY_STRING"

        When lookup matches are met, results are injected into
        environ['wsgiorg.routing_args'] per
        http://www.wsgi.org/wsgi/Specifications/routing_args
         N/A default_handler N/A N/A methods N/A defaultdict N/A N/A N/A N/A default_handler N/A N/A http_methods copy N/A N/A methods N/A N/A http_methods copy N/A N/A N/A N/A self mappings append N/A N/A N/A re compile N/A N/A path decode utf8 methods N/A N/A N/A path find \? -1 N/A __call__ N/A N/A self environ start_response N/A N/A N/A 
        Delegate request to the appropriate WSGI app.

        The following keys will be added to the WSGI's environ:

        wsgiorg.routing_args
            It's a tuple of a list and a dict. The structure is per this spec:
            http://www.wsgi.org/wsgi/Specifications/routing_args

        WSGIHandlerSelector.matched_request_methods
            It's a list of strings denoting other HTTP verbs / methods the
            matched URI (not chosen handler!) accepts for processing.
            This matters when

         N/A path N/A N/A N/A N/A environ get GIT_PATH_INFO decode utf8 N/A matches None N/A handler None N/A alternate_HTTP_verbs N/A set N/A query_string N/A N/A N/A environ get QUERY_STRING N/A path N/A N/A urlparse urljoin / N/A N/A re sub //+ / N/A N/A path strip / N/A N/A N/A N/A path startswith /../ N/A N/A N/A _regex _registered_methods _use_query_string N/A self mappings N/A N/A _use_query_string N/A N/A matches N/A N/A _regex search N/A N/A path ? query_string N/A N/A matches N/A N/A _regex search path N/A matches N/A N/A handler N/A _registered_methods N/A N/A N/A environ get REQUEST_METHOD N/A handler N/A N/A N/A N/A N/A N/A alternate_HTTP_verbs update N/A N/A _registered_methods keys N/A handler N/A N/A N/A environ N/A GIT_PATH_INFO N/A N/A path encode utf8 N/A mg N/A list N/A N/A N/A environ get wsgiorg.routing_args N/A N/A N/A N/A N/A mg N/A 0 N/A N/A N/A N/A list N/A mg N/A 0 append N/A N/A matches groups N/A N/A N/A N/A mg N/A 1 update N/A N/A matches groupdict N/A N/A environ N/A wsgiorg.routing_args N/A tuple mg N/A N/A handler environ start_response N/A N/A alternate_HTTP_verbs N/A N/A N/A N/A self canned_handlers environ start_response method_not_allowed headers N/A N/A Allow N/A N/A ,  join alternate_HTTP_verbs N/A N/A N/A N/A self canned_handlers environ start_response not_found N/A N/A StaticWSGIServer N/A BaseWSGIClass N/A N/A 
    Copyright (c) 2010  Daniel Dotsenko <dotsa@hotmail.com>
    Copyright (C) 2006 Luke Arno - http://lukearno.com/

    A simple WSGI-based static content server app.

    Relies on WSGIHandlerSelector for prepopulating some needed environ
    variables, cleaning up the URI, setting up default error handlers.
     __init__ N/A N/A self N/A kw N/A N/A 
        Inputs:
            content_path (mandatory)
                String containing a file-system level path behaving as served root.

            bufsize (optional)
                File reader's buffer size. Defaults to 65536.

            gzip_response (optional) (must be named arg)
                Specify if we are to detect if gzip compression is supported
                by client and gzip the output. False by default.
         N/A N/A N/A N/A self __dict__ update kw N/A __call__ N/A N/A self environ start_response N/A N/A N/A selector_matches N/A N/A N/A N/A environ get wsgiorg.routing_args N/A N/A N/A N/A 1 N/A N/A working_path selector_matches N/A N/A path_info N/A N/A N/A selector_matches N/A working_path decode utf8 N/A N/A path_info N/A N/A N/A N/A environ get GIT_PATH_INFO decode utf8 N/A full_path N/A N/A N/A os path abspath N/A N/A N/A os path join N/A self content_path N/A N/A path_info strip / N/A _pp N/A N/A N/A os path abspath N/A self content_path N/A N/A N/A N/A full_path startswith _pp N/A N/A N/A N/A self canned_handlers environ start_response forbidden N/A N/A N/A N/A N/A os path isfile full_path N/A N/A N/A N/A self canned_handlers environ start_response not_found N/A mtime N/A N/A N/A os stat full_path st_mtime N/A N/A etag last_modified N/A N/A str mtime N/A N/A N/A email utils formatdate mtime N/A headers N/A N/A Content-type text/plain N/A Date N/A N/A N/A email utils formatdate N/A N/A time time N/A Last-Modified last_modified N/A ETag etag N/A headersIface N/A Headers headers N/A N/A headersIface N/A Content-Type N/A N/A N/A N/A mimetypes guess_type full_path N/A 0 application/octet-stream N/A if_modified N/A N/A environ get HTTP_IF_MODIFIED_SINCE N/A N/A if_modified N/A N/A N/A N/A email utils parsedate if_modified N/A N/A N/A email utils parsedate last_modified N/A N/A N/A N/A self canned_handlers environ start_response not_modified headers N/A if_none N/A N/A environ get HTTP_IF_NONE_MATCH N/A N/A if_none N/A N/A if_none * N/A etag if_none N/A N/A N/A N/A self canned_handlers environ start_response not_modified headers N/A file_like N/A open full_path rb N/A N/A N/A self package_response file_like environ start_response headers N/A N/A GitHTTPBackendBase N/A BaseWSGIClass N/A N/A git_folder_signature N/A set N/A config head info objects refs N/A repo_auto_create True has_access N/A N/A self N/A kw N/A N/A 
        User rights verification code.
        (This is NOT an authentication code. The authentication is handled by
        the server that hosts this WSGI app. We just go by the name of the
        already-authenticated user.
         N/A True N/A basic_checks N/A N/A self dataObj environ start_response N/A N/A N/A 
        This function is shared by GitInfoRefs and SmartHTTPRPCHandler WSGI classes.
        It does the same basic steps - figure out working path, git command etc.

        dataObj - dictionary
        Because the dataObj passed in is mutable, it's a pointer. Once this function returns,
        this object, as created by calling class, will have the free-form updated data.

        Returns non-None object if an error was triggered (and already prepared in start_response).
         N/A selector_matches N/A N/A N/A N/A environ get wsgiorg.routing_args N/A N/A N/A N/A 1 N/A git_command N/A N/A N/A selector_matches get git_command N/A N/A git_command N/A git-upload-pack git-receive-pack N/A N/A N/A N/A self canned_handlers environ start_response bad_request N/A repo_path N/A N/A N/A os path abspath N/A N/A N/A os path join N/A self content_path N/A N/A N/A N/A N/A N/A N/A N/A N/A selector_matches get working_path decode utf8 strip / strip \ N/A _pp N/A N/A N/A os path abspath N/A self content_path N/A N/A N/A N/A repo_path startswith _pp N/A N/A N/A N/A self canned_handlers environ start_response forbidden N/A N/A N/A N/A self has_access environ environ repo_path repo_path git_command git_command N/A N/A N/A N/A self canned_handlers environ start_response forbidden N/A N/A N/A files N/A N/A os listdir repo_path N/A N/A N/A N/A files N/A N/A N/A N/A N/A N/A self git_folder_signature issubset N/A N/A N/A i lower N/A i files N/A N/A N/A N/A N/A self repo_auto_create N/A git_command git-receive-pack N/A N/A N/A N/A self canned_handlers environ start_response not_found N/A N/A _pf _pp N/A _dirs N/A N/A N/A N/A N/A N/A repo_path N/A N/A len _pp strip N/A os sep split N/A os sep N/A N/A _dir _dirs N/A N/A _pf N/A N/A N/A os path join _pf _dir N/A N/A N/A N/A N/A os path exists _pf N/A N/A N/A N/A N/A N/A os makedirs repo_path N/A N/A N/A N/A N/A N/A self canned_handlers environ start_response not_found N/A N/A N/A N/A N/A N/A N/A N/A os path isdir _pf N/A N/A N/A self git_folder_signature issubset N/A N/A N/A i lower N/A i N/A N/A os listdir _pf N/A N/A N/A N/A self canned_handlers environ start_response forbidden N/A N/A N/A subprocess call N/A git init --quiet --bare "%s" repo_path shell True N/A N/A N/A N/A self canned_handlers environ start_response execution_failed N/A N/A dataObj N/A git_command git_command N/A N/A dataObj N/A repo_path repo_path N/A None N/A N/A GitHTTPBackendInfoRefs N/A GitHTTPBackendBase N/A N/A 
    Implementation of a WSGI handler (app) specifically capable of responding
    to git-http-backend (Git Smart HTTP) /info/refs call over HTTP GET.

    This is the fist step in the RPC dialog. We have to reply with right content
    to show to Git client that we are an "intelligent" server.

    The "right" content is special header and custom top 2 rows of data in the response.
     __init__ N/A N/A self N/A kw N/A N/A 
        inputs:
            content_path (Mandatory) - Local file system path = root of served files.
            bufsize (Default = 65536) Chunk size for WSGI file feeding
            gzip_response (Default = False) Compress response body
         N/A N/A N/A N/A self __dict__ update kw N/A __call__ N/A N/A self environ start_response N/A N/A N/A WSGI Response producer for HTTP GET Git Smart HTTP /info/refs request. N/A dataObj N/A N/A answer N/A N/A self basic_checks dataObj environ start_response N/A answer N/A N/A answer N/A git_command N/A dataObj N/A git_command N/A repo_path N/A dataObj N/A repo_path N/A smart_server_advert N/A # service=%s git_command N/A N/A N/A out N/A N/A subprocessio SubprocessIOChunker N/A git %s --stateless-rpc --advertise-refs "%s" N/A N/A git_command N/A 4 repo_path starting_values N/A N/A str N/A N/A N/A N/A N/A N/A hex N/A N/A len smart_server_advert 4 N/A 2 rjust 4 0 smart_server_advert 0000 env N/A dict CODE_REMOTE_USER N/A N/A environ get REMOTE_USER N/A N/A N/A EnvironmentError N/A e N/A N/A N/A N/A N/A environ N/A wsgi.errors write N/A str e N/A N/A N/A self canned_handlers environ start_response execution_failed N/A headers N/A N/A Content-type N/A application/x-%s-advertisement N/A str git_command N/A N/A N/A self package_response out environ start_response headers N/A N/A GitHTTPBackendSmartHTTP N/A GitHTTPBackendBase N/A N/A 
    Implementation of a WSGI handler (app) specifically capable of responding
    to git-http-backend (Git Smart HTTP) RPC calls sent over HTTP POST.

    This is a layer that responds to HTTP POSTs to URIs like:
        /repo_folder_name/git-upload-pack?service=upload-pack (or same for receive-pack)

    This is a second step in the RPC dialog. Another handler for HTTP GETs to
    /repo_folder_name/info/refs (as implemented in a separate WSGI handler below)
    must reply in a specific way in order for the Git client to decide to talk here.
     __init__ N/A N/A self N/A kw N/A N/A 
        content_path
            Local file system path = root of served files.
        optional parameters may be passed as named arguments
            These include
                bufsize (Default = 65536) Chunk size for WSGI file feeding
                gzip_response (Default = False) Compress response body
         N/A N/A N/A N/A self __dict__ update kw N/A __call__ N/A N/A self environ start_response N/A N/A N/A 
        WSGI Response producer for HTTP POST Git Smart HTTP requests.
        Reads commands and data from HTTP POST's body.
        returns an iterator obj with contents of git command's response to stdout
         N/A dataObj N/A N/A answer N/A N/A self basic_checks dataObj environ start_response N/A answer N/A N/A answer N/A git_command N/A dataObj N/A git_command N/A repo_path N/A dataObj N/A repo_path N/A N/A N/A _l N/A int N/A N/A environ get CONTENT_LENGTH N/A N/A N/A N/A _l None N/A wsgi_version N/A N/A environ get wsgi.version N/A 1 0 N/A N/A N/A N/A wsgi_version N/A 0 1 N/A N/A wsgi_version N/A 1 1 N/A N/A wsgi_input_has_EOF True N/A N/A wsgi_input_has_EOF False N/A _i N/A N/A environ get wsgi.input N/A wsgi_input_has_EOF N/A N/A stdin _i N/A N/A N/A _l N/A self bufsize N/A N/A bs N/A self bufsize N/A btr _l N/A stdin N/A N/A tempfile TemporaryFile N/A N/A btr bs N/A N/A N/A N/A stdin write N/A N/A _i read bs N/A btr bs N/A N/A N/A stdin write N/A N/A _i read btr N/A N/A N/A stdin flush N/A N/A N/A stdin seek 0 N/A N/A stdin N/A N/A _i read _l N/A cmd N/A git %s --stateless-rpc "%s" N/A N/A git_command N/A 4 repo_path N/A _p N/A N/A subprocess Popen cmd bufsize -1 shell True stdin N/A subprocess PIPE stdout N/A subprocess PIPE env N/A dict CODE_REMOTE_USER N/A N/A environ get REMOTE_USER N/A N/A isinstance stdin file N/A N/A N/A out _ N/A N/A _p communicate N/A N/A stdin read N/A N/A N/A N/A fp N/A N/A gzip GzipFile fileobj N/A StringIO stdin N/A N/A out _ N/A N/A _p communicate N/A N/A fp read N/A N/A N/A IOError N/A N/A N/A out _ N/A N/A _p communicate stdin N/A out N/A StringIO out N/A N/A git_command git-receive-pack N/A N/A N/A N/A subprocess call N/A git --git-dir "%s" update-server-info repo_path shell True N/A headers N/A N/A Content-type N/A application/x-%s-result N/A N/A git_command encode utf8 N/A N/A N/A self package_response out environ start_response headers N/A N/A assemble_WSGI_git_app N/A N/A N/A args kw N/A N/A 
    Assembles basic WSGI-compatible application providing functionality of git-http-backend.

    content_path (Defaults to '.' = "current" directory)
        The path to the folder that will be the root of served files. Accepts relative paths.

    uri_marker (Defaults to '')
        Acts as a "virtual folder" separator between decorative URI portion and
        the actual (relative to content_path) path that will be appended to
        content_path and used for pulling an actual file.

        the URI does not have to start with contents of uri_marker. It can
        be preceeded by any number of "virtual" folders. For --uri_marker 'my'
        all of these will take you to the same repo:
            http://localhost/my/HEAD
            http://localhost/admysf/mylar/zxmy/my/HEAD
        This WSGI hanlder will cut and rebase the URI when it's time to read from file system.

        Default of '' means that no cutting marker is used, and whole URI after FQDN is
        used to find file relative to content_path.

    returns WSGI application instance.
     N/A default_options N/A N/A content_path . N/A uri_marker N/A args N/A list args N/A options N/A dict default_options N/A N/A N/A options update kw N/A N/A default_options args N/A N/A _d N/A N/A default_options pop 0 N/A _a N/A N/A args pop 0 N/A N/A options N/A N/A _d N/A 0 _a N/A N/A options N/A content_path N/A N/A N/A os path abspath N/A N/A N/A options N/A content_path decode utf8 N/A N/A options N/A uri_marker N/A N/A N/A options N/A uri_marker decode utf8 N/A selector N/A WSGIHandlerSelector N/A generic_handler N/A StaticWSGIServer options N/A git_inforefs_handler N/A GitHTTPBackendInfoRefs options N/A git_rpc_handler N/A GitHTTPBackendSmartHTTP options N/A N/A options N/A uri_marker N/A N/A marker_regex N/A N/A (?P<decorative_path>.*?)(?:/ N/A options N/A uri_marker ) N/A N/A marker_regex N/A N/A N/A selector add N/A marker_regex (?P<working_path>.*?)/info/refs\?.*?service=(?P<git_command>git-[^&]+).*$ GET git_inforefs_handler HEAD git_inforefs_handler N/A N/A N/A selector add N/A marker_regex (?P<working_path>.*)/(?P<git_command>git-[^/]+)$ POST git_rpc_handler N/A N/A N/A selector add N/A marker_regex (?P<working_path>.*)$ GET generic_handler HEAD generic_handler N/A selector N/A N/A N/A __name__ __main__ N/A N/A _help 
git_http_backend.py - Python-based server supporting regular and "Smart HTTP"

Note only the folder that contains folders and object that you normally see
in .git folder is considered a "repo folder." This means that either a
"bare" folder name or a working folder's ".git" folder will be a "repo" folder
discussed in the examples below.

When "repo-auto-create on Push" is used, the server automatically creates "bare"
repo folders.

Note, the folder does NOT have to have ".git" in the name to be a "repo" folder.
You can name bare repo folders whatever you like. If the signature (right files
and folders are found inside) matches a typical git repo, it's a "repo."

Options:
--content_path (Defaults to '.' - current directory)
        Serving contents of folder path passed in. Accepts relative paths,
        including things like "./../" and resolves them agains current path.

        If you set this to actual .git folder, you don't need to specify the
        folder's name on URI.

--uri_marker (Defaults to '')
        Acts as a "virtual folder" - separator between decorative URI portion
        and the actual (relative to content_path) path that will be appended
        to content_path and used for pulling an actual file.

        the URI does not have to start with contents of uri_marker. It can
        be preceeded by any number of "virtual" folders.
        For --uri_marker 'my' all of these will take you to the same repo:
                http://localhost/my/HEAD
                http://localhost/admysf/mylar/zxmy/my/HEAD
        If you are using reverse proxy server, pick the virtual, decorative URI
        prefix / path of your choice. This hanlder will cut and rebase the URI.

        Default of '' means that no cutting marker is used, and whole URI after
        FQDN is used to find file relative to content_path.

--port (Defaults to 8080)

Examples:

cd c:\myproject_workingfolder\.git
c:\tools\git_http_backend\GitHttpBackend.py --port 80
        (Current path is used for serving.)
        This project's repo will be one and only served directly over
         http://localhost/

cd c:\repos_folder
c:\tools\git_http_backend\GitHttpBackend.py
        (note, no options are provided. Current path is used for serving.)
        If the c:\repos_folder contains repo1.git, repo2.git folders, they
        become available as:
         http://localhost:8080/repo1.git  and  http://localhost:8080/repo2.git

~/myscripts/GitHttpBackend.py --content_path "~/somepath/repofolder" --uri_marker "myrepo"
        Will serve chosen repo folder as http://localhost/myrepo/ or
        http://localhost:8080/does/not/matter/what/you/type/here/myrepo/
        This "repo uri marker" is useful for making a repo server appear as a
        part of some REST web application or make it appear as a part of server
        while serving it from behind a reverse proxy.

./GitHttpBackend.py --content_path ".." --port 80
        Will serve the folder above the "git_http_backend" (in which
        GitHttpBackend.py happened to be located.) A functional url could be
         http://localhost/git_http_backend/GitHttpBackend.py
        Let's assume the parent folder of git_http_backend folder has a ".git"
        folder. Then the repo could be accessed as:
         http://localhost/.git/
        This allows GitHttpBackend.py to be "self-serving" :)
 N/A sys N/A command_options N/A content_path uri_marker port . 8080 N/A lastKey None N/A item N/A sys argv N/A N/A N/A N/A item startswith -- N/A N/A N/A command_options N/A N/A item N/A 2 True N/A lastKey N/A item N/A 2 N/A N/A lastKey N/A N/A N/A command_options N/A lastKey N/A N/A N/A N/A item strip " strip ' N/A lastKey None N/A content_path N/A N/A N/A os path abspath N/A command_options N/A content_path N/A N/A help command_options N/A N/A _help N/A N/A app N/A assemble_WSGI_git_app content_path content_path uri_marker N/A command_options N/A uri_marker performance_settings N/A repo_auto_create True cherrypy wsgiserver N/A httpd N/A N/A wsgiserver CherryPyWSGIServer N/A 0.0.0.0 N/A int N/A command_options N/A port app N/A N/A command_options N/A uri_marker N/A N/A _s N/A "/%s/". N/A command_options N/A uri_marker N/A example_URI N/A http://localhost:%s/whatever/you/want/here/%s/myrepo.git
    (Note: "whatever/you/want/here" cannot include the "/%s/" segment) N/A N/A command_options N/A port N/A command_options N/A uri_marker N/A command_options N/A uri_marker N/A N/A _s not chosen. N/A example_URI N/A http://localhost:%s/myrepo.git N/A command_options N/A port N/A N/A 
===========================================================================
Run this command with "--help" option to see available command-line options

Starting git-http-backend server...
        Port: %s
        Chosen repo folders' base file system path: %s
        URI segment indicating start of git repo foler name is %s

Example repo url would be:
    %s

Use Keyboard Interrupt key combination (usually CTRL+C) to stop the server
===========================================================================
 N/A N/A command_options N/A port content_path _s example_URI N/A N/A N/A N/A N/A N/A N/A httpd start N/A N/A N/A KeyboardInterrupt N/A N/A N/A N/A N/A N/A httpd stop