Spero di aver sistemato...
Leonardo Robol [2009-04-11 09:39]
Spero di aver sistemato...
diff --git a/songbook-editor.py b/songbook-editor.py
index 17a7630..49f301e 100755
--- a/songbook-editor.py
+++ b/songbook-editor.py
@@ -1,5 +1,3 @@
-<<<<<<< HEAD:songbook-editor.py
-=======
#!/usr/bin/env python
from PyQt4 import QtGui, QtCore
@@ -23,11 +21,11 @@ class interface(QtGui.QMainWindow):
print "TODO: Save data on exit"
def get_active_song(self):
- newtitle = str(self.ui.le_title.text())
- newmauthor = str(self.ui.le_mauthor.text())
- newtauthor = str(self.ui.le_tauthor.text())
- newyear = str(self.ui.le_year.text())
- newtone = str(self.ui.le_tone.text())
+ newtitle = unicode(self.ui.le_title.text())
+ newmauthor = unicode(self.ui.le_mauthor.text())
+ newtauthor = unicode(self.ui.le_tauthor.text())
+ newyear = unicode(self.ui.le_year.text())
+ newtone = unicode(self.ui.le_tone.text())
newsong = song(newtitle, [], newmauthor, newtauthor, newtone, newyear)
newbody = unicode(self.ui.te_body.toPlainText())
@@ -48,6 +46,8 @@ class interface(QtGui.QMainWindow):
filetowrite = lm.create_song(song)
filename = QtGui.QFileDialog.getSaveFileName(self, "Salva file latex", "/home/leonardo", "LaTeX Source File (*.tex)")
handle = open(filename, 'w')
+ # Just remember that filetowrite is an "unicode" object, treat it
+ # as it just deserve
handle.write(filetowrite.encode("utf-8"))
handle.close()
@@ -61,4 +61,3 @@ if __name__ == "__main__":
widget = interface(lm)
widget.show()
app.exec_()
->>>>>>> 399e64e... Convertita tutta la gestione in unicode per non avere problemi:songbook-editor.py