示例#1
0
文件: routes.py 项目: Gubbi/boondi
 def regex(self):
     if self.path_prefix:
         regex, reverse_template, args_count, kwargs_count, variables = _parse_route_template(
             self.path_prefix + '<:/.*>')
         return regex
     else:
         return None
示例#2
0
 def regex(self):
     (
         regex,
         reverse_template,
         args_count,
         kwargs_count,
         variables,
     ) = webapp2._parse_route_template(self.prefix + "<:/.*>")
     return regex
示例#3
0
 def regex(self):
     (
         regex,
         reverse_template,
         args_count,
         kwargs_count,
         variables,
     ) = webapp2._parse_route_template(self.template, default_sufix=r"[^\.]+")
     return regex
示例#4
0
def mark(request_type, path, fn):
	path = path.strip('/')
	fn.handler_path_str = path
	url_rgx, reverse_template, args_count, kwargs_count, variables = webapp2._parse_route_template(path, default_sufix='[^/]+')

	fn.handler_path = url_rgx
	if not hasattr(fn, 'handler_types'):
		fn.handler_types = []
	fn.handler_types.append(request_type)

	argspec = inspect.getargspec(fn)
	defaults = argspec.defaults
	if defaults is None:
		defaults = []

	fn.required_arg_keys = argspec.args[1:len(argspec.args) - len(defaults)]
	fn.optional_arg_keys = argspec.args[-len(defaults):]
示例#5
0
 def regex(self):
     regex, reverse_template, args_count, kwargs_count, variables = \
         webapp2._parse_route_template(self.prefix + '<:/.*>')
     return regex
示例#6
0
 def regex(self):
     regex, reverse_template, args_count, kwargs_count, variables = \
         webapp2._parse_route_template(self.template,
                                       default_sufix='[^\.]+')
     return regex
示例#7
0
文件: routes.py 项目: tolsac/webapp3
 def regex(self):
     regex, reverse_template, args_count, kwargs_count, variables = \
         webapp2._parse_route_template(self.prefix + '<:/.*>')
     return regex
示例#8
0
文件: routes.py 项目: tolsac/webapp3
 def regex(self):
     regex, reverse_template, args_count, kwargs_count, variables = \
         webapp2._parse_route_template(self.template,
                                       default_sufix='[^\.]+')
     return regex