本文整理汇总了Python中werkzeug.routing.BaseConverter类的典型用法代码示例。如果您正苦于以下问题:Python BaseConverter类的具体用法?Python BaseConverter怎么用?Python BaseConverter使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了BaseConverter类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: __init__
def __init__(self, url_map):
BaseConverter.__init__(self, url_map)
self.regex = r'(?i)(?:WQL)'
开发者ID:pywbem,项目名称:yawn,代码行数:3,代码来源:url_convert.py
示例2: __init__
def __init__(self, map):
BaseConverter.__init__(self, map)
self.regex = '(?:%s)' % '|'.join([re.escape(x) for x in NEWS_URLS])
开发者ID:ThiefMaster,项目名称:hskatom,代码行数:3,代码来源:__init__.py
示例3: to_url
def to_url(self, value):
"""Convert datetime to string."""
return BaseConverter.to_url(self, str(value))
开发者ID:inspirehep,项目名称:invenio-trends,代码行数:3,代码来源:utils.py
示例4: __init__
def __init__(self, url_map):
BaseConverter.__init__(self, url_map)
self.regex = '(?:%s)' % '|'.join([re.escape(x) for x in items])
开发者ID:SCOAP3,项目名称:invenio,代码行数:3,代码来源:url_converters.py
示例5: __init__
def __init__(self, map):
BaseConverter.__init__(self, map)
self.regex = '\w+(?:-\w+)*'
开发者ID:pferreir,项目名称:indico-backup,代码行数:3,代码来源:util.py
示例6: __init__
def __init__(self, map):
BaseConverter.__init__(self, map)
self.fixed_digits = 64
开发者ID:jjjan,项目名称:MEMT,代码行数:3,代码来源:utils.py
示例7: __init__
def __init__(self, url_map, ext):
BaseConverter.__init__(self, url_map)
self.regex = '[^/].*?(?:{})'.format(ext)
开发者ID:tjbearse,项目名称:kwiki,代码行数:4,代码来源:urlconverters.py
示例8: to_url
def to_url(self, values):
return ",".join([BaseConverter.to_url(value) for value in values])
开发者ID:RDCEP,项目名称:EDE,代码行数:2,代码来源:utils.py
示例9: to_url
def to_url(self, values):
if len(values) > 2: # Strip out everything extra
values = values[:2]
return ':'.join(BaseConverter.to_url(value)
for value in values)
开发者ID:asielen,项目名称:Woodles_Flask,代码行数:5,代码来源:utils.py
示例10: to_url
def to_url(self, values):
"""Return string."""
return '+'.join(BaseConverter.to_url(value)
for value in values)
开发者ID:krzysztof,项目名称:invenio-base,代码行数:4,代码来源:test_app.py
示例11: __init__
def __init__(self, map, *args):
BaseConverter.__init__(self,map)
self.map = map
self.regex = args[0]
开发者ID:siliu3,项目名称:c-SewpPocket,代码行数:4,代码来源:converter.py
示例12: to_url
def to_url(self, values):
return "[{0}]".format(
','.join(BaseConverter.to_url(value) for value in values) #pylint: disable=no-value-for-parameter
)
开发者ID:OaklandPeters,项目名称:dist-map-reduce,代码行数:4,代码来源:webindex.py
示例13: __init__
def __init__(self, mapping, *items):
BaseConverter.__init__(self, mapping)
# Start by enforcing that x is an integer then convert it to string
self.regex = '(?:%s)' % '|'.join([str(int(x)) for x in items])
开发者ID:crim-ca,项目名称:RESTPackage,代码行数:4,代码来源:utility_rest.py
示例14: to_url
def to_url(self, values):
"""
被url_for()调用,来转换参数成为符合URL的形式
"""
return '+'.join(BaseConverter.to_url(value)
for value in values)
开发者ID:okosioc,项目名称:flask-boot,代码行数:6,代码来源:converters.py
示例15: to_url
def to_url(self, value):
return BaseConverter.to_url(value)
开发者ID:rhino1998,项目名称:Voting-System,代码行数:2,代码来源:util.py
示例16: to_url
def to_url(self, value):
self.set_item(value)
return BaseConverter.to_url(self, value.name)
开发者ID:Drew-Kimberly,项目名称:fullstack,代码行数:3,代码来源:util.py
示例17: to_url
def to_url(self, values):
print(1111111111, values)
return self.separator.join(BaseConverter.to_url(value)
for value in values)
开发者ID:cyan-blue,项目名称:python_code,代码行数:4,代码来源:flask_test.py
示例18: __init__
def __init__(self, map, *items):
BaseConverter.__init__(self, map)
self.regex = items[0]
开发者ID:cconger,项目名称:BuildCraft,代码行数:3,代码来源:__init__.py
示例19: __init__
def __init__(self, map, *items):
BaseConverter.__init__(self, map)
self.items = items
开发者ID:lucilio,项目名称:motyro,代码行数:3,代码来源:__init__.py
示例20: to_url
def to_url(self, values):
return ','.join(BaseConverter.to_url(value) for value in values)
开发者ID:nickaversano,项目名称:msg,代码行数:2,代码来源:__init__.py
注:本文中的werkzeug.routing.BaseConverter类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论