示例#1
0
文件: utils.py 项目: RDCEP/EDE
 def to_url(self, values):
     return ",".join([BaseConverter.to_url(value) for value in values])
示例#2
0
 def __init__(self, url_map):
     BaseConverter.__init__(self, url_map)
     self.regex = r'(?i)(?:WQL)'
示例#3
0
 def to_url(self, values):
     """
     被url_for()调用,来转换参数成为符合URL的形式
     """
     return '+'.join(BaseConverter.to_url(value)
                     for value in values)
示例#4
0
 def to_url(self, value):
     self.set_item(value)
     return BaseConverter.to_url(self, value.name)
示例#5
0
 def __init__(self, url_map):
     BaseConverter.__init__(self, url_map)
     self.regex = r'[a-zA-Z_][a-zA-Z0-9_]*'
示例#6
0
 def to_url(self, value):
     """Convert datetime to string."""
     return BaseConverter.to_url(self, str(value))
示例#7
0
    def __init__(self, url_map, ext):
        BaseConverter.__init__(self, url_map)

        self.regex = '[^/].*?(?:{})'.format(ext)
 def __init__(self, map, seperator=u'/'):
     BaseConverter.__init__(self, map)
     self.seperator = seperator
示例#9
0
 def __init__(self, *args, **kwargs):
     BaseConverter.__init__(self, *args, **kwargs)
     self.type_ = "string"
     self.regex = '[^(/;)]+'
示例#10
0
 def __init__(self, url_map):
     BaseConverter.__init__(self, url_map)
     self.regex = r'(?i)(?:WQL)'
示例#11
0
 def to_url(self, values):
     """Return string."""
     return '+'.join(BaseConverter.to_url(value) for value in values)
示例#12
0
 def __init__(self, url_map):
     BaseConverter.__init__(self, url_map)
     self.regex = (r'(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2}'
                   r'==|[A-Za-z0-9_-]{3}=)?')
示例#13
0
 def __init__(self, url_map):
     BaseConverter.__init__(self, url_map)
     self.regex = r'[a-zA-Z_][a-zA-Z0-9_]*'
示例#14
0
 def to_url(self, value):
     return BaseConverter.to_url(str(value))
示例#15
0
 def __init__(self, map):
     BaseConverter.__init__(self, map)
     self.regex = '\w+(?:-\w+)*'
示例#16
0
 def __init__(self, *args, **kwargs):
     BaseConverter.__init__(self, *args, **kwargs)
     self.type_ = "string"
示例#17
0
文件: utils.py 项目: jjjan/MEMT
 def __init__(self, map):
     BaseConverter.__init__(self, map)
     self.fixed_digits = 64
示例#18
0
 def to_url(self, values):
     return self.separator.join(
         BaseConverter.to_url(value) for value in values)
示例#19
0
    def to_url(self, value):
        value = address_encoder(value)

        return BaseConverter.to_url(value)
示例#20
0
    def to_url(self, values):

        return '+'.join(BaseConverter.to_url(self, value) for value in values)
示例#21
0
 def __init__(self, url_map):
     BaseConverter.__init__(self, url_map)
     self.regex = '[^/].*?/'
示例#22
0
文件: util.py 项目: nyimbi/indico
 def __init__(self, map):
     BaseConverter.__init__(self, map)
     self.regex = '\w+(?:-\w+)*'
示例#23
0
 def to_url(self, value):
     self.set_category(value)
     return BaseConverter.to_url(self, value.name)
示例#24
0
 def __init__(self, map, *valid_versions):
     BaseConverter.__init__(self, map)
     self.valid_versions = valid_versions
示例#25
0
 def __init__(self, url_map):
     BaseConverter.__init__(self, url_map)
     self.regex = (r'(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2}'
                   r'==|[A-Za-z0-9_-]{3}=)?')
示例#26
0
 def __init__(self, url_map):
     BaseConverter.__init__(self, url_map)
     self.regex = '(?:%s)' % '|'.join([re.escape(x) for x in items])
示例#27
0
 def __init__(self, map):
     BaseConverter.__init__(self, map)
     self.regex = '(?:%s)' % '|'.join([re.escape(x) for x in NEWS_URLS])
示例#28
0
 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])
示例#29
0
 def to_url(self, value):
     return BaseConverter.to_url(value)
示例#30
0
 def to_url(self, values):
     return "[{0}]".format(
         ','.join(BaseConverter.to_url(value) for value in values) #pylint: disable=no-value-for-parameter
     ) 
示例#31
0
 def to_url(self, values):
     print(1111111111, values)
     return self.separator.join(BaseConverter.to_url(value)
                                for value in values)
示例#32
0
 def __init__(self, map, *args):
     BaseConverter.__init__(self,map)
     self.map = map
     self.regex = args[0]
示例#33
0
 def __init__(self, map, *items):
     BaseConverter.__init__(self, map)
     self.regex = items[0]
示例#34
0
 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)
示例#35
0
 def __init__(self, map, *items):
     BaseConverter.__init__(self, map)
     self.items = items
示例#36
0
 def to_url(self, values):
     """Return string."""
     return '+'.join(BaseConverter.to_url(value)
                     for value in values)
示例#37
0
 def to_url(self, values):
     return ','.join(BaseConverter.to_url(value) for value in values)
示例#38
0
 def __init__(self, url_map):
     BaseConverter.__init__(self, url_map)
     self.regex = '(?:%s)' % '|'.join([re.escape(x) for x in items])