forked from openlp/openlp
Cleanups
bzr-revno: 864
This commit is contained in:
commit
8c89f5baa9
@ -208,40 +208,40 @@ class MediaManagerItem(QtGui.QWidget):
|
||||
## Import Button ##
|
||||
if self.hasImportIcon:
|
||||
self.addToolbarButton(
|
||||
unicode(translate('MediaManagerItem', 'Import %s')) % \
|
||||
unicode(translate('MediaManagerItem', 'Import %s')) %
|
||||
self.PluginNameShort,
|
||||
unicode(translate('MediaManagerItem', 'Import a %s')) % \
|
||||
unicode(translate('MediaManagerItem', 'Import a %s')) %
|
||||
self.PluginNameVisible,
|
||||
u':/general/general_import.png', self.onImportClick)
|
||||
## File Button ##
|
||||
if self.hasFileIcon:
|
||||
self.addToolbarButton(
|
||||
unicode(translate('MediaManagerItem', 'Load %s')) % \
|
||||
unicode(translate('MediaManagerItem', 'Load %s')) %
|
||||
self.PluginNameShort,
|
||||
unicode(translate('MediaManagerItem', 'Load a new %s')) % \
|
||||
unicode(translate('MediaManagerItem', 'Load a new %s')) %
|
||||
self.PluginNameVisible,
|
||||
u':/general/general_open.png', self.onFileClick)
|
||||
## New Button ##
|
||||
if self.hasNewIcon:
|
||||
self.addToolbarButton(
|
||||
unicode(translate('MediaManagerItem', 'New %s')) % \
|
||||
unicode(translate('MediaManagerItem', 'New %s')) %
|
||||
self.PluginNameShort,
|
||||
unicode(translate('MediaManagerItem', 'Add a new %s')) % \
|
||||
unicode(translate('MediaManagerItem', 'Add a new %s')) %
|
||||
self.PluginNameVisible,
|
||||
u':/general/general_new.png', self.onNewClick)
|
||||
## Edit Button ##
|
||||
if self.hasEditIcon:
|
||||
self.addToolbarButton(
|
||||
unicode(translate('MediaManagerItem', 'Edit %s')) % \
|
||||
unicode(translate('MediaManagerItem', 'Edit %s')) %
|
||||
self.PluginNameShort,
|
||||
unicode(translate(
|
||||
'MediaManagerItem', 'Edit the selected %s')) % \
|
||||
'MediaManagerItem', 'Edit the selected %s')) %
|
||||
self.PluginNameVisible,
|
||||
u':/general/general_edit.png', self.onEditClick)
|
||||
## Delete Button ##
|
||||
if self.hasDeleteIcon:
|
||||
self.addToolbarButton(
|
||||
unicode(translate('MediaManagerItem', 'Delete %s')) % \
|
||||
unicode(translate('MediaManagerItem', 'Delete %s')) %
|
||||
self.PluginNameShort,
|
||||
translate('MediaManagerItem', 'Delete the selected item'),
|
||||
u':/general/general_delete.png', self.onDeleteClick)
|
||||
@ -249,7 +249,7 @@ class MediaManagerItem(QtGui.QWidget):
|
||||
self.addToolbarSeparator()
|
||||
## Preview ##
|
||||
self.addToolbarButton(
|
||||
unicode(translate('MediaManagerItem', 'Preview %s')) % \
|
||||
unicode(translate('MediaManagerItem', 'Preview %s')) %
|
||||
self.PluginNameShort,
|
||||
translate('MediaManagerItem', 'Preview the selected item'),
|
||||
u':/general/general_preview.png', self.onPreviewClick)
|
||||
@ -260,7 +260,7 @@ class MediaManagerItem(QtGui.QWidget):
|
||||
u':/general/general_live.png', self.onLiveClick)
|
||||
## Add to service Button ##
|
||||
self.addToolbarButton(
|
||||
unicode(translate('MediaManagerItem', 'Add %s to Service')) % \
|
||||
unicode(translate('MediaManagerItem', 'Add %s to Service')) %
|
||||
self.PluginNameShort,
|
||||
translate('MediaManagerItem',
|
||||
'Add the selected item(s) to the service'),
|
||||
@ -285,7 +285,7 @@ class MediaManagerItem(QtGui.QWidget):
|
||||
self.ListView.addAction(
|
||||
context_menu_action(
|
||||
self.ListView, u':/general/general_edit.png',
|
||||
unicode(translate('MediaManagerItem', '&Edit %s')) % \
|
||||
unicode(translate('MediaManagerItem', '&Edit %s')) %
|
||||
self.PluginNameVisible,
|
||||
self.onEditClick))
|
||||
self.ListView.addAction(context_menu_separator(self.ListView))
|
||||
@ -293,14 +293,14 @@ class MediaManagerItem(QtGui.QWidget):
|
||||
self.ListView.addAction(
|
||||
context_menu_action(
|
||||
self.ListView, u':/general/general_delete.png',
|
||||
unicode(translate('MediaManagerItem', '&Delete %s')) % \
|
||||
unicode(translate('MediaManagerItem', '&Delete %s')) %
|
||||
self.PluginNameVisible,
|
||||
self.onDeleteClick))
|
||||
self.ListView.addAction(context_menu_separator(self.ListView))
|
||||
self.ListView.addAction(
|
||||
context_menu_action(
|
||||
self.ListView, u':/general/general_preview.png',
|
||||
unicode(translate('MediaManagerItem', '&Preview %s')) % \
|
||||
unicode(translate('MediaManagerItem', '&Preview %s')) %
|
||||
self.PluginNameVisible,
|
||||
self.onPreviewClick))
|
||||
self.ListView.addAction(
|
||||
|
@ -339,7 +339,8 @@ class ThemeXML(object):
|
||||
"""
|
||||
Pull out the XML string formatted for human consumption
|
||||
"""
|
||||
return self.theme_xml.toprettyxml(indent=u' ', newl=u'\n', encoding=u'utf-8')
|
||||
return self.theme_xml.toprettyxml(indent=u' ', newl=u'\n',
|
||||
encoding=u'utf-8')
|
||||
|
||||
def parse(self, xml):
|
||||
"""
|
||||
@ -364,7 +365,8 @@ class ThemeXML(object):
|
||||
``xml``
|
||||
The XML string to parse.
|
||||
"""
|
||||
theme_xml = ElementTree(element=XML(xml.encode(u'ascii', u'xmlcharrefreplace')))
|
||||
theme_xml = ElementTree(element=XML(xml.encode(u'ascii',
|
||||
u'xmlcharrefreplace')))
|
||||
xml_iter = theme_xml.getiterator()
|
||||
master = u''
|
||||
for element in xml_iter:
|
||||
|
@ -175,7 +175,8 @@ class Theme(object):
|
||||
``xml``
|
||||
The data to apply to the theme
|
||||
"""
|
||||
root = ElementTree(element=XML(xml.encode(u'ascii', u'xmlcharrefreplace')))
|
||||
root = ElementTree(element=XML(xml.encode(u'ascii',
|
||||
u'xmlcharrefreplace')))
|
||||
xml_iter = root.getiterator()
|
||||
for element in xml_iter:
|
||||
delphi_color_change = False
|
||||
|
@ -676,7 +676,7 @@ class ServiceManager(QtGui.QWidget):
|
||||
translate('ServiceManager',
|
||||
'File is not a valid service.\n'
|
||||
'The content encoding is not UTF-8.'))
|
||||
log.exception(u'Filename "%s" is not valid UTF-8' % \
|
||||
log.exception(u'Filename "%s" is not valid UTF-8' %
|
||||
file.decode(u'utf-8', u'replace'))
|
||||
continue
|
||||
osfile = unicode(QtCore.QDir.toNativeSeparators(ucsfile))
|
||||
|
@ -398,7 +398,7 @@ class ThemeManager(QtGui.QWidget):
|
||||
self, translate('ThemeManager', 'Error'),
|
||||
translate('ThemeManager', 'File is not a valid theme.\n'
|
||||
'The content encoding is not UTF-8.'))
|
||||
log.exception(u'Filename "%s" is not valid UTF-8' % \
|
||||
log.exception(u'Filename "%s" is not valid UTF-8' %
|
||||
file.decode(u'utf-8', u'replace'))
|
||||
continue
|
||||
osfile = unicode(QtCore.QDir.toNativeSeparators(ucsfile))
|
||||
@ -424,8 +424,8 @@ class ThemeManager(QtGui.QWidget):
|
||||
xml_data = xml_data.decode(u'utf-8')
|
||||
except UnicodeDecodeError:
|
||||
log.exception(u'Theme XML is not UTF-8 '
|
||||
'encoded.')
|
||||
break;
|
||||
u'encoded.')
|
||||
break
|
||||
if self.checkVersion1(xml_data):
|
||||
# upgrade theme xml
|
||||
filexml = self.migrateVersion122(xml_data)
|
||||
|
@ -294,5 +294,5 @@ class AlertsTab(SettingsTab):
|
||||
font.setBold(True)
|
||||
font.setPointSize(self.font_size)
|
||||
self.FontPreview.setFont(font)
|
||||
self.FontPreview.setStyleSheet(u'background-color: %s; color: %s' % \
|
||||
self.FontPreview.setStyleSheet(u'background-color: %s; color: %s' %
|
||||
(self.bg_color, self.font_color))
|
||||
|
@ -649,12 +649,13 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog):
|
||||
text = text + re.sub(r'\W+', u' ',
|
||||
unicode(self.VerseListWidget.item(i, 0).text())) + u' '
|
||||
if (bits[1] > u'1') and (bits[0][0] not in multiple):
|
||||
multiple.append(bits[0][0])
|
||||
multiple.append(bits[0][0])
|
||||
self.song.search_lyrics = text
|
||||
self.song.lyrics = unicode(sxml.extract_xml(), u'utf-8')
|
||||
for verse in multiple:
|
||||
self.song.verse_order = re.sub(u'([' + verse.upper() +
|
||||
verse.lower() + u'])(\W|$)', r'\g<1>1\2', self.song.verse_order)
|
||||
verse.lower() + u'])(\W|$)', r'\g<1>1\2',
|
||||
self.song.verse_order)
|
||||
except:
|
||||
log.exception(u'Problem processing song Lyrics \n%s',
|
||||
sxml.dump_xml())
|
||||
|
@ -23,7 +23,6 @@
|
||||
# Temple Place, Suite 330, Boston, MA 02111-1307 USA #
|
||||
###############################################################################
|
||||
|
||||
import string
|
||||
import re
|
||||
|
||||
from PyQt4 import QtGui
|
||||
|
@ -71,12 +71,11 @@ class SongUsageDetailForm(QtGui.QDialog, Ui_SongUsageDetailDialog):
|
||||
|
||||
def accept(self):
|
||||
log.debug(u'Detailed report generated')
|
||||
filename = u'usage_detail_%s_%s.txt' % \
|
||||
(self.FromDate.selectedDate().toString(u'ddMMyyyy'),
|
||||
self.ToDate.selectedDate().toString(u'ddMMyyyy'))
|
||||
usage = self.parent.songusagemanager.get_all_songusage(\
|
||||
self.FromDate.selectedDate(), \
|
||||
self.ToDate.selectedDate())
|
||||
filename = u'usage_detail_%s_%s.txt' % (
|
||||
self.FromDate.selectedDate().toString(u'ddMMyyyy'),
|
||||
self.ToDate.selectedDate().toString(u'ddMMyyyy'))
|
||||
usage = self.parent.songusagemanager.get_all_songusage(
|
||||
self.FromDate.selectedDate(), self.ToDate.selectedDate())
|
||||
outname = os.path.join(unicode(self.FileLineEdit.text()), filename)
|
||||
file = None
|
||||
try:
|
||||
|
Loading…
Reference in New Issue
Block a user