Back to index

moin  1.9.0~rc2
Public Member Functions | Public Attributes
MoinMoin.support.werkzeug.routing.RuleTemplateFactory Class Reference
Inheritance diagram for MoinMoin.support.werkzeug.routing.RuleTemplateFactory:
Inheritance graph
[legend]
Collaboration diagram for MoinMoin.support.werkzeug.routing.RuleTemplateFactory:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def __init__
def get_rules

Public Attributes

 rules
 context

Detailed Description

A factory that fills in template variables into rules.  Used by
`RuleTemplate` internally.

:internal:

Definition at line 333 of file routing.py.


Constructor & Destructor Documentation

def MoinMoin.support.werkzeug.routing.RuleTemplateFactory.__init__ (   self,
  rules,
  context 
)

Definition at line 340 of file routing.py.

00340 
00341     def __init__(self, rules, context):
00342         self.rules = rules
00343         self.context = context


Member Function Documentation

Subclasses of `RuleFactory` have to override this method and return
an iterable of rules.

Reimplemented from MoinMoin.support.werkzeug.routing.RuleFactory.

Definition at line 344 of file routing.py.

00344 
00345     def get_rules(self, map):
00346         for rulefactory in self.rules:
00347             for rule in rulefactory.get_rules(map):
00348                 new_defaults = subdomain = None
00349                 if rule.defaults is not None:
00350                     new_defaults = {}
00351                     for key, value in rule.defaults.iteritems():
00352                         if isinstance(value, basestring):
00353                             value = format_string(value, self.context)
00354                         new_defaults[key] = value
00355                 if rule.subdomain is not None:
00356                     subdomain = format_string(rule.subdomain, self.context)
00357                 new_endpoint = rule.endpoint
00358                 if isinstance(new_endpoint, basestring):
00359                     new_endpoint = format_string(new_endpoint, self.context)
00360                 yield Rule(
00361                     format_string(rule.rule, self.context),
00362                     new_defaults,
00363                     subdomain,
00364                     rule.methods,
00365                     rule.build_only,
00366                     new_endpoint,
00367                     rule.strict_slashes
00368                 )
00369 

Here is the call graph for this function:


Member Data Documentation

Definition at line 342 of file routing.py.

Definition at line 341 of file routing.py.


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