forked from github/codeql
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtg.py
More file actions
30 lines (22 loc) · 679 Bytes
/
Copy pathtg.py
File metadata and controls
30 lines (22 loc) · 679 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
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")