All pastes #641101 Raw Edit

Miscellany

public python v1 · immutable
#641101 ·published 2007-07-31 22:40 UTC
rendered paste body
Index: ../../libtovid/metagui/control.py===================================================================--- ../../libtovid/metagui/control.py   (revision 2237)+++ ../../libtovid/metagui/control.py   (working copy)@@ -48,6 +48,7 @@ import Tkinter as tk from support import ListVar import support+import os ### -------------------------------------------------------------------- class MissingOption (Exception):@@ -705,6 +706,7 @@                  **kwargs):         Control.__init__(self, list, option, label, default, help, **kwargs)+     def draw(self, master):         """Draw control widgets in the given master."""         Control.draw(self, master)@@ -728,10 +730,20 @@     def addFiles(self):         """Event handler to add files to the list"""+        # some tk calls to use the undocumented "hidden files" button+        self.tk.call('namespace', 'import', '::tk::dialog::file::')+        self.tk.call('set', '::tk::dialog::file::showHiddenBtn',  '1')+        self.tk.call('set', '::tk::dialog::file::showHiddenVar',  '0')         files = askopenfilenames(parent=self, title='Add files')         self.listbox.add(*files)         for control in self.copies:-            control.listbox.add(*files)+            if control.label == 'Video titles':+                for file in files:+                    title = os.path.basename(file)[0:-4]+                    title = title.replace('_', ' ')+                    control.listbox.add(title)+            else:+                control.listbox.add(*files)     def removeFiles(self):         """Event handler to remove selected files from the list"""~