mirror of
https://github.com/github/codeql.git
synced 2026-05-03 20:58:03 +02:00
Merge pull request #978 from markshannon/python-turbogears
Python: Add support for turbogears; requests and responses.
This commit is contained in:
30
python/ql/test/query-tests/Security/lib/tg.py
Normal file
30
python/ql/test/query-tests/Security/lib/tg.py
Normal 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")
|
||||
Reference in New Issue
Block a user