GNUnet  0.20.0
httpdomain.autohttp.common Namespace Reference

Functions

def import_object (import_name)
 
def http_directive (method, path, content)
 

Detailed Description

    sphinxcontrib.autohttp.common
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    The common functions for web framework reflection.

    :copyright: Copyright 2011 by Hong Minhee
    :license: BSD, see LICENSE for details.

Function Documentation

◆ import_object()

def httpdomain.autohttp.common.import_object (   import_name)

Definition at line 15 of file common.py.

15 def import_object(import_name):
16  module_name, expr = import_name.split(':', 1)
17  mod = __import__(module_name)
18  mod = reduce(getattr, module_name.split('.')[1:], mod)
19  globals = builtins
20  if not isinstance(globals, dict):
21  globals = globals.__dict__
22  return eval(expr, globals, mod.__dict__)
23 
24 
def import_object(import_name)
Definition: common.py:15

Referenced by httpdomain.autohttp.bottle.AutobottleDirective.make_rst(), httpdomain.autohttp.tornado.AutoTornadoDirective.make_rst(), and httpdomain.autohttp.flask_base.AutoflaskBase.make_rst().

Here is the caller graph for this function:

◆ http_directive()

def httpdomain.autohttp.common.http_directive (   method,
  path,
  content 
)

Definition at line 25 of file common.py.

25 def http_directive(method, path, content):
26  method = method.lower().strip()
27  if isinstance(content, six.string_types):
28  content = content.splitlines()
29  yield ''
30  paths = [path] if isinstance(path, six.string_types) else path
31  for path in paths:
32  yield '.. http:{method}:: {path}'.format(**locals())
33  yield ''
34  for line in content:
35  yield ' ' + line
36  yield ''
def http_directive(method, path, content)
Definition: common.py:25

Referenced by httpdomain.autohttp.bottle.AutobottleDirective.make_rst(), httpdomain.autohttp.tornado.AutoTornadoDirective.make_rst(), and httpdomain.autohttp.flask_base.AutoflaskBase.make_rst().

Here is the caller graph for this function: