mirror of
https://github.com/django/django.git
synced 2025-09-22 18:22:40 +00:00
Fixed E128 flake8 warnings in django/.
This commit is contained in:
parent
2956e2f5e3
commit
df8d8d4292
136 changed files with 1641 additions and 1212 deletions
|
@ -278,10 +278,12 @@ def normalize_newlines(text):
|
|||
@keep_lazy_text
|
||||
def phone2numeric(phone):
|
||||
"""Converts a phone number with letters into its numeric equivalent."""
|
||||
char2number = {'a': '2', 'b': '2', 'c': '2', 'd': '3', 'e': '3', 'f': '3',
|
||||
'g': '4', 'h': '4', 'i': '4', 'j': '5', 'k': '5', 'l': '5', 'm': '6',
|
||||
'n': '6', 'o': '6', 'p': '7', 'q': '7', 'r': '7', 's': '7', 't': '8',
|
||||
'u': '8', 'v': '8', 'w': '9', 'x': '9', 'y': '9', 'z': '9'}
|
||||
char2number = {
|
||||
'a': '2', 'b': '2', 'c': '2', 'd': '3', 'e': '3', 'f': '3', 'g': '4',
|
||||
'h': '4', 'i': '4', 'j': '5', 'k': '5', 'l': '5', 'm': '6', 'n': '6',
|
||||
'o': '6', 'p': '7', 'q': '7', 'r': '7', 's': '7', 't': '8', 'u': '8',
|
||||
'v': '8', 'w': '9', 'x': '9', 'y': '9', 'z': '9',
|
||||
}
|
||||
return ''.join(char2number.get(c, c) for c in phone.lower())
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue