GNUnet 0.21.1
httpdomain.httpdomain.HTTPIndex Class Reference
Inheritance diagram for httpdomain.httpdomain.HTTPIndex:
[legend]
Collaboration diagram for httpdomain.httpdomain.HTTPIndex:
[legend]

Public Member Functions

def __init__ (self, *args, **kwargs)
 
def grouping_prefix (self, path)
 
def generate (self, docnames=None)
 
def __init__ (self, *args, **kwargs)
 
def grouping_prefix (self, path)
 
def generate (self, docnames=None)
 

Data Fields

 ignore
 
 shortname
 
 localname
 

Static Public Attributes

string name = 'routingtable'
 
string localname = 'HTTP Routing Table'
 
string shortname = 'routing table'
 

Detailed Description

Definition at line 524 of file httpdomain.py.

Constructor & Destructor Documentation

◆ __init__() [1/2]

def httpdomain.httpdomain.HTTPIndex.__init__ (   self,
args,
**  kwargs 
)

Definition at line 530 of file httpdomain.py.

530 def __init__(self, *args, **kwargs):
531 super(HTTPIndex, self).__init__(*args, **kwargs)
532
533 self.ignore = [
534 [l for l in x.split('/') if l]
535 for x in self.domain.env.config['http_index_ignore_prefixes']]
536 self.ignore.sort(reverse=True)
537
538 # During HTML generation these values pick from class,
539 # not from instance so we have a little hack the system
540 cls = self.__class__
541 cls.shortname = self.domain.env.config['http_index_shortname']
542 cls.localname = self.domain.env.config['http_index_localname']
543

References httpdomain.httpdomain.HTTPIndex.__init__().

Referenced by httpdomain.httpdomain.HTTPIndex.__init__().

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

◆ __init__() [2/2]

def httpdomain.httpdomain.HTTPIndex.__init__ (   self,
args,
**  kwargs 
)

Definition at line 530 of file httpdomain.py.

530 def __init__(self, *args, **kwargs):
531 super(HTTPIndex, self).__init__(*args, **kwargs)
532
533 self.ignore = [
534 [l for l in x.split('/') if l]
535 for x in self.domain.env.config['http_index_ignore_prefixes']]
536 self.ignore.sort(reverse=True)
537
538 # During HTML generation these values pick from class,
539 # not from instance so we have a little hack the system
540 cls = self.__class__
541 cls.shortname = self.domain.env.config['http_index_shortname']
542 cls.localname = self.domain.env.config['http_index_localname']
543

References httpdomain.httpdomain.HTTPIndex.__init__(), Zone.domain, MhdHttpList.domain, Socks5Request.domain, httpdomain.httpdomain.HTTPIndex.ignore, httpdomain.httpdomain.HTTPIndex.localname, and httpdomain.httpdomain.HTTPIndex.shortname.

Here is the call graph for this function:

Member Function Documentation

◆ grouping_prefix() [1/2]

def httpdomain.httpdomain.HTTPIndex.grouping_prefix (   self,
  path 
)

Definition at line 544 of file httpdomain.py.

544 def grouping_prefix(self, path):
545 letters = [x for x in path.split('/') if x]
546 for prefix in self.ignore:
547 if letters[:len(prefix)] == prefix:
548 return '/' + '/'.join(letters[:len(prefix) + 1])
549 return '/%s' % (letters[0] if letters else '',)
550

References httpdomain.httpdomain.HTTPIndex.ignore.

Referenced by httpdomain.httpdomain.HTTPIndex.generate().

Here is the caller graph for this function:

◆ generate() [1/2]

def httpdomain.httpdomain.HTTPIndex.generate (   self,
  docnames = None 
)

Definition at line 551 of file httpdomain.py.

551 def generate(self, docnames=None):
552 content = {}
553 items = ((method, path, info)
554 for method, routes in self.domain.routes.items()
555 for path, info in routes.items())
556 items = sorted(items, key=lambda item: item[1])
557 for method, path, info in items:
558 entries = content.setdefault(self.grouping_prefix(path), [])
559 entries.append([
560 method.upper() + ' ' + path, 0, info[0],
561 http_resource_anchor(method, path),
562 '', 'Deprecated' if info[2] else '', info[1]
563 ])
564 items = sorted(
565 (path, sort_by_method(entries))
566 for path, entries in content.items()
567 )
568 return (items, True)
569
570
def sort_by_method(entries)
Definition: httpdomain.py:243
def http_resource_anchor(method, path)
Definition: httpdomain.py:254

References Zone.domain, MhdHttpList.domain, Socks5Request.domain, httpdomain.httpdomain.HTTPIndex.grouping_prefix(), httpdomain.httpdomain.http_resource_anchor(), and httpdomain.httpdomain.sort_by_method().

Here is the call graph for this function:

◆ grouping_prefix() [2/2]

def httpdomain.httpdomain.HTTPIndex.grouping_prefix (   self,
  path 
)

Definition at line 544 of file httpdomain.py.

544 def grouping_prefix(self, path):
545 letters = [x for x in path.split('/') if x]
546 for prefix in self.ignore:
547 if letters[:len(prefix)] == prefix:
548 return '/' + '/'.join(letters[:len(prefix) + 1])
549 return '/%s' % (letters[0] if letters else '',)
550

References httpdomain.httpdomain.HTTPIndex.ignore.

Referenced by httpdomain.httpdomain.HTTPIndex.generate().

Here is the caller graph for this function:

◆ generate() [2/2]

def httpdomain.httpdomain.HTTPIndex.generate (   self,
  docnames = None 
)

Definition at line 551 of file httpdomain.py.

551 def generate(self, docnames=None):
552 content = {}
553 items = ((method, path, info)
554 for method, routes in self.domain.routes.items()
555 for path, info in routes.items())
556 items = sorted(items, key=lambda item: item[1])
557 for method, path, info in items:
558 entries = content.setdefault(self.grouping_prefix(path), [])
559 entries.append([
560 method.upper() + ' ' + path, 0, info[0],
561 http_resource_anchor(method, path),
562 '', 'Deprecated' if info[2] else '', info[1]
563 ])
564 items = sorted(
565 (path, sort_by_method(entries))
566 for path, entries in content.items()
567 )
568 return (items, True)
569
570

References Zone.domain, MhdHttpList.domain, Socks5Request.domain, httpdomain.httpdomain.HTTPIndex.grouping_prefix(), httpdomain.httpdomain.http_resource_anchor(), and httpdomain.httpdomain.sort_by_method().

Here is the call graph for this function:

Field Documentation

◆ name

string httpdomain.httpdomain.HTTPIndex.name = 'routingtable'
static

Definition at line 526 of file httpdomain.py.

◆ localname [1/2]

string httpdomain.httpdomain.HTTPIndex.localname = 'HTTP Routing Table'
static

Definition at line 527 of file httpdomain.py.

Referenced by httpdomain.httpdomain.HTTPIndex.__init__().

◆ shortname [1/2]

string httpdomain.httpdomain.HTTPIndex.shortname = 'routing table'
static

Definition at line 528 of file httpdomain.py.

Referenced by httpdomain.httpdomain.HTTPIndex.__init__().

◆ ignore

httpdomain.httpdomain.HTTPIndex.ignore

◆ shortname [2/2]

httpdomain.httpdomain.HTTPIndex.shortname

Definition at line 541 of file httpdomain.py.

Referenced by httpdomain.httpdomain.HTTPIndex.__init__().

◆ localname [2/2]

httpdomain.httpdomain.HTTPIndex.localname

Definition at line 542 of file httpdomain.py.

Referenced by httpdomain.httpdomain.HTTPIndex.__init__().


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