Add song conversion script

Remove conversion code as it did not work!
More Song for tidy ups
This commit is contained in:
Tim Bentley 2009-07-19 07:31:08 +01:00
parent 6a495d451e
commit 4552fb543a
3 changed files with 11 additions and 5 deletions

5
cnvdb.py Normal file → Executable file
View File

@ -21,7 +21,7 @@ Place, Suite 330, Boston, MA 02111-1307 USA
import codecs import codecs
import sys import sys
def convert_file(self, inname, outname): def convert_file(inname, outname):
""" """
Convert a file from another encoding into UTF-8. 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') writefile = codecs.open(outname, 'w', encoding='utf-8')
for line in infile: for line in infile:
#replace the quotes with quotes #replace the quotes with quotes
line = line.replace(u'\'\'', u'\'') #TODO fix double quotes
#line = line.replace(u'\'\'', u'@')
writefile.write(line) writefile.write(line)
infile.close() infile.close()
writefile.close() writefile.close()

View File

@ -155,14 +155,14 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog):
if id == -1: if id == -1:
# Not Found # Not Found
id = 0 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: 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: if id == -1:
# Not Found # Not Found
id = 0 id = 0
self.song.theme_name = None self.song.theme_name = None
self.SongbookCombo.setCurrentIndex(id) self.ThemeSelectionCombo.setCurrentIndex(id)
if len(title) > 1: if len(title) > 1:
self.AlternativeEdit.setText(title[1]) self.AlternativeEdit.setText(title[1])
if self.song.copyright is not None: if self.song.copyright is not None:

5
songcnv.sh Executable file
View File

@ -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