예제 #1
0
 def cookies(self):
     hdr = self.environ.get('HTTP_COOKIE', '')
     name = fuzzy.mk_str('cookie_name')
     val = fuzzy.mk_str('cookie_val')
     fuzzy.require(hdr == name + '=' + val)
     res = {name: val}
     return res
예제 #2
0
 def cookies(self):
   hdr = self.environ.get('HTTP_COOKIE', '')
   name = fuzzy.mk_str('cookie_name')
   val = fuzzy.mk_str('cookie_val')
   fuzzy.require(hdr == name + '=' + val)
   res = {name: val}
   return res
예제 #3
0
  def match(self, path):
    # print 'match', path, 'rule', self.rule
    orig = super(SymbolicRule, self).match(path)

    expectpath = "|"
    res = {v: fuzzy.mk_str(n) for (v, n) in self.symvarnames.items()}
    for converter, arguments, variable in werkzeug.routing.parse_rule(self.rule):
      if arguments is not None:
        return orig
      if converter is None:
        expectpath += variable
      elif converter is 'default':
        expectpath += res[variable]
        fuzzy.require('/' not in res[variable])
      else:
        return orig

    if expectpath == path:
      return res
    else:
      return orig
예제 #4
0
    def match(self, path):
        # print 'match', path, 'rule', self.rule
        orig = super(SymbolicRule, self).match(path)

        expectpath = "|"
        res = {v: fuzzy.mk_str(n) for (v, n) in self.symvarnames.items()}
        for converter, arguments, variable in werkzeug.routing.parse_rule(
                self.rule):
            if arguments is not None:
                return orig
            if converter is None:
                expectpath += variable
            elif converter is 'default':
                expectpath += res[variable]
                fuzzy.require('/' not in res[variable])
            else:
                return orig

        if expectpath == path:
            return res
        else:
            return orig