Use proper path converter for lemonshort
This commit is contained in:
parent
cfeb206154
commit
683adc1b46
5 changed files with 20 additions and 14 deletions
|
|
@ -6,10 +6,11 @@ from string import ascii_lowercase, ascii_uppercase
|
|||
chars = ascii_uppercase + ascii_lowercase
|
||||
conv = BaseConverter(chars)
|
||||
|
||||
class AbcIdConverter:
|
||||
regex = '[a-zA-Z]+'
|
||||
|
||||
def abc_to_id(abc):
|
||||
return int(conv.decode(abc))
|
||||
def to_python(self, value: str) -> int:
|
||||
return int(conv.decode(value))
|
||||
|
||||
|
||||
def id_to_abc(id):
|
||||
return conv.encode(id)
|
||||
def to_url(self, value: int) -> str:
|
||||
return conv.encode(value)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue