From 017366c4849206f9a3f24735efb3d49e3d676488 Mon Sep 17 00:00:00 2001 From: Erik Lundin Date: Thu, 11 Oct 2012 21:25:50 +0200 Subject: [PATCH] Made literal string to constant. --- openlp/plugins/bibles/lib/db.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/openlp/plugins/bibles/lib/db.py b/openlp/plugins/bibles/lib/db.py index 86f209dc7..d4fd930ed 100644 --- a/openlp/plugins/bibles/lib/db.py +++ b/openlp/plugins/bibles/lib/db.py @@ -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(