From 4552fb543a0c78e053270b66dfe65ea053deb36d Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Sun, 19 Jul 2009 07:31:08 +0100 Subject: [PATCH] Add song conversion script Remove conversion code as it did not work! More Song for tidy ups --- cnvdb.py | 5 +++-- openlp/plugins/songs/forms/editsongform.py | 6 +++--- songcnv.sh | 5 +++++ 3 files changed, 11 insertions(+), 5 deletions(-) mode change 100644 => 100755 cnvdb.py create mode 100755 songcnv.sh diff --git a/cnvdb.py b/cnvdb.py old mode 100644 new mode 100755 index f33b5dc03..4463ec887 --- a/cnvdb.py +++ b/cnvdb.py @@ -21,7 +21,7 @@ Place, Suite 330, Boston, MA 02111-1307 USA import codecs import sys -def convert_file(self, inname, outname): +def convert_file(inname, outname): """ Convert a file from another encoding into UTF-8. @@ -35,7 +35,8 @@ def convert_file(self, inname, outname): writefile = codecs.open(outname, 'w', encoding='utf-8') for line in infile: #replace the quotes with quotes - line = line.replace(u'\'\'', u'\'') + #TODO fix double quotes + #line = line.replace(u'\'\'', u'@') writefile.write(line) infile.close() writefile.close() diff --git a/openlp/plugins/songs/forms/editsongform.py b/openlp/plugins/songs/forms/editsongform.py index 0944e0ef7..8966c6d5e 100644 --- a/openlp/plugins/songs/forms/editsongform.py +++ b/openlp/plugins/songs/forms/editsongform.py @@ -155,14 +155,14 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog): if id == -1: # Not Found id = 0 - book_name.setCurrentIndex(id) + self.SongbookCombo.setCurrentIndex(id) if self.song.theme_name is not None and len(self.song.theme_name) > 0: - id = self.SongbookCombo.findText(unicode(self.song.theme_name), QtCore.Qt.MatchExactly) + id = self.ThemeSelectionCombo.findText(unicode(self.song.theme_name), QtCore.Qt.MatchExactly) if id == -1: # Not Found id = 0 self.song.theme_name = None - self.SongbookCombo.setCurrentIndex(id) + self.ThemeSelectionCombo.setCurrentIndex(id) if len(title) > 1: self.AlternativeEdit.setText(title[1]) if self.song.copyright is not None: diff --git a/songcnv.sh b/songcnv.sh new file mode 100755 index 000000000..b7ef2a173 --- /dev/null +++ b/songcnv.sh @@ -0,0 +1,5 @@ +/usr/bin/sqlite ~/.local/share/openlp/songs/songs.olp .dump > ~/.local/share/openlp/songs/songs.dmp +./cnvdb.py ~/.local/share/openlp/songs/songs.dmp ~/.local/share/openlp/songs/songs.dmp2 +rm ~/.local/share/openlp/songs/songs.sqlite +sqlite3 ~/.local/share/openlp/songs/songs.sqlite < ~/.local/share/openlp/songs/songs.dmp2 +./openlpcnv.pyw