some more comments in filmGUI
This commit is contained in:
parent
9c9a04f80f
commit
7c121aa083
3 changed files with 31 additions and 32 deletions
21
FilmBar.py
21
FilmBar.py
|
@ -1,13 +1,13 @@
|
||||||
#!/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"
|
||||||
|
|
||||||
|
|
||||||
class FilmBar:
|
class FilmBar:
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
try:
|
try:
|
||||||
import pygtk
|
import pygtk
|
||||||
pygtk.require("2.0")
|
pygtk.require("2.0")
|
||||||
|
@ -22,18 +22,5 @@ class FilmBar:
|
||||||
gtk.mainloop()
|
gtk.mainloop()
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
### defaults
|
fb = FilmBar()
|
||||||
# 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)
|
|
||||||
|
|
||||||
|
|
4
TODO
4
TODO
|
@ -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
|
||||||
|
|
38
filmGUI.py
38
filmGUI.py
|
@ -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"
|
||||||
|
|
||||||
|
@ -8,21 +8,21 @@ import time
|
||||||
import myFilms
|
import myFilms
|
||||||
|
|
||||||
class FilmGUI:
|
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"
|
self.log = time.asctime() +" the beat starts here..\n"
|
||||||
# read config file
|
# read config file
|
||||||
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,25 +31,30 @@ 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):
|
||||||
"""
|
"""
|
||||||
Get the Configuration from standard config file (see: Preferences)
|
Get the Configuration from standard config file (see: Preferences)
|
||||||
"""
|
"""
|
||||||
|
@ -61,8 +66,9 @@ 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()
|
||||||
lang = self.filmgui.get_widget("entry2").get_text()
|
lang = self.filmgui.get_widget("entry2").get_text()
|
||||||
codec = self.filmgui.get_widget("entry3").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("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()
|
||||||
self.xmlfilmlistin = self.filmgui.get_widget("entry7").get_text()
|
self.xmlfilmlistin = self.filmgui.get_widget("entry7").get_text()
|
||||||
self.xmlfilmlistout = self.filmgui.get_widget("entry8").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\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
|
||||||
cb2 = self.filmgui.get_widget("checkbutton2")
|
cb2 = self.filmgui.get_widget("checkbutton2")
|
||||||
self.mf.setXMLFile(self.xmlfilmlistout)
|
self.mf.setXMLFile(self.xmlfilmlistout)
|
||||||
|
@ -114,8 +123,9 @@ 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.."
|
||||||
self.gtk.mainquit
|
self.gtk.mainquit
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue