Made modifications according to merge request

This commit is contained in:
Philip Ridout 2012-03-22 17:22:01 +00:00
parent 1fd08401bf
commit d4bfda2ade
2 changed files with 3 additions and 2 deletions

View File

@ -54,7 +54,7 @@ IMAGES_FILTER = None
UNO_CONNECTION_TYPE = u'pipe' UNO_CONNECTION_TYPE = u'pipe'
#UNO_CONNECTION_TYPE = u'socket' #UNO_CONNECTION_TYPE = u'socket'
CONTROL_CHARS = re.compile(u'[\x00-\x1F\x7F-\x9F]', re.UNICODE) CONTROL_CHARS = re.compile(u'[\x00-\x1F\x7F-\x9F]', re.UNICODE)
INVALID_FILE_CHARS = re.compile(u'[\\\/:\*\?"<>\|]', re.UNICODE) INVALID_FILE_CHARS = re.compile(u'[\\\/:\*\?"<>\|\[\]%]', re.UNICODE)
VERSION_SPLITTER = re.compile(r'([0-9]+).([0-9]+).([0-9]+)(?:-bzr([0-9]+))?') VERSION_SPLITTER = re.compile(r'([0-9]+).([0-9]+).([0-9]+)(?:-bzr([0-9]+))?')
class VersionThread(QtCore.QThread): class VersionThread(QtCore.QThread):

View File

@ -29,6 +29,7 @@ import re
from PyQt4 import QtGui from PyQt4 import QtGui
from openlp.core.lib import translate from openlp.core.lib import translate
from openlp.core.utils import CONTROL_CHARS
from db import Author from db import Author
from ui import SongStrings from ui import SongStrings
@ -262,7 +263,7 @@ def clean_title(title):
Cleans the song title by removing Unicode control chars groups C0 & C1, Cleans the song title by removing Unicode control chars groups C0 & C1,
as well as any trailing spaces as well as any trailing spaces
""" """
return re.sub(u'[\x00-\x1F\x7F-\x9F]| +$', u'', title, re.UNICODE) return CONTROL_CHARS.sub(u'', title).rstrip()
def clean_song(manager, song): def clean_song(manager, song):
""" """