GNUnet  0.20.0
httpdomain.autohttp.tornado.AutoTornadoDirective Class Reference
Inheritance diagram for httpdomain.autohttp.tornado.AutoTornadoDirective:
[legend]
Collaboration diagram for httpdomain.autohttp.tornado.AutoTornadoDirective:
[legend]

Public Member Functions

def endpoints (self)
 
def undoc_endpoints (self)
 
def make_rst (self)
 
def run (self)
 

Static Public Attributes

bool has_content = True
 
int required_arguments = 1
 
dictionary option_spec
 

Detailed Description

Definition at line 71 of file tornado.py.

Member Function Documentation

◆ endpoints()

def httpdomain.autohttp.tornado.AutoTornadoDirective.endpoints (   self)

Definition at line 80 of file tornado.py.

80  def endpoints(self):
81  endpoints = self.options.get('endpoints', None)
82  if not endpoints:
83  return None
84  return frozenset(re.split(r'\s*,\s*', endpoints))
85 
static int get
Get DID Documement for DID Flag.
Definition: gnunet-did.c:66

References get, GNUNET_CADET_ConnectionCreateMessage.options, InitMessage.options, GSC_Client.options, GNUNET_DHT_ClientGetMessage.options, GNUNET_DHT_ClientResultMessage.options, GNUNET_DHT_ClientPutMessage.options, GNUNET_DHT_MonitorPutMessage.options, GNUNET_DHT_MonitorGetMessage.options, GNUNET_DHT_MonitorGetRespMessage.options, GNUNET_DHT_GetHandle.options, GetActionContext.options, PeerPutMessage.options, PeerResultMessage.options, PeerGetMessage.options, RecentRequest.options, SearchMessage.options, GNUNET_FS_PublishContext.options, GNUNET_FS_SearchContext.options, GNUNET_FS_DownloadContext.options, GNUNET_FS_PublishKskContext.options, GSF_PendingRequestData.options, LookupMessage.options, GNUNET_GNS_LookupWithTldRequest.options, GNS_ResolverHandle.options, StoreRecordMessage.options, GNUNET_PEERSTORE_StoreContext.options, HTTP_Client_Plugin.options, PrettyPrinterContext.options, HttpAddress.options, ServerRequest.options, HTTP_Server_Plugin.options, IPv4TcpAddress.options, IPv6TcpAddress.options, TemplateAddress.options, IPv4UdpAddress.options, IPv6UdpAddress.options, UnixAddress.options, WlanAddress.options, Plugin.options, LEGACY_SERVICE_Context.options, StartMessage.options, and GNUNET_SERVICE_Handle.options.

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:

◆ undoc_endpoints()

def httpdomain.autohttp.tornado.AutoTornadoDirective.undoc_endpoints (   self)

Definition at line 87 of file tornado.py.

87  def undoc_endpoints(self):
88  undoc_endpoints = self.options.get('undoc-endpoints', None)
89  if not undoc_endpoints:
90  return frozenset()
91  return frozenset(re.split(r'\s*,\s*', undoc_endpoints))
92 

References get, GNUNET_CADET_ConnectionCreateMessage.options, InitMessage.options, GSC_Client.options, GNUNET_DHT_ClientGetMessage.options, GNUNET_DHT_ClientResultMessage.options, GNUNET_DHT_ClientPutMessage.options, GNUNET_DHT_MonitorPutMessage.options, GNUNET_DHT_MonitorGetMessage.options, GNUNET_DHT_MonitorGetRespMessage.options, GNUNET_DHT_GetHandle.options, GetActionContext.options, PeerPutMessage.options, PeerResultMessage.options, PeerGetMessage.options, RecentRequest.options, SearchMessage.options, GNUNET_FS_PublishContext.options, GNUNET_FS_SearchContext.options, GNUNET_FS_DownloadContext.options, GNUNET_FS_PublishKskContext.options, GSF_PendingRequestData.options, LookupMessage.options, GNUNET_GNS_LookupWithTldRequest.options, GNS_ResolverHandle.options, StoreRecordMessage.options, GNUNET_PEERSTORE_StoreContext.options, HTTP_Client_Plugin.options, PrettyPrinterContext.options, HttpAddress.options, ServerRequest.options, HTTP_Server_Plugin.options, IPv4TcpAddress.options, IPv6TcpAddress.options, TemplateAddress.options, IPv4UdpAddress.options, IPv6UdpAddress.options, UnixAddress.options, WlanAddress.options, Plugin.options, LEGACY_SERVICE_Context.options, StartMessage.options, and GNUNET_SERVICE_Handle.options.

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:

◆ make_rst()

def httpdomain.autohttp.tornado.AutoTornadoDirective.make_rst (   self)

Definition at line 93 of file tornado.py.

93  def make_rst(self):
94  app = import_object(self.arguments[0])
95  for method, path, handler in get_routes(app):
96  class_name = handler.__name__
97  method_name = getattr(handler, method).__name__
98  endpoint = '.'.join((class_name, method_name))
99 
100  if self.endpoints and endpoint not in self.endpoints:
101  continue
102  if endpoint in self.undoc_endpoints:
103  continue
104 
105  docstring = getattr(handler, method).__doc__ or ''
106  #if not isinstance(docstring, unicode):
107  # analyzer = ModuleAnalyzer.for_module(view.__module__)
108  # docstring = force_decode(docstring, analyzer.encoding)
109  if not docstring and 'include-empty-docstring' not in self.options:
110  continue
111  docstring = prepare_docstring(docstring)
112  for line in http_directive(method, normalize_path(path), docstring):
113  yield line
114 
def import_object(import_name)
Definition: common.py:15
def http_directive(method, path, content)
Definition: common.py:25

References httpdomain.autohttp.bottle.AutobottleDirective.endpoints(), httpdomain.autohttp.flask_base.AutoflaskBase.endpoints(), httpdomain.autohttp.tornado.AutoTornadoDirective.endpoints(), httpdomain.autohttp.tornado.get_routes(), httpdomain.autohttp.common.http_directive(), httpdomain.autohttp.common.import_object(), httpdomain.autohttp.tornado.normalize_path(), GNUNET_CADET_ConnectionCreateMessage.options, InitMessage.options, GSC_Client.options, GNUNET_DHT_ClientGetMessage.options, GNUNET_DHT_ClientResultMessage.options, GNUNET_DHT_ClientPutMessage.options, GNUNET_DHT_MonitorPutMessage.options, GNUNET_DHT_MonitorGetMessage.options, GNUNET_DHT_MonitorGetRespMessage.options, GNUNET_DHT_GetHandle.options, GetActionContext.options, PeerPutMessage.options, PeerResultMessage.options, PeerGetMessage.options, RecentRequest.options, SearchMessage.options, GNUNET_FS_PublishContext.options, GNUNET_FS_SearchContext.options, GNUNET_FS_DownloadContext.options, GNUNET_FS_PublishKskContext.options, GSF_PendingRequestData.options, LookupMessage.options, GNUNET_GNS_LookupWithTldRequest.options, GNS_ResolverHandle.options, StoreRecordMessage.options, GNUNET_PEERSTORE_StoreContext.options, HTTP_Client_Plugin.options, PrettyPrinterContext.options, HttpAddress.options, ServerRequest.options, HTTP_Server_Plugin.options, IPv4TcpAddress.options, IPv6TcpAddress.options, TemplateAddress.options, IPv4UdpAddress.options, IPv6UdpAddress.options, UnixAddress.options, WlanAddress.options, Plugin.options, LEGACY_SERVICE_Context.options, StartMessage.options, GNUNET_SERVICE_Handle.options, httpdomain.autohttp.bottle.AutobottleDirective.undoc_endpoints(), httpdomain.autohttp.flask_base.AutoflaskBase.undoc_endpoints(), and httpdomain.autohttp.tornado.AutoTornadoDirective.undoc_endpoints().

Referenced by httpdomain.autohttp.bottle.AutobottleDirective.run(), httpdomain.autohttp.flask.AutoflaskDirective.run(), httpdomain.autohttp.flaskqref.QuickReferenceFlaskDirective.run(), and httpdomain.autohttp.tornado.AutoTornadoDirective.run().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ run()

def httpdomain.autohttp.tornado.AutoTornadoDirective.run (   self)

Definition at line 115 of file tornado.py.

115  def run(self):
116  node = nodes.section()
117  node.document = self.state.document
118  result = ViewList()
119  for line in self.make_rst():
120  result.append(line, '<autotornado>')
121  nested_parse_with_titles(self.state, result, node)
122  return node.children
123 
124 
static void run(void *cls, char *const *args, const char *cfgfile, const struct GNUNET_CONFIGURATION_Handle *c)
Main function that will be run.
Definition: gnunet-abd.c:757

References httpdomain.autohttp.bottle.AutobottleDirective.make_rst(), httpdomain.autohttp.tornado.AutoTornadoDirective.make_rst(), httpdomain.autohttp.flask_base.AutoflaskBase.make_rst(), CadetChannel.state, CadetConnection.state, GNUNET_CONVERSATION_Caller.state, GNUNET_CONVERSATION_Phone.state, GNUNET_CONVERSATION_Call.state, MonitorNotifyMessage.state, GNUNET_FS_UnindexContext.state, DownloadRequest.state, Socks5Request.state, GNUNET_TRANSPORT_SessionInfo.state, GNUNET_MESSENGER_SrvRoom.state, GNUNET_MESSENGER_SrvTunnel.state, OIDC_Variables.state, MhdConnectionHandle.state, Operation.state, Set.state, RegisteredHostContext.state, LCFContext.state, OperationContext.state, GNUNET_TESTBED_Operation.state, GNUNET_TESTBED_Peer.state, ServiceConnectData.state, GNUNET_TESTBED_RunHandle.state, NeighbourMapEntry.state, ValidationEntry.state, MonitoredPeer.state, PeerResolutionContext.state, RequestHandle.state, ValidationIterateResponseMessage.state, and PeerIterateResponseMessage.state.

Referenced by gnunet_testing.Check.run_blocking(), and gnunet_testing.Check.run_once().

Here is the call graph for this function:
Here is the caller graph for this function:

Field Documentation

◆ has_content

bool httpdomain.autohttp.tornado.AutoTornadoDirective.has_content = True
static

Definition at line 73 of file tornado.py.

◆ required_arguments

int httpdomain.autohttp.tornado.AutoTornadoDirective.required_arguments = 1
static

Definition at line 74 of file tornado.py.

◆ option_spec

dictionary httpdomain.autohttp.tornado.AutoTornadoDirective.option_spec
static
Initial value:
= {'endpoints': directives.unchanged,
'undoc-endpoints': directives.unchanged,
'include-empty-docstring': directives.unchanged}

Definition at line 75 of file tornado.py.


The documentation for this class was generated from the following file: