Merge pull request #978 from markshannon/python-turbogears

Python: Add support for turbogears; requests and responses.
This commit is contained in:
Taus
2019-02-26 21:46:01 +01:00
committed by GitHub
21 changed files with 273 additions and 5 deletions

View File

@@ -0,0 +1,30 @@
def validate(validators):
def validator(func):
return func
def expose(*args):
if cond:
return args[0]
def with_template(func):
func
return with_template
class TGController(object):
pass
class TurboGearsContextMember(object):
"""Member of the TurboGears request context.
Provides access to turbogears context members
like request, response, template context and so on
"""
def __init__(self, name):
self.__dict__['name'] = name
def _current_obj(self):
return getattr(context, self.name)
request = TurboGearsContextMember(name="request")
response = TurboGearsContextMember(name="response")