# Path: snakeguice/injector.py
# def create_injector(modules):
#     """Factory for creating Injector instances."""
#     return Injector(modules)
# 
# Path: snakeguice/modules.py
# class Module(object):
#     """Base class for all standard modules."""
# 
#     def __init__(self):
#         self._injector = None
# 
#     def install(self, binder, module):
#         """Add another module's bindings to a binder."""
#         ModuleAdapter(module, self._injector).configure(binder)
# 
#     def run_configure(self, binder):
#         """A hook for intercepting the configure method. Allows different
#         module implementations to change the binder passed to configure.
#         """
#         self.configure(binder)
# 
#     def configure(self, binder):
#         """A subclass should override this to configure a binder."""
#         raise NotImplementedError
# 
#     def set_injector(self, injector):
#         self._injector = injector
# 
# Path: snakeguice/extras/snakeweb.py
# def is_unbound_method(func):
#     def __init__(self, mapper, annotation):
#     def connect(self, *args, **kwargs):
#     def match(self, url, environ):
#     def run_configure(self, binder):
#     def configure(self, routes_binder):
#     def configure(self, routes_binder):
#     def __init__(self, injector):
#     def __call__(self, environ, start_response):
#     def controller_from_class(self, controller, action):
#     def controller_from_method(self, controller):
# class RoutesBinder(object):
# class RoutesModule(Module):
# class AutoRoutesModule(RoutesModule):
# class Application(object):


from wsgiref.simple_server import make_server
from snakeguice import create_injector
from snakeguice.modules import Module
from snakeguice.extras import snakeweb
"""A really simple 'Hello, World' webapp to test snakeweb."""



class HWController(object):

    def index(self, request):
        return snakeweb.Response('Hello, World!<br>I see you are from: {0}'
                                 .format(request.remote_addr))

    def hello_name(self, request, name):
        return snakeweb.Response('Hello, {0}!'.format(name))


class HWModule(Module):

    def configure(self, binder):
        self.install(binder, HWRoutes())



# Path: snakeguice/injector.py
# def create_injector(modules):
#     """Factory for creating Injector instances."""
#     return Injector(modules)
# 
# Path: snakeguice/modules.py
# class Module(object):
#     """Base class for all standard modules."""
# 
#     def __init__(self):
#         self._injector = None
# 
#     def install(self, binder, module):
#         """Add another module's bindings to a binder."""
#         ModuleAdapter(module, self._injector).configure(binder)
# 
#     def run_configure(self, binder):
#         """A hook for intercepting the configure method. Allows different
#         module implementations to change the binder passed to configure.
#         """
#         self.configure(binder)
# 
#     def configure(self, binder):
#         """A subclass should override this to configure a binder."""
#         raise NotImplementedError
# 
#     def set_injector(self, injector):
#         self._injector = injector
# 
# Path: snakeguice/extras/snakeweb.py
# def is_unbound_method(func):
#     def __init__(self, mapper, annotation):
#     def connect(self, *args, **kwargs):
#     def match(self, url, environ):
#     def run_configure(self, binder):
#     def configure(self, routes_binder):
#     def configure(self, routes_binder):
#     def __init__(self, injector):
#     def __call__(self, environ, start_response):
#     def controller_from_class(self, controller, action):
#     def controller_from_method(self, controller):
# class RoutesBinder(object):
# class RoutesModule(Module):
# class AutoRoutesModule(RoutesModule):
# class Application(object):


# Path: examples/snakeweb/simple_hello_world.py
from wsgiref.simple_server import make_server
from snakeguice import create_injector
from snakeguice.modules import Module
from snakeguice.extras import snakeweb

"""A really simple 'Hello, World' webapp to test snakeweb."""



class HWController(object):

    def index(self, request):
        return snakeweb.Response('Hello, World!<br>I see you are from: {0}'
                                 .format(request.remote_addr))

    def hello_name(self, request, name):
        return snakeweb.Response('Hello, {0}!'.format(name))


class HWModule(Module):

    def configure(self, binder):
        self.install(binder, HWRoutes())



class HWRoutes(snakeweb.RoutesModule):