# Path: gumpy/deco.py
# class _RequirementHepler(object):
# class _ConsumerHelper(object):
# class _EventHepler(object):
# class activate(Annotation):
# class deactivate(Annotation):
# class _TaskHelper(object):
#     def __init__(self, fn, args, kwargs):
#     def __get__(self, instance, owner):
#     def __init__(self, fn, resource_uri, cardinality):
#     def __get__(self, instance, owner):
#     def unbind(self, fn):
#     def __init__(self, fn):
#     def __get__(self, instance, owner):
# def configuration(**config_map):
#     def deco(func):
#         def configuration_injected_func(self, *args, **kwargs):
#     def subject(self):
#     def subject(self):
#     def __init__(self, fn):
#     def __get__(self, instance, owner):


import multiprocessing.pool
import functools
import wsgiref.simple_server, wsgiref.util, wsgiref.validate
import logging
from gumpy.deco import service, configuration, bind, event
        if self._server:
            self._server.shutdown()
        del self._server

    @bind('tserv.application')
    def application(self, app):
        wsgiref.validate.validator(app)
        if hasattr(app, '__route__'):
            self._apps[app.__route__] = app
        else:
            self._apps[app.__class__.__name__] = app

    @application.unbind
    def application(self, app):
        if hasattr(app, '__route__'):
            del self._apps[app.__route__]
        else:
            del self._apps[app.__class__.__name__]

    def _wsgi_app(self, environ, start_response):
        if self._apps:
            app_route = wsgiref.util.shift_path_info(environ)
            if app_route in self._apps:
                environ['SCRIPT_NAME'] = ''
                return self._apps[app_route](environ, start_response)
            elif self._rootapp:
                return self._apps[self._rootapp](environ, start_response)
        start_response('404 NOT FOUND', [('Content-type', 'text/plain'), ])
        return ['no application deployed'.encode('utf-8')]


# Path: gumpy/deco.py
# class _RequirementHepler(object):
# class _ConsumerHelper(object):
# class _EventHepler(object):
# class activate(Annotation):
# class deactivate(Annotation):
# class _TaskHelper(object):
#     def __init__(self, fn, args, kwargs):
#     def __get__(self, instance, owner):
#     def __init__(self, fn, resource_uri, cardinality):
#     def __get__(self, instance, owner):
#     def unbind(self, fn):
#     def __init__(self, fn):
#     def __get__(self, instance, owner):
# def configuration(**config_map):
#     def deco(func):
#         def configuration_injected_func(self, *args, **kwargs):
#     def subject(self):
#     def subject(self):
#     def __init__(self, fn):
#     def __get__(self, instance, owner):


# Path: huacaya/tserv.py
import multiprocessing.pool
import functools
import wsgiref.simple_server, wsgiref.util, wsgiref.validate
import logging
from gumpy.deco import service, configuration, bind, event

        if self._server:
            self._server.shutdown()
        del self._server

    @bind('tserv.application')
    def application(self, app):
        wsgiref.validate.validator(app)
        if hasattr(app, '__route__'):
            self._apps[app.__route__] = app
        else:
            self._apps[app.__class__.__name__] = app

    @application.unbind
    def application(self, app):
        if hasattr(app, '__route__'):
            del self._apps[app.__route__]
        else:
            del self._apps[app.__class__.__name__]

    def _wsgi_app(self, environ, start_response):
        if self._apps:
            app_route = wsgiref.util.shift_path_info(environ)
            if app_route in self._apps:
                environ['SCRIPT_NAME'] = ''
                return self._apps[app_route](environ, start_response)
            elif self._rootapp:
                return self._apps[self._rootapp](environ, start_response)
        start_response('404 NOT FOUND', [('Content-type', 'text/plain'), ])
        return ['no application deployed'.encode('utf-8')]


    @event