some more comments in filmGUI

This commit is contained in:
age 2004-08-06 21:29:13 +00:00
parent 9c9a04f80f
commit 7c121aa083
3 changed files with 31 additions and 32 deletions

View file

@ -1,5 +1,5 @@
#!/usr/bin/env python #!/usr/bin/env python
__version__="dev0.3" __version__="dev0.4"
__author__="AGE" __author__="AGE"
__date__="02004-08-06" __date__="02004-08-06"
@ -22,18 +22,5 @@ class FilmBar:
gtk.mainloop() gtk.mainloop()
if __name__ == "__main__": if __name__ == "__main__":
### defaults
# wo ist die Liste vom Joerch?
htmlfilmlist = "file:///home/age/divx.html"
# in welche xml Datei sollen die Filme?
xmlfilmlist = "myfilms.xml"
fb = FilmBar() fb = FilmBar()
## testing ##
### 1. ###
### i've done this once - think it's enough ;)
# fb.convertJoerchs2XML(htmlfilmlist, xmlfilmlist)
### 2. ###
#fb.importXML(xmlfilmlist)

4
TODO
View file

@ -1,15 +1,17 @@
TODO for FilmBar (02004/08) TODO for FilmBar (02004/08)
[!] 'exit' functionality [!] 'exit' functionality
[ ] liste mit filmdaten universeller gestalten
[ ] convert xmllist to htmllist [ ] convert xmllist to htmllist
[.] improve usability [.] improve usability
[ ] improve/expand html reading (at: myFilms.saveXMLfromJoerchs) [ ] improve/expand html reading (at: myFilms.saveXMLfromJoerchs)
[*] external .config file [*] external .config file
[*] import joerchs html [*] import joerchs html
--- ---
meaning: meaning:
[ ] not done [ ] request
[.] working on [.] working on
[*] done [*] done
[!] fix me [!] fix me

View file

@ -1,5 +1,5 @@
#/usr/bin/env python #/usr/bin/env python
__version__="dev0.3" __version__="dev0.4"
__author__="AGE" __author__="AGE"
__date__="02004-08-06" __date__="02004-08-06"
@ -18,11 +18,11 @@ class FilmGUI:
self.readConfig() self.readConfig()
# gtk is given, it has to be known in the whole class # gtk is given, it has to be known in the whole class
self.gtk = gtk self.gtk = gtk
# define which gladefile to use for frontend # define here, which gladefile to use for the frontend
# uncomment if you want to use the one from the configfile # uncomment if you want to use the one from the configfile
self.gladefile = "fba.glade" self.gladefile = "fba.glade"
self.filmgui = self.gtk.glade.XML(self.gladefile) self.filmgui = self.gtk.glade.XML(self.gladefile)
# set button handlers # set button handlers, easypeasy -> buttonname:functionname
actions = { "on_bu_insertfilm_clicked": self.clicked_insertfilm, actions = { "on_bu_insertfilm_clicked": self.clicked_insertfilm,
"on_bu_apply_files_clicked": self.clicked_apply_files, "on_bu_apply_files_clicked": self.clicked_apply_files,
"on_bu_read_xml_clicked": self.clicked_read_xml, "on_bu_read_xml_clicked": self.clicked_read_xml,
@ -31,23 +31,28 @@ class FilmGUI:
#"on_bu_cancel_clicked": self.exit, #"on_bu_cancel_clicked": self.exit,
"on_window1_destroy_event": self.exit "on_window1_destroy_event": self.exit
} }
# connect the actions to the events # connect the actions to special events
self.filmgui.signal_autoconnect (actions) self.filmgui.signal_autoconnect (actions)
# fill some textfields with configdata
self.filmgui.get_widget("entry6").set_text(self.htmlfilmlist) self.filmgui.get_widget("entry6").set_text(self.htmlfilmlist)
self.filmgui.get_widget("entry7").set_text(self.xmlfilmlistin) self.filmgui.get_widget("entry7").set_text(self.xmlfilmlistin)
self.filmgui.get_widget("entry8").set_text(self.xmlfilmlistout) self.filmgui.get_widget("entry8").set_text(self.xmlfilmlistout)
self.filmgui.get_widget("entry10").set_text(self.htmlfilmlist) self.filmgui.get_widget("entry10").set_text(self.htmlfilmlist)
self.filmgui.get_widget("entry11").set_text(self.xmlfilmlistin) self.filmgui.get_widget("entry11").set_text(self.xmlfilmlistin)
# connect the logwindow
self.textview = self.filmgui.get_widget("textview1") self.textview = self.filmgui.get_widget("textview1")
self.textbuffer = self.textview.get_buffer() self.textbuffer = self.textview.get_buffer()
self.textbuffer.set_text(self.log) self.textbuffer.set_text(self.log)
self.log += "\n"+time.strftime('%H:%M:%S') self.log += "\n"+time.strftime('%H:%M:%S')
self.log += "\n\t ___program completely started___\n" self.log += "\n\t ___program completely started___\n"
self.textbuffer.set_text(self.log) self.textbuffer.set_text(self.log)
# connect the xml_output_window
self.textview2 = self.filmgui.get_widget("textview2") self.textview2 = self.filmgui.get_widget("textview2")
self.textbuffer2= self.textview2.get_buffer() self.textbuffer2= self.textview2.get_buffer()
# finally the most important step: create a myFilms object
self.mf = myFilms.MyFilms() self.mf = myFilms.MyFilms()
return return
# =======================================================
def readConfig(self): def readConfig(self):
""" """
@ -61,6 +66,7 @@ class FilmGUI:
self.xmlfilmlistout = myPrefs["xmlfilmlistout"] self.xmlfilmlistout = myPrefs["xmlfilmlistout"]
self.log += "\n"+time.strftime('%H:%M:%S') self.log += "\n"+time.strftime('%H:%M:%S')
self.log += " read config file\n" self.log += " read config file\n"
# =======================================================
def clicked_insertfilm(self, widget): def clicked_insertfilm(self, widget):
title = self.filmgui.get_widget("entry1").get_text() title = self.filmgui.get_widget("entry1").get_text()
@ -81,6 +87,7 @@ class FilmGUI:
#self.filmgui.get_widget("entry4").set_text("") #self.filmgui.get_widget("entry4").set_text("")
#self.filmgui.get_widget("entry5").set_text("") #self.filmgui.get_widget("entry5").set_text("")
self.textbuffer.set_text(self.log) self.textbuffer.set_text(self.log)
# =======================================================
def clicked_apply_files(self, widget): def clicked_apply_files(self, widget):
self.htmlfilmlist = self.filmgui.get_widget("entry6").get_text() self.htmlfilmlist = self.filmgui.get_widget("entry6").get_text()
@ -97,11 +104,13 @@ class FilmGUI:
self.log += "\n\txml export:\t"+self.xmlfilmlistout self.log += "\n\txml export:\t"+self.xmlfilmlistout
self.log += "\n" self.log += "\n"
self.textbuffer.set_text(self.log) self.textbuffer.set_text(self.log)
# =======================================================
def clicked_read_xml(self, widget): def clicked_read_xml(self, widget):
xmlstuff = self.xmlfilmlistout + " \n===============================\n" xmlstuff = self.xmlfilmlistout + " \n===============================\n"
xmlstuff += open(self.xmlfilmlistout).read() xmlstuff += open(self.xmlfilmlistout).read()
self.textbuffer2.set_text(xmlstuff) self.textbuffer2.set_text(xmlstuff)
# =======================================================
def clicked_read_joerchs(self, widget): def clicked_read_joerchs(self, widget):
# debugmode abchecken # debugmode abchecken
@ -114,6 +123,7 @@ class FilmGUI:
self.log += "\n\tsaved xml: "+self.xmlfilmlistout self.log += "\n\tsaved xml: "+self.xmlfilmlistout
self.log += "\n\t"+debugout self.log += "\n\t"+debugout
self.textbuffer.set_text(self.log) self.textbuffer.set_text(self.log)
# =======================================================
def exit(self, widget): def exit(self, widget):
print "geh kacken.." print "geh kacken.."