MCPcopy Create free account
hub / github.com/datapane/datapane / _compile

Method _compile

python-client/src/datapane/_vendor/bottle.py:428–438  ·  view source on GitHub ↗
(self, method)

Source from the content-addressed store, hash-verified

426 self._compile(method)
427
428 def _compile(self, method):
429 all_rules = self.dyna_routes[method]
430 comborules = self.dyna_regexes[method] = []
431 maxgroups = self._MAX_GROUPS_PER_PATTERN
432 for x in range(0, len(all_rules), maxgroups):
433 some = all_rules[x:x + maxgroups]
434 combined = (flatpat for (_, flatpat, _, _) in some)
435 combined = '|'.join('(^%s$)' % flatpat for flatpat in combined)
436 combined = re.compile(combined).match
437 rules = [(target, getargs) for (_, _, target, getargs) in some]
438 comborules.append((combined, rules))
439
440 def build(self, _name, *anons, **query):
441 """ Build an URL by filling the wildcards in a rule. """

Callers 1

addMethod · 0.95

Calls 1

appendMethod · 0.45

Tested by

no test coverage detected