Browse Source

Corrige un bug lors de la génération des index

Les characters spéciaux (?, $, €, ...) faisaient planter la compilation
pull/58/head
Luthaf 11 years ago
parent
commit
823c633943
  1. 4
      patacrep/index.py

4
patacrep/index.py

@ -73,7 +73,11 @@ class Index(object):
@staticmethod
def get_first_letter(key):
"""Return the uppercase first letter of key."""
try:
letter = FIRST_LETTER_PATTERN.match(key).group(1)
except AttributeError:
# classify as number all the non letter characters
letter = "0"
if re.match(ur'\d', letter):
letter = '0-9'
return letter.upper()

Loading…
Cancel
Save