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,13 +1,13 @@
#!/usr/bin/env python
__version__="dev0.3"
__version__="dev0.4"
__author__="AGE"
__date__="02004-08-06"
class FilmBar:
import sys
import sys
def __init__(self):
def __init__(self):
try:
import pygtk
pygtk.require("2.0")
@ -22,18 +22,5 @@ class FilmBar:
gtk.mainloop()
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()
## testing ##
### 1. ###
### i've done this once - think it's enough ;)
# fb.convertJoerchs2XML(htmlfilmlist, xmlfilmlist)
### 2. ###
#fb.importXML(xmlfilmlist)
fb = FilmBar()

4
TODO
View file

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

View file

@ -1,5 +1,5 @@
#/usr/bin/env python
__version__="dev0.3"
__version__="dev0.4"
__author__="AGE"
__date__="02004-08-06"
@ -8,21 +8,21 @@ import time
import myFilms
class FilmGUI:
"""
The frontend for the FilmPseudoDB
"""
"""
The frontend for the FilmPseudoDB
"""
def __init__(self, gtk):
def __init__(self, gtk):
self.log = time.asctime() +" the beat starts here..\n"
# read config file
self.readConfig()
# gtk is given, it has to be known in the whole class
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
self.gladefile = "fba.glade"
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,
"on_bu_apply_files_clicked": self.clicked_apply_files,
"on_bu_read_xml_clicked": self.clicked_read_xml,
@ -31,25 +31,30 @@ class FilmGUI:
#"on_bu_cancel_clicked": 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)
# fill some textfields with configdata
self.filmgui.get_widget("entry6").set_text(self.htmlfilmlist)
self.filmgui.get_widget("entry7").set_text(self.xmlfilmlistin)
self.filmgui.get_widget("entry8").set_text(self.xmlfilmlistout)
self.filmgui.get_widget("entry10").set_text(self.htmlfilmlist)
self.filmgui.get_widget("entry11").set_text(self.xmlfilmlistin)
# connect the logwindow
self.textview = self.filmgui.get_widget("textview1")
self.textbuffer = self.textview.get_buffer()
self.textbuffer.set_text(self.log)
self.log += "\n"+time.strftime('%H:%M:%S')
self.log += "\n\t ___program completely started___\n"
self.textbuffer.set_text(self.log)
# connect the xml_output_window
self.textview2 = self.filmgui.get_widget("textview2")
self.textbuffer2= self.textview2.get_buffer()
# finally the most important step: create a myFilms object
self.mf = myFilms.MyFilms()
return
# =======================================================
def readConfig(self):
def readConfig(self):
"""
Get the Configuration from standard config file (see: Preferences)
"""
@ -61,8 +66,9 @@ class FilmGUI:
self.xmlfilmlistout = myPrefs["xmlfilmlistout"]
self.log += "\n"+time.strftime('%H:%M:%S')
self.log += " read config file\n"
# =======================================================
def clicked_insertfilm(self, widget):
def clicked_insertfilm(self, widget):
title = self.filmgui.get_widget("entry1").get_text()
lang = self.filmgui.get_widget("entry2").get_text()
codec = self.filmgui.get_widget("entry3").get_text()
@ -81,8 +87,9 @@ class FilmGUI:
#self.filmgui.get_widget("entry4").set_text("")
#self.filmgui.get_widget("entry5").set_text("")
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.xmlfilmlistin = self.filmgui.get_widget("entry7").get_text()
self.xmlfilmlistout = self.filmgui.get_widget("entry8").get_text()
@ -97,13 +104,15 @@ class FilmGUI:
self.log += "\n\txml export:\t"+self.xmlfilmlistout
self.log += "\n"
self.textbuffer.set_text(self.log)
# =======================================================
def clicked_read_xml(self, widget):
def clicked_read_xml(self, widget):
xmlstuff = self.xmlfilmlistout + " \n===============================\n"
xmlstuff += open(self.xmlfilmlistout).read()
self.textbuffer2.set_text(xmlstuff)
# =======================================================
def clicked_read_joerchs(self, widget):
def clicked_read_joerchs(self, widget):
# debugmode abchecken
cb2 = self.filmgui.get_widget("checkbutton2")
self.mf.setXMLFile(self.xmlfilmlistout)
@ -114,8 +123,9 @@ class FilmGUI:
self.log += "\n\tsaved xml: "+self.xmlfilmlistout
self.log += "\n\t"+debugout
self.textbuffer.set_text(self.log)
# =======================================================
def exit(self, widget):
def exit(self, widget):
print "geh kacken.."
self.gtk.mainquit