Made literal string to constant.

This commit is contained in:
Erik Lundin 2012-10-11 21:25:50 +02:00
parent 7d78b8f987
commit 017366c484
1 changed files with 3 additions and 1 deletions

View File

@ -45,6 +45,8 @@ import upgrade
log = logging.getLogger(__name__)
RESERVED_CHARACTERS = u'\\.^$*+?{}[]()'
class BibleMeta(BaseModel):
"""
Bible Meta Data
@ -372,7 +374,7 @@ class BibleDB(QtCore.QObject, Manager):
book_names = BibleStrings().BookNames
# escape reserved characters
book_escaped = book
for character in u'\\.^$*+?{}[]()':
for character in RESERVED_CHARACTERS:
book_escaped = book_escaped.replace(
character, u'\\' + character)
regex_book = re.compile(u'\s*%s\s*' % u'\s*'.join(