You can subscribe to this list here.
2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(12) |
Jul
(42) |
Aug
(106) |
Sep
(2) |
Oct
|
Nov
|
Dec
|
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
|
Feb
|
Mar
(17) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2006 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(2) |
Aug
(2) |
Sep
|
Oct
(1) |
Nov
(2) |
Dec
(1) |
2007 |
Jan
(3) |
Feb
(3) |
Mar
|
Apr
(2) |
May
(10) |
Jun
(9) |
Jul
(20) |
Aug
(34) |
Sep
(29) |
Oct
(10) |
Nov
(9) |
Dec
(6) |
2008 |
Jan
(8) |
Feb
(15) |
Mar
(34) |
Apr
(20) |
May
(8) |
Jun
(16) |
Jul
(32) |
Aug
(14) |
Sep
(24) |
Oct
(14) |
Nov
(33) |
Dec
(69) |
2009 |
Jan
(123) |
Feb
(31) |
Mar
(54) |
Apr
(49) |
May
(116) |
Jun
(95) |
Jul
(68) |
Aug
(21) |
Sep
(20) |
Oct
(34) |
Nov
(9) |
Dec
(13) |
2010 |
Jan
(5) |
Feb
(6) |
Mar
(28) |
Apr
(47) |
May
(73) |
Jun
(74) |
Jul
(38) |
Aug
(45) |
Sep
(32) |
Oct
(1) |
Nov
|
Dec
|
2013 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
(2) |
Nov
|
Dec
|
2015 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <te...@us...> - 2004-03-01 23:36:10
|
Update of /cvsroot/quickrip/ng In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5621 Modified Files: quickrip.py Log Message: Fixed quickrip.py to fallback to CLI by default Index: quickrip.py =================================================================== RCS file: /cvsroot/quickrip/ng/quickrip.py,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** quickrip.py 1 Mar 2004 17:00:39 -0000 1.1.1.1 --- quickrip.py 1 Mar 2004 23:16:41 -0000 1.2 *************** *** 52,59 **** # Fallback to CLI mode... ! sys.path.append("cli") ! import cli ! cli.main() ! sys.exit(2) # The famous __name__ + __main__ trick... --- 52,59 ---- # Fallback to CLI mode... ! sys.path.append("cli") ! import cli ! cli.main() ! sys.exit(2) # The famous __name__ + __main__ trick... |
From: <iwa...@us...> - 2003-09-11 22:58:32
|
Update of /cvsroot/quickrip/quickrip/gtk In directory sc8-pr-cvs1:/tmp/cvs-serv26043 Modified Files: gtkmain.py Log Message: Added some fixups to gtk crashing Index: gtkmain.py =================================================================== RCS file: /cvsroot/quickrip/quickrip/gtk/gtkmain.py,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** gtkmain.py 11 Sep 2003 22:26:21 -0000 1.27 --- gtkmain.py 11 Sep 2003 22:58:28 -0000 1.28 *************** *** 89,102 **** def initTree(self): - # i = model.insert_before(None, None) - # str = { "first": "1st", "second": "3rd" } - # model.set_value(i, 0, str["first"]) - # model.set_value(i, 1, str["second"]) - # model.set_value(i, 2, "third") - # model.set_value(i, 3, "forth") - # i = model.append(i, None) - # str2 = { "4" : "5", "6" : "seven" } - # model.set_value(i, 0, str2["4"]) - # model.set_value(i, 1, str2["6"]) cell = gtk.CellRendererText() # list = CellRendererCombo --- 89,92 ---- *************** *** 123,129 **** --- 113,128 ---- self.tree.append_column(column45) self.tree.append_column(column5) + self.tree.set_model(gtk.TreeStore( gobject.TYPE_STRING, #track title + gobject.TYPE_STRING, #track length + gobject.TYPE_STRING, #audio language + gobject.TYPE_STRING, #subtitle language + gobject.TYPE_BOOLEAN, #boolean for rip check + gobject.TYPE_PYOBJECT, #reference to object to set based on rip + gobject.TYPE_STRING)) #projected size + def rowChange(self, widget, data=None): try: + #track = track selected = self.tree.get_selection() (self.model, self.modelIter) = selected.get_selected() |
From: <iwa...@us...> - 2003-09-11 22:26:27
|
Update of /cvsroot/quickrip/quickrip/gtk In directory sc8-pr-cvs1:/tmp/cvs-serv17165 Modified Files: gtkmain.py Log Message: Index: gtkmain.py =================================================================== RCS file: /cvsroot/quickrip/quickrip/gtk/gtkmain.py,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** gtkmain.py 10 Aug 2003 04:47:09 -0000 1.26 --- gtkmain.py 11 Sep 2003 22:26:21 -0000 1.27 *************** *** 99,103 **** # model.set_value(i, 0, str2["4"]) # model.set_value(i, 1, str2["6"]) - self.tree.set_headers_clickable(gtk.FALSE) cell = gtk.CellRendererText() # list = CellRendererCombo --- 99,102 ---- *************** *** 435,440 **** self.miScan.show() ! def modelSort(self): ! pass def main(self): --- 434,446 ---- self.miScan.show() ! def modelSort(self, store, a, b): ! first = store.get_value(a, 0) ! second = store.get_value(b, 0) ! if first < second: ! print "sorted" ! return 1 ! pass ! print "unsorted" ! return -1 def main(self): *************** *** 456,461 **** gobject.TYPE_PYOBJECT, #reference to object to set based on rip gobject.TYPE_STRING) #projected size ! #model.set_sort_func(0, self.modelSort) self.tree.set_model(model) self.model = model self.modelIter = None --- 462,468 ---- gobject.TYPE_PYOBJECT, #reference to object to set based on rip gobject.TYPE_STRING) #projected size ! model.set_sort_func(0, self.modelSort) self.tree.set_model(model) + self.tree.set_headers_clickable(gtk.FALSE) self.model = model self.modelIter = None |
From: <te...@us...> - 2003-08-15 12:51:13
|
Update of /cvsroot/quickrip/quickrip In directory sc8-pr-cvs1:/tmp/cvs-serv4615 Modified Files: install.sh Log Message: Updated to install all the new files, and put the manpage in /usr/share/man Index: install.sh =================================================================== RCS file: /cvsroot/quickrip/quickrip/install.sh,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** install.sh 22 Jul 2003 17:12:56 -0000 1.4 --- install.sh 15 Aug 2003 12:21:36 -0000 1.5 *************** *** 50,54 **** echo Changing to root to install files ! su -c "mkdir -p /usr/share/quickrip && cp *.py README LICENSE quickriprc /usr/share/quickrip && chmod a+x /usr/share/quickrip/quickrip.py && ln -sf /usr/share/quickrip/quickrip.py /usr/bin/quickrip && cp quickrip.1.gz /usr/man/man1" echo --- 50,54 ---- echo Changing to root to install files ! su -c "mkdir -p /usr/share/quickrip && cp -r *.py gtk qt cli README LICENSE quickriprc /usr/share/quickrip && chmod a+x /usr/share/quickrip/quickrip.py && ln -sf /usr/share/quickrip/quickrip.py /usr/bin/quickrip && cp quickrip.1.gz /usr/share/man/man1" echo *************** *** 56,58 **** echo If you have any problems using QuickRip, please echo contact me and I\'ll see if I can help. Feel free ! echo to use the icons provided in the "icons" directory. \ No newline at end of file --- 56,58 ---- echo If you have any problems using QuickRip, please echo contact me and I\'ll see if I can help. Feel free ! echo to use the icons provided in the "icons" directory. |
From: <iwa...@us...> - 2003-08-10 04:47:13
|
Update of /cvsroot/quickrip/quickrip/gtk In directory sc8-pr-cvs1:/tmp/cvs-serv6550/gtk Modified Files: gtkmain.py Log Message: Ripping single track, basic avis is working in pygtk. Ripping threading closer to completion. Index: gtkmain.py =================================================================== RCS file: /cvsroot/quickrip/quickrip/gtk/gtkmain.py,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** gtkmain.py 10 Aug 2003 02:41:16 -0000 1.25 --- gtkmain.py 10 Aug 2003 04:47:09 -0000 1.26 *************** *** 47,50 **** --- 47,52 ---- self.config['deinterlacing'] = 0 self.config['aspectratio'] = 0 + # for title in self.titles: + # title['vbr'] = 600 self.ripDVD() *************** *** 533,536 **** --- 535,539 ---- def ui_newPass(self, passtype): self.dialogProgress.setStatus("Performing: " + str(passtype)) + self.dialogProgress.setProgress(float((float(self.ripssofar) / float(self.numrips))), 1) def ui_updateProgress(self, perc, trem, tpass): |
From: <iwa...@us...> - 2003-08-10 04:47:13
|
Update of /cvsroot/quickrip/quickrip In directory sc8-pr-cvs1:/tmp/cvs-serv6550 Modified Files: base.py Log Message: Ripping single track, basic avis is working in pygtk. Ripping threading closer to completion. Index: base.py =================================================================== RCS file: /cvsroot/quickrip/quickrip/base.py,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** base.py 10 Aug 2003 02:41:15 -0000 1.16 --- base.py 10 Aug 2003 04:47:09 -0000 1.17 *************** *** 331,334 **** --- 331,338 ---- self.torip.append(title) self.numrips = len(self.torip) + self.ripssofar = 0 + + # Clean up output dir in case QuickRip crashed out there + os.popen("".join(["rm ", self.config['outputdir'], "frameno.avi 2>/dev/null"])) i = 0 *************** *** 344,350 **** self.run('mplayer', arguments, self.preRip, None, 0, title) - # Clean up output dir in case QuickRip crashed out there - # os.popen("".join(["rm ", self.config['outputdir'], "frameno.avi 2>/dev/null"])) def preRip(self, lines, data): re_crop = re.compile('.*-vop crop=(\d*:\d*:\d*:\d*).*') --- 348,354 ---- self.run('mplayer', arguments, self.preRip, None, 0, title) + # returning of the audio functions will automatically spawn the video + # processing functions as video interlacing requires audio be done first. def preRip(self, lines, data): re_crop = re.compile('.*-vop crop=(\d*:\d*:\d*:\d*).*') *************** *** 366,384 **** # Check PDA mode (universal to all ripping methods) - if int(self.config['pdamode']) is 1: - resolution = "320" - else: - resolution = "720" if self.config['videocodec'] is 2: ! self.scvd(title, output, resolution) elif self.config['audiocodec'] is 1: - output = os.path.join(self.config['outputdir'], "".join([str(title['name']), ".ogm"])) self.oggAudio(title) - self.aviVideo(title, output, resolution, 0) else: - output = os.path.join(self.config['outputdir'], "".join([str(title['name']), ".avi"])) self.mp3Audio(title) - self.aviVideo(title, output, resolution, 1) def oggAudio(self, title): --- 370,380 ---- # Check PDA mode (universal to all ripping methods) if self.config['videocodec'] is 2: ! self.scvd(title) elif self.config['audiocodec'] is 1: self.oggAudio(title) else: self.mp3Audio(title) def oggAudio(self, title): *************** *** 386,389 **** --- 382,387 ---- import output print output.bold("OGG NOT IMPLEMENTED YET!") + #call mencoder with "oggaudio" as passed parameter to thread + #self.aviVideo(title, output, resolution) def mp3Audio(self, title): *************** *** 407,415 **** os.path.join(self.config['outputdir'], "frameno.avi")] ! self.mencode(arguments, "mp3audio") ! def aviVideo(self, title, output, resolution, merge=1): """Rip the video from a DVD title, and optionally merge with audio""" ! self.ui_newPass("video") if self.config['videocodec']: --- 405,445 ---- os.path.join(self.config['outputdir'], "frameno.avi")] ! self.mencode(arguments, ("mp3audio", title)) ! def mencode(self, arguments, data): ! """Run mencoder with given arguments and report progress""" ! self.run('mencoder', arguments, self.mencodeReturned, self.mencodeProgress, 0, data) ! ! def mencodeProgress(self, line, data): ! """Run mencoder with given arguments and report progress""" ! perc = 0 ! trem = 0 ! (passtype, title) = data ! self.ui_newPass(passtype) ! re_progress = re.compile('(\d+)\%\) .*Trem:\s*(\d+\w+)\s+') ! if re_progress.search(line): ! perc = re_progress.search(line).group(1) ! trem = re_progress.search(line).group(2) ! self.ui_updateProgress(perc, trem, passtype) ! ! def mencodeReturned(self, lines, data): ! (passtype, title) = data ! self.ui_updateProgress(1.0, "0", passtype) ! if passtype is "mp3audio": ! self.aviVideo(title) ! if passtype is "avivideo": ! self.ripssofar += 1 ! if self.ripssofar is self.numrips: ! self.ui_finishRipping() ! # elif data is "ogmmerge" ! # self.ogmmerge() ! ! def aviVideo(self, title): """Rip the video from a DVD title, and optionally merge with audio""" ! output = os.path.join(self.config['outputdir'], "".join([str(title['name']), ".avi"])) ! if int(self.config['pdamode']) is 1: ! resolution = "320" ! else: ! resolution = "720" if self.config['videocodec']: *************** *** 426,433 **** vop = "".join([vop, ",", self.dio[self.config['deinterlacing']]]) ! if merge: ! oac = "frameno" ! else: ! oac = "null" arguments = ["-dvd", str(title['id']), "-alang", title['alang'], "-oac", oac, \ --- 456,464 ---- vop = "".join([vop, ",", self.dio[self.config['deinterlacing']]]) ! # if merge: ! # oac = "frameno" ! # else: ! # oac = "null" ! oac = "mp3lame" arguments = ["-dvd", str(title['id']), "-alang", title['alang'], "-oac", oac, \ *************** *** 443,472 **** arguments.insert(5, title['slang']) ! self.mencode(arguments, "video") ! ! def mencode(self, arguments, passtype): ! """Run mencoder with given arguments and report progress""" ! self.run('mencoder', arguments, self.mencodeReturned, self.mencodeProgress, 1, passtype) ! ! def mencodeProgress(self, line, data): ! """Run mencoder with given arguments and report progress""" ! perc = 0 ! trem = 0 ! passtype = data ! re_progress = re.compile('(\d+)\%\) .*Trem:\s*(\d+\w+)\s+') ! if re_progress.search(line): ! perc = re_progress.search(line).group(1) ! trem = re_progress.search(line).group(2) ! self.ui_updateProgress(perc, trem, passtype) ! ! def mencodeReturned(self, lines, data): ! print "Done Mencoding" ! self.ui_updateProgress(1.0, "0", data) def ogmerge(self, number, title, output, resolution): """Merge the OGG audio and MPEG4 video using ogmmerge""" import output print output.bold("NOT IMPLEMENTED YET!") - def svcd(self, number, title, output, resolution): --- 474,484 ---- arguments.insert(5, title['slang']) ! self.mencode(arguments, ("avivideo", title)) def ogmerge(self, number, title, output, resolution): """Merge the OGG audio and MPEG4 video using ogmmerge""" + output = os.path.join(self.config['outputdir'], "".join([str(title['name']), ".ogm"])) import output print output.bold("NOT IMPLEMENTED YET!") def svcd(self, number, title, output, resolution): |
From: <iwa...@us...> - 2003-08-10 04:47:12
|
Update of /cvsroot/quickrip/quickrip/gtk/glade In directory sc8-pr-cvs1:/tmp/cvs-serv6550/gtk/glade Modified Files: gtkprogress.glade Log Message: Ripping single track, basic avis is working in pygtk. Ripping threading closer to completion. Index: gtkprogress.glade =================================================================== RCS file: /cvsroot/quickrip/quickrip/gtk/glade/gtkprogress.glade,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** gtkprogress.glade 10 Aug 2003 01:22:04 -0000 1.5 --- gtkprogress.glade 10 Aug 2003 04:47:09 -0000 1.6 *************** *** 56,117 **** <child> - <widget class="GtkProgressBar" id="progressbar1"> - <property name="width_request">258</property> - <property name="visible">True</property> - <property name="orientation">GTK_PROGRESS_LEFT_TO_RIGHT</property> - <property name="fraction">0</property> - <property name="pulse_step">0.1</property> - </widget> - <packing> - <property name="left_attach">1</property> - <property name="right_attach">2</property> - <property name="top_attach">0</property> - <property name="bottom_attach">1</property> - <property name="x_padding">5</property> - <property name="y_padding">5</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkProgressBar" id="progressbar2"> - <property name="width_request">258</property> - <property name="orientation">GTK_PROGRESS_LEFT_TO_RIGHT</property> - <property name="fraction">0</property> - <property name="pulse_step">0.1</property> - </widget> - <packing> - <property name="left_attach">1</property> - <property name="right_attach">2</property> - <property name="top_attach">1</property> - <property name="bottom_attach">2</property> - <property name="x_padding">5</property> - <property name="y_padding">5</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkProgressBar" id="progressbar3"> - <property name="width_request">258</property> - <property name="orientation">GTK_PROGRESS_LEFT_TO_RIGHT</property> - <property name="fraction">0</property> - <property name="pulse_step">0.1</property> - </widget> - <packing> - <property name="left_attach">1</property> - <property name="right_attach">2</property> - <property name="top_attach">2</property> - <property name="bottom_attach">3</property> - <property name="x_padding">5</property> - <property name="y_padding">5</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> <widget class="GtkLabel" id="label3"> <property name="label" translatable="yes">Dunno:</property> --- 56,59 ---- *************** *** 185,188 **** --- 127,185 ---- <property name="y_padding">5</property> <property name="x_options"></property> + <property name="y_options"></property> + </packing> + </child> + + <child> + <widget class="GtkProgressBar" id="progressbar1"> + <property name="width_request">258</property> + <property name="visible">True</property> + <property name="orientation">GTK_PROGRESS_LEFT_TO_RIGHT</property> + <property name="fraction">0</property> + <property name="pulse_step">0.1</property> + </widget> + <packing> + <property name="left_attach">1</property> + <property name="right_attach">2</property> + <property name="top_attach">0</property> + <property name="bottom_attach">1</property> + <property name="x_padding">5</property> + <property name="y_padding">5</property> + <property name="y_options"></property> + </packing> + </child> + + <child> + <widget class="GtkProgressBar" id="progressbar2"> + <property name="width_request">258</property> + <property name="orientation">GTK_PROGRESS_LEFT_TO_RIGHT</property> + <property name="fraction">0</property> + <property name="pulse_step">0.1</property> + </widget> + <packing> + <property name="left_attach">1</property> + <property name="right_attach">2</property> + <property name="top_attach">1</property> + <property name="bottom_attach">2</property> + <property name="x_padding">5</property> + <property name="y_padding">5</property> + <property name="y_options"></property> + </packing> + </child> + + <child> + <widget class="GtkProgressBar" id="progressbar3"> + <property name="width_request">258</property> + <property name="orientation">GTK_PROGRESS_LEFT_TO_RIGHT</property> + <property name="fraction">0</property> + <property name="pulse_step">0.1</property> + </widget> + <packing> + <property name="left_attach">1</property> + <property name="right_attach">2</property> + <property name="top_attach">2</property> + <property name="bottom_attach">3</property> + <property name="x_padding">5</property> + <property name="y_padding">5</property> <property name="y_options"></property> </packing> |
From: <iwa...@us...> - 2003-08-10 02:41:18
|
Update of /cvsroot/quickrip/quickrip/gtk In directory sc8-pr-cvs1:/tmp/cvs-serv27190/gtk Modified Files: gtkmain.py gtksettings.py Log Message: Threaded rip somewhat working. Index: gtkmain.py =================================================================== RCS file: /cvsroot/quickrip/quickrip/gtk/gtkmain.py,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** gtkmain.py 10 Aug 2003 01:22:04 -0000 1.24 --- gtkmain.py 10 Aug 2003 02:41:16 -0000 1.25 *************** *** 45,48 **** --- 45,50 ---- self.hideRip() self.hideScan() + self.config['deinterlacing'] = 0 + self.config['aspectratio'] = 0 self.ripDVD() *************** *** 287,291 **** self.dialogSettings.wcbAudioCodec.entry.set_text(self.config['audiocodec']) ! self.dialogSettings.wcbVolume.entry.set_text(self.config['volume']) self.dialogSettings.wcbQuality.entry.set_text(self.config['quality']) --- 289,293 ---- self.dialogSettings.wcbAudioCodec.entry.set_text(self.config['audiocodec']) ! self.dialogSettings.wcbVolume.entry.set_text(self.config['volumead']) self.dialogSettings.wcbQuality.entry.set_text(self.config['quality']) *************** *** 306,310 **** self.parser.set('audio', 'audiocodec', self.config['audiocodec']) self.parser.set('audio', 'quality', self.config['quality']) ! self.parser.set('audio', 'volume', self.config['volume']) self.parser.write(open(file, 'w')) --- 308,312 ---- self.parser.set('audio', 'audiocodec', self.config['audiocodec']) self.parser.set('audio', 'quality', self.config['quality']) ! self.parser.set('audio', 'volumead', self.config['volumead']) self.parser.write(open(file, 'w')) *************** *** 336,340 **** config['audiocodec'] = parser.get("audio", "audiocodec") config['quality'] = parser.get("audio", "quality") ! config['volume'] = parser.get("audio", "volume") return (config, parser) --- 338,342 ---- config['audiocodec'] = parser.get("audio", "audiocodec") config['quality'] = parser.get("audio", "quality") ! config['volumead'] = parser.get("audio", "volumead") return (config, parser) *************** *** 397,401 **** parser.set("audio", "audiocodec", "MP3") parser.set("audio", "quality", "128") ! parser.set("audio", "volume", "+0") parser.write(open(file, 'w')) --- 399,403 ---- parser.set("audio", "audiocodec", "MP3") parser.set("audio", "quality", "128") ! parser.set("audio", "volumead", "+0") parser.write(open(file, 'w')) *************** *** 470,477 **** def ui_dispDVD(self, numtitles): gtk.threads_enter() ! print "Found %s titles" % (self.numtitles) ! gtk.threads_leave() ! self.dialogProgress.setStatus("Scanning titles") self.dialogProgress.setProgress(0.0) def ui_dispTitle(self, track): --- 472,478 ---- def ui_dispDVD(self, numtitles): gtk.threads_enter() ! self.dialogProgress.setStatus("Found " + str(self.numtitles) + " titles") self.dialogProgress.setProgress(0.0) + gtk.threads_leave() def ui_dispTitle(self, track): *************** *** 532,540 **** def ui_newPass(self, passtype): self.dialogProgress.setStatus("Performing: " + str(passtype)) - print "new pass" def ui_updateProgress(self, perc, trem, tpass): ! print "%s percent, %s remaining in %s" % (perc, trem, tpass) ! self.dialogProgress.setProgress(perc, 2) def ui_finishRipping(self): --- 533,539 ---- def ui_newPass(self, passtype): self.dialogProgress.setStatus("Performing: " + str(passtype)) def ui_updateProgress(self, perc, trem, tpass): ! self.dialogProgress.setProgress(float((float(perc) / 100.0)), 2) def ui_finishRipping(self): Index: gtksettings.py =================================================================== RCS file: /cvsroot/quickrip/quickrip/gtk/gtksettings.py,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** gtksettings.py 8 Aug 2003 12:17:05 -0000 1.13 --- gtksettings.py 10 Aug 2003 02:41:16 -0000 1.14 *************** *** 81,85 **** self.parent.config['audiocodec'] = self.wcbAudioCodec.entry.get_text() self.parent.config['quality'] = self.wcbQuality.entry.get_text() ! self.parent.config['volume'] = self.wcbVolume.entry.get_text() self.parent.writeSettings(self.parent.homefile) --- 81,85 ---- self.parent.config['audiocodec'] = self.wcbAudioCodec.entry.get_text() self.parent.config['quality'] = self.wcbQuality.entry.get_text() ! self.parent.config['volumead'] = self.wcbVolume.entry.get_text() self.parent.writeSettings(self.parent.homefile) |
From: <iwa...@us...> - 2003-08-10 02:41:18
|
Update of /cvsroot/quickrip/quickrip In directory sc8-pr-cvs1:/tmp/cvs-serv27190 Modified Files: base.py Log Message: Threaded rip somewhat working. Index: base.py =================================================================== RCS file: /cvsroot/quickrip/quickrip/base.py,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** base.py 10 Aug 2003 01:40:19 -0000 1.15 --- base.py 10 Aug 2003 02:41:15 -0000 1.16 *************** *** 307,310 **** --- 307,311 ---- title['slangs'] = slangs title['slang'] = ' ' # biggs changed to a double space + title['crop'] = "" self.titles.append(title) *************** *** 331,340 **** self.numrips = len(self.torip) - # Check PDA mode (universal to all ripping methods) - if int(self.config['pdamode']) is 1: - resolution = "320" - else: - resolution = "720" - i = 0 for title in self.torip: --- 332,335 ---- *************** *** 348,352 **** arguments = ["-dvd ", str(title['id']), "-vop", "cropdetect", "-nosound", "-vo", "null", "-frames", "10", "-sstep", str(sstep)] ! self.run('mplayer', arguments, self.preRip, None, title) # Clean up output dir in case QuickRip crashed out there # os.popen("".join(["rm ", self.config['outputdir'], "frameno.avi 2>/dev/null"])) --- 343,347 ---- arguments = ["-dvd ", str(title['id']), "-vop", "cropdetect", "-nosound", "-vo", "null", "-frames", "10", "-sstep", str(sstep)] ! self.run('mplayer', arguments, self.preRip, None, 0, title) # Clean up output dir in case QuickRip crashed out there # os.popen("".join(["rm ", self.config['outputdir'], "frameno.avi 2>/dev/null"])) *************** *** 354,361 **** def preRip(self, lines, data): re_crop = re.compile('.*-vop crop=(\d*:\d*:\d*:\d*).*') - title = data crop_options = {} common_crop = "" cc_hits = 0 for line in lines: if re_crop.search(line): --- 349,356 ---- def preRip(self, lines, data): re_crop = re.compile('.*-vop crop=(\d*:\d*:\d*:\d*).*') crop_options = {} common_crop = "" cc_hits = 0 + title = data for line in lines: if re_crop.search(line): *************** *** 368,372 **** crop_options[crop] = 1 ! data['crop'] = common_crop if self.config['videocodec'] is 2: --- 363,373 ---- crop_options[crop] = 1 ! title['crop'] = common_crop ! ! # Check PDA mode (universal to all ripping methods) ! if int(self.config['pdamode']) is 1: ! resolution = "320" ! else: ! resolution = "720" if self.config['videocodec'] is 2: *************** *** 400,404 **** else: vol = "" ! lameopts = "".join(["cbr=", str(config.abr[self.title['abr']]), str(vol)]) arguments = ["-dvd", str(title['id']), "-alang", title['alang'], "-oac", \ --- 401,405 ---- else: vol = "" ! lameopts = "".join(["cbr=", str(title['abr']), str(vol)]) arguments = ["-dvd", str(title['id']), "-alang", title['alang'], "-oac", \ *************** *** 435,444 **** if int(self.config['aspectratio']) is not 0: ! arguments.insert(3, "-aspect") ! arguments.insert(4, self.aro[self.config['aspectratio']]) if title['slang']: ! arguments.insert(3, "-slang") ! arguments.insert(4, title['slang']) self.mencode(arguments, "video") --- 436,445 ---- if int(self.config['aspectratio']) is not 0: ! arguments.insert(4, "-aspect") ! arguments.insert(5, self.aro[self.config['aspectratio']]) if title['slang']: ! arguments.insert(4, "-slang") ! arguments.insert(5, title['slang']) self.mencode(arguments, "video") *************** *** 450,454 **** def mencodeProgress(self, line, data): """Run mencoder with given arguments and report progress""" - self.run('mencoder', arguments, self.mencodeReturned, self.mencodeProgress, 1, passtype) perc = 0 trem = 0 --- 451,454 ---- |
From: <iwa...@us...> - 2003-08-10 01:40:22
|
Update of /cvsroot/quickrip/quickrip In directory sc8-pr-cvs1:/tmp/cvs-serv20834 Modified Files: base.py Log Message: Some of toms changes merged Index: base.py =================================================================== RCS file: /cvsroot/quickrip/quickrip/base.py,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** base.py 10 Aug 2003 01:22:03 -0000 1.14 --- base.py 10 Aug 2003 01:40:19 -0000 1.15 *************** *** 20,25 **** class CommandThread(threading.Thread): """Handle threading of external commands""" ! def __init__(self, command, updatefunc, finalfunc, flushbuffer, data, lock): threading.Thread.__init__(self) self.updateFunc = updatefunc self.finalFunc = finalfunc --- 20,26 ---- class CommandThread(threading.Thread): """Handle threading of external commands""" ! def __init__(self, parent, command, updatefunc, finalfunc, flushbuffer, data, lock): threading.Thread.__init__(self) + self.parent = parent self.updateFunc = updatefunc self.finalFunc = finalfunc *************** *** 30,34 **** def run(self): - # self.lock = thread.allocate_lock() self.lock.acquire() self.pipe = popen2.Popen4(self.command) --- 31,34 ---- *************** *** 191,195 **** command[:0] = [self.config[program]] ! self.thread = CommandThread(command, updatefunc, finalfunc, flushbuffer, data, self.lock) self.thread.start() --- 191,195 ---- command[:0] = [self.config[program]] ! self.thread = CommandThread(self, command, updatefunc, finalfunc, flushbuffer, data, self.lock) self.thread.start() *************** *** 208,212 **** """Scan the DVD and build up a data structure for the titles""" self.ui_startScanning() ! self.lock = thread.allocate_lock() #threading.allocate_lock() # Reset values to default (in case user scans two different discs in same session) --- 208,212 ---- """Scan the DVD and build up a data structure for the titles""" self.ui_startScanning() ! self.lock = thread.allocate_lock() # Reset values to default (in case user scans two different discs in same session) *************** *** 218,231 **** self.re_title = re.compile('There are (\d*) titles on this DVD') self.re_error = re.compile('libdvdread: Could not open device') ! self.run('mplayer', arguments, self.total_DVDInfo) #self.up_DVDInfo) ! ! # def up_DVDInfo(self, line, data): ! # could do some status update here as well... ! # if self.re_error.search(line): ! # print "no titles" ! # self.ui_noTitles() ! # elif self.re_title.search(line): ! # self.numtitles = int(re_title.search(line).group(1)) ! # print "***GOT NUMTITLES***" def total_DVDInfo(self, lines, data): --- 218,222 ---- self.re_title = re.compile('There are (\d*) titles on this DVD') self.re_error = re.compile('libdvdread: Could not open device') ! self.run('mplayer', arguments, self.total_DVDInfo) def total_DVDInfo(self, lines, data): *************** *** 309,313 **** title['timelabel'] = time_label title['size'] = 680 ! title['vbr'] = max(2000, self.calcRate(int(time), 96, 680)) title['abr'] = 128 #biggs added title['rip'] = "no" --- 300,304 ---- title['timelabel'] = time_label title['size'] = 680 ! title['vbr'] = min(2000, self.calcRate(int(time), 96, 680)) title['abr'] = 128 #biggs added title['rip'] = "no" *************** *** 377,381 **** crop_options[crop] = 1 ! title['crop'] = common_crop if self.config['videocodec'] is 2: --- 368,372 ---- crop_options[crop] = 1 ! data['crop'] = common_crop if self.config['videocodec'] is 2: |
From: <iwa...@us...> - 2003-08-10 01:22:06
|
Update of /cvsroot/quickrip/quickrip In directory sc8-pr-cvs1:/tmp/cvs-serv19121 Modified Files: base.py Log Message: Halfway working on threads for base among other things. Progress dialog changed to threaded mode. Index: base.py =================================================================== RCS file: /cvsroot/quickrip/quickrip/base.py,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** base.py 9 Aug 2003 10:50:07 -0000 1.13 --- base.py 10 Aug 2003 01:22:03 -0000 1.14 *************** *** 20,26 **** class CommandThread(threading.Thread): """Handle threading of external commands""" ! def __init__(self, parent, command, updatefunc, finalfunc, flushbuffer, data, lock): threading.Thread.__init__(self) - self.parent = parent self.updateFunc = updatefunc self.finalFunc = finalfunc --- 20,25 ---- class CommandThread(threading.Thread): """Handle threading of external commands""" ! def __init__(self, command, updatefunc, finalfunc, flushbuffer, data, lock): threading.Thread.__init__(self) self.updateFunc = updatefunc self.finalFunc = finalfunc *************** *** 31,44 **** def run(self): self.lock.acquire() ! self.parent.pipe = popen2.Popen4(self.command) ! pid = self.parent.pipe.pid totallines = [] while 1: try: if self.flushbuffer: ! line = self.parent.pipe.fromchild.read(1000) else: ! line = self.parent.pipe.fromchild.readline() if not line: --- 30,44 ---- def run(self): + # self.lock = thread.allocate_lock() self.lock.acquire() ! self.pipe = popen2.Popen4(self.command) ! pid = self.pipe.pid totallines = [] while 1: try: if self.flushbuffer: ! line = self.pipe.fromchild.read(1000) else: ! line = self.pipe.fromchild.readline() if not line: *************** *** 64,67 **** --- 64,68 ---- self.lock.release() + sys.exit(2) *************** *** 70,75 **** """Kills current process (pipe)""" try: ! os.kill(self.parent.pipe.pid, 9) ! os.waitpid(self.parent.pipe.pid, os.WNOHANG) except: pass --- 71,76 ---- """Kills current process (pipe)""" try: ! os.kill(self.pipe.pid, 9) ! os.waitpid(self.pipe.pid, os.WNOHANG) except: pass *************** *** 184,188 **** ! def run(self, program, arguments, finalfunc=None, updatefunc=None, flushbuffer=0, data=None, lock=None): """Runs a program; supply program name (string) and arguments (list)""" --- 185,189 ---- ! def run(self, program, arguments, finalfunc, updatefunc=None, flushbuffer=0, data=None, lock=None): """Runs a program; supply program name (string) and arguments (list)""" *************** *** 190,194 **** command[:0] = [self.config[program]] ! self.thread = CommandThread(self, command, updatefunc, finalfunc, flushbuffer, data, self.lock) self.thread.start() --- 191,195 ---- command[:0] = [self.config[program]] ! self.thread = CommandThread(command, updatefunc, finalfunc, flushbuffer, data, self.lock) self.thread.start() *************** *** 207,211 **** """Scan the DVD and build up a data structure for the titles""" self.ui_startScanning() ! self.lock = thread.allocate_lock() # Reset values to default (in case user scans two different discs in same session) --- 208,212 ---- """Scan the DVD and build up a data structure for the titles""" self.ui_startScanning() ! self.lock = thread.allocate_lock() #threading.allocate_lock() # Reset values to default (in case user scans two different discs in same session) *************** *** 217,222 **** self.re_title = re.compile('There are (\d*) titles on this DVD') self.re_error = re.compile('libdvdread: Could not open device') ! self.run('mplayer', arguments, self.total_DVDInfo) def total_DVDInfo(self, lines, data): --- 218,231 ---- self.re_title = re.compile('There are (\d*) titles on this DVD') self.re_error = re.compile('libdvdread: Could not open device') ! self.run('mplayer', arguments, self.total_DVDInfo) #self.up_DVDInfo) + # def up_DVDInfo(self, line, data): + # could do some status update here as well... + # if self.re_error.search(line): + # print "no titles" + # self.ui_noTitles() + # elif self.re_title.search(line): + # self.numtitles = int(re_title.search(line).group(1)) + # print "***GOT NUMTITLES***" def total_DVDInfo(self, lines, data): *************** *** 254,260 **** --- 263,274 ---- alangs = [] slangs = [] + chapters = None #Needed for error checking below + time = None + time_label = None for line in lines: if re_error.search(line): + print "error on " + str(data) + print line self.ui_noTitles() return *************** *** 277,280 **** --- 291,300 ---- if re_chap.search(line): chapters = re_chap.search(line).group(1) + + if chapters == None or time == None or time_label == None: + print "Error during execution:" + print line + self.ui_noTitles() + return i = data *************** *** 289,293 **** title['timelabel'] = time_label title['size'] = 680 ! title['vbr'] = self.calcRate(int(time), 96, 680) title['abr'] = 128 #biggs added title['rip'] = "no" --- 309,313 ---- title['timelabel'] = time_label title['size'] = 680 ! title['vbr'] = max(2000, self.calcRate(int(time), 96, 680)) title['abr'] = 128 #biggs added title['rip'] = "no" *************** *** 326,331 **** resolution = "720" - self.lock = thread.allocate_lock() - i = 0 for title in self.torip: --- 346,349 ---- *************** *** 334,373 **** # Look for cropping - self.found_cropping = 0 sstep = int(title['time']) / 31 if not sstep: sstep = 1 ! arguments = ["-dvd", str(title['id']), "-vop", "cropdetect", "-nosound", "-vo", "null", "-frames", "10", "-sstep", str(sstep)] ! self.run('mplayer', arguments, self.total_Crop, None, 0, title, self.lock) ! ! # Wait until cropping is found before proceeding to build rip commands ! # (locking threads won't stop QuickRip from building commands in background) ! while 1: ! if self.found_cropping: ! del self.found_cropping ! break ! ! # Clean up output dir in case QuickRip crashed out there ! os.popen("".join(["rm ", self.config['outputdir'], "frameno.avi 2>/dev/null"])) ! ! self.newpass = 1 ! if self.config['videocodec'] is 2: ! self.scvd(title, output, resolution) ! ! elif self.config['audiocodec'] is 1: ! output = os.path.join(self.config['outputdir'], "".join([str(title['name']), ".ogm"])) ! self.oggAudio(title) ! sleep(5) # makes sure the audio thread has time to start and get a lock ! self.aviVideo(title, output, resolution, 0) ! ! else: ! output = os.path.join(self.config['outputdir'], "".join([str(title['name']), ".avi"])) ! self.mp3Audio(title) ! sleep(5) # makes sure the audio thread has time to start and get a lock ! self.aviVideo(title, output, resolution, 1) ! ! def total_Crop(self, lines, title): ! re_crop = re.compile('-vop crop=(\d+:\d+:\d+:\d+)') crop_options = {} common_crop = "" --- 352,367 ---- # Look for cropping sstep = int(title['time']) / 31 if not sstep: sstep = 1 ! arguments = ["-dvd ", str(title['id']), "-vop", "cropdetect", "-nosound", "-vo", "null", "-frames", "10", "-sstep", str(sstep)] ! self.run('mplayer', arguments, self.preRip, None, title) ! # Clean up output dir in case QuickRip crashed out there ! # os.popen("".join(["rm ", self.config['outputdir'], "frameno.avi 2>/dev/null"])) ! ! def preRip(self, lines, data): ! re_crop = re.compile('.*-vop crop=(\d*:\d*:\d*:\d*).*') ! title = data crop_options = {} common_crop = "" *************** *** 382,414 **** except: crop_options[crop] = 1 - title['crop'] = common_crop - self.found_cropping = 1 - - - def mencode(self, arguments, passtype): - """Run mencoder with given arguments and report progress""" - self.perc = 0 - self.trem = 0 - self.run('mencoder', arguments, self.total_Mencode, self.update_Mencode, 1, passtype, self.lock) - - - def update_Mencode(self, line, passtype): - if self.newpass: - self.ui_newPass(passtype) - self.newpass = 0 - re_progress = re.compile('(\d+)\%\) .*Trem:\s*(\d+\w+)\s+') - if re_progress.search(line): - self.perc = re_progress.search(line).group(1) - self.trem = re_progress.search(line).group(2) - self.ui_updateProgress(self.perc, self.trem, passtype) ! def total_Mencode(self, lines, passtype): ! self.newpass = 1 def mp3Audio(self, title): """Rip the audio from a DVD title and encode as MP3""" try: os.popen("".join(["rm ", os.path.join(self.config['outputdir'], "frameno.avi")])) except: --- 376,404 ---- except: crop_options[crop] = 1 + title['crop'] = common_crop ! if self.config['videocodec'] is 2: ! self.scvd(title, output, resolution) ! elif self.config['audiocodec'] is 1: ! output = os.path.join(self.config['outputdir'], "".join([str(title['name']), ".ogm"])) ! self.oggAudio(title) ! self.aviVideo(title, output, resolution, 0) ! else: ! output = os.path.join(self.config['outputdir'], "".join([str(title['name']), ".avi"])) ! self.mp3Audio(title) ! self.aviVideo(title, output, resolution, 1) + def oggAudio(self, title): + """Rip the audio from a DVD title and encode as OGG""" + import output + print output.bold("OGG NOT IMPLEMENTED YET!") def mp3Audio(self, title): """Rip the audio from a DVD title and encode as MP3""" + self.ui_newPass("mp3audio") + try: + print "Trying to clean files inline, this may lag" os.popen("".join(["rm ", os.path.join(self.config['outputdir'], "frameno.avi")])) except: *************** *** 419,423 **** else: vol = "" ! lameopts = "".join(["cbr=", str(config.abr[self.config['audiobitrate']]), str(vol)]) arguments = ["-dvd", str(title['id']), "-alang", title['alang'], "-oac", \ --- 409,413 ---- else: vol = "" ! lameopts = "".join(["cbr=", str(config.abr[self.title['abr']]), str(vol)]) arguments = ["-dvd", str(title['id']), "-alang", title['alang'], "-oac", \ *************** *** 427,439 **** self.mencode(arguments, "mp3audio") - - def oggAudio(self, title): - """Rip the audio from a DVD title and encode as OGG""" - import output - print output.bold("NOT IMPLEMENTED YET!") - - def aviVideo(self, title, output, resolution, merge=1): """Rip the video from a DVD title, and optionally merge with audio""" if self.config['videocodec']: --- 417,423 ---- self.mencode(arguments, "mp3audio") def aviVideo(self, title, output, resolution, merge=1): """Rip the video from a DVD title, and optionally merge with audio""" + self.ui_newPass("video") if self.config['videocodec']: *************** *** 451,455 **** if merge: ! oac = "copy" else: oac = "null" --- 435,439 ---- if merge: ! oac = "frameno" else: oac = "null" *************** *** 460,472 **** if int(self.config['aspectratio']) is not 0: ! arguments.insert(4, "-aspect") ! arguments.insert(5, self.aro[self.config['aspectratio']]) ! if title['slang'] != ' ': ! arguments.insert(4, "-slang") ! arguments.insert(5, title['slang']) self.mencode(arguments, "video") def ogmerge(self, number, title, output, resolution): --- 444,475 ---- if int(self.config['aspectratio']) is not 0: ! arguments.insert(3, "-aspect") ! arguments.insert(4, self.aro[self.config['aspectratio']]) ! if title['slang']: ! arguments.insert(3, "-slang") ! arguments.insert(4, title['slang']) self.mencode(arguments, "video") + def mencode(self, arguments, passtype): + """Run mencoder with given arguments and report progress""" + self.run('mencoder', arguments, self.mencodeReturned, self.mencodeProgress, 1, passtype) + + def mencodeProgress(self, line, data): + """Run mencoder with given arguments and report progress""" + self.run('mencoder', arguments, self.mencodeReturned, self.mencodeProgress, 1, passtype) + perc = 0 + trem = 0 + passtype = data + re_progress = re.compile('(\d+)\%\) .*Trem:\s*(\d+\w+)\s+') + if re_progress.search(line): + perc = re_progress.search(line).group(1) + trem = re_progress.search(line).group(2) + self.ui_updateProgress(perc, trem, passtype) + + def mencodeReturned(self, lines, data): + print "Done Mencoding" + self.ui_updateProgress(1.0, "0", data) def ogmerge(self, number, title, output, resolution): *************** *** 479,483 **** """Rip the title to an SVCD MPEG using transcode""" import output ! print output.bold("NOT IMPLEMENTED YET!") ## INHERIT THE CLASS AND SUBSTITUE THESE CLASS METHODS WITH YOUR --- 482,486 ---- """Rip the title to an SVCD MPEG using transcode""" import output ! print output.bold("SVCD NOT IMPLEMENTED YET!") ## INHERIT THE CLASS AND SUBSTITUE THESE CLASS METHODS WITH YOUR |
From: <iwa...@us...> - 2003-08-10 01:22:06
|
Update of /cvsroot/quickrip/quickrip/gtk/glade In directory sc8-pr-cvs1:/tmp/cvs-serv19121/gtk/glade Modified Files: gtkprogress.glade Log Message: Halfway working on threads for base among other things. Progress dialog changed to threaded mode. Index: gtkprogress.glade =================================================================== RCS file: /cvsroot/quickrip/quickrip/gtk/glade/gtkprogress.glade,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** gtkprogress.glade 8 Aug 2003 07:08:42 -0000 1.4 --- gtkprogress.glade 10 Aug 2003 01:22:04 -0000 1.5 *************** *** 5,8 **** --- 5,9 ---- <widget class="GtkWindow" id="window"> + <property name="visible">True</property> <property name="title" translatable="yes">QuickRip Status</property> <property name="type">GTK_WINDOW_TOPLEVEL</property> *************** *** 16,20 **** <property name="visible">True</property> <property name="n_rows">4</property> ! <property name="n_columns">2</property> <property name="homogeneous">False</property> <property name="row_spacing">0</property> --- 17,21 ---- <property name="visible">True</property> <property name="n_rows">4</property> ! <property name="n_columns">1</property> <property name="homogeneous">False</property> <property name="row_spacing">0</property> *************** *** 22,28 **** <child> ! <widget class="GtkLabel" id="labelStatus"> <property name="visible">True</property> ! <property name="label" translatable="yes">Ripping track 1/3, etc...</property> <property name="use_underline">False</property> <property name="use_markup">False</property> --- 23,29 ---- <child> ! <widget class="GtkLabel" id="labelTime"> <property name="visible">True</property> ! <property name="label" translatable="yes">Time Remaining: N/A</property> <property name="use_underline">False</property> <property name="use_markup">False</property> *************** *** 37,43 **** <packing> <property name="left_attach">0</property> ! <property name="right_attach">2</property> ! <property name="top_attach">0</property> ! <property name="bottom_attach">1</property> <property name="x_options"></property> <property name="y_options"></property> --- 38,44 ---- <packing> <property name="left_attach">0</property> ! <property name="right_attach">1</property> ! <property name="top_attach">1</property> ! <property name="bottom_attach">2</property> <property name="x_options"></property> <property name="y_options"></property> *************** *** 46,69 **** <child> ! <widget class="GtkLabel" id="labelTime"> <property name="visible">True</property> ! <property name="label" translatable="yes">Time Remaining: N/A</property> ! <property name="use_underline">False</property> ! <property name="use_markup">False</property> ! <property name="justify">GTK_JUSTIFY_LEFT</property> ! <property name="wrap">False</property> ! <property name="selectable">False</property> ! <property name="xalign">0</property> ! <property name="yalign">0.5</property> ! <property name="xpad">5</property> ! <property name="ypad">5</property> </widget> <packing> <property name="left_attach">0</property> ! <property name="right_attach">2</property> ! <property name="top_attach">1</property> ! <property name="bottom_attach">2</property> ! <property name="x_options"></property> ! <property name="y_options"></property> </packing> </child> --- 47,198 ---- <child> ! <widget class="GtkTable" id="table2"> <property name="visible">True</property> ! <property name="n_rows">3</property> ! <property name="n_columns">2</property> ! <property name="homogeneous">False</property> ! <property name="row_spacing">0</property> ! <property name="column_spacing">0</property> ! ! <child> ! <widget class="GtkProgressBar" id="progressbar1"> ! <property name="width_request">258</property> ! <property name="visible">True</property> ! <property name="orientation">GTK_PROGRESS_LEFT_TO_RIGHT</property> ! <property name="fraction">0</property> ! <property name="pulse_step">0.1</property> ! </widget> ! <packing> ! <property name="left_attach">1</property> ! <property name="right_attach">2</property> ! <property name="top_attach">0</property> ! <property name="bottom_attach">1</property> ! <property name="x_padding">5</property> ! <property name="y_padding">5</property> ! <property name="x_options">fill</property> ! <property name="y_options"></property> ! </packing> ! </child> ! ! <child> ! <widget class="GtkProgressBar" id="progressbar2"> ! <property name="width_request">258</property> ! <property name="orientation">GTK_PROGRESS_LEFT_TO_RIGHT</property> ! <property name="fraction">0</property> ! <property name="pulse_step">0.1</property> ! </widget> ! <packing> ! <property name="left_attach">1</property> ! <property name="right_attach">2</property> ! <property name="top_attach">1</property> ! <property name="bottom_attach">2</property> ! <property name="x_padding">5</property> ! <property name="y_padding">5</property> ! <property name="x_options">fill</property> ! <property name="y_options"></property> ! </packing> ! </child> ! ! <child> ! <widget class="GtkProgressBar" id="progressbar3"> ! <property name="width_request">258</property> ! <property name="orientation">GTK_PROGRESS_LEFT_TO_RIGHT</property> ! <property name="fraction">0</property> ! <property name="pulse_step">0.1</property> ! </widget> ! <packing> ! <property name="left_attach">1</property> ! <property name="right_attach">2</property> ! <property name="top_attach">2</property> ! <property name="bottom_attach">3</property> ! <property name="x_padding">5</property> ! <property name="y_padding">5</property> ! <property name="x_options">fill</property> ! <property name="y_options"></property> ! </packing> ! </child> ! ! <child> ! <widget class="GtkLabel" id="label3"> ! <property name="label" translatable="yes">Dunno:</property> ! <property name="use_underline">False</property> ! <property name="use_markup">False</property> ! <property name="justify">GTK_JUSTIFY_LEFT</property> ! <property name="wrap">False</property> ! <property name="selectable">False</property> ! <property name="xalign">0</property> ! <property name="yalign">0.5</property> ! <property name="xpad">0</property> ! <property name="ypad">0</property> ! </widget> ! <packing> ! <property name="left_attach">0</property> ! <property name="right_attach">1</property> ! <property name="top_attach">2</property> ! <property name="bottom_attach">3</property> ! <property name="x_padding">5</property> ! <property name="y_padding">5</property> ! <property name="x_options"></property> ! <property name="y_options"></property> ! </packing> ! </child> ! ! <child> ! <widget class="GtkLabel" id="label2"> ! <property name="label" translatable="yes">Current Pass:</property> ! <property name="use_underline">False</property> ! <property name="use_markup">False</property> ! <property name="justify">GTK_JUSTIFY_LEFT</property> ! <property name="wrap">False</property> ! <property name="selectable">False</property> ! <property name="xalign">0</property> ! <property name="yalign">0.5</property> ! <property name="xpad">0</property> ! <property name="ypad">0</property> ! </widget> ! <packing> ! <property name="left_attach">0</property> ! <property name="right_attach">1</property> ! <property name="top_attach">1</property> ! <property name="bottom_attach">2</property> ! <property name="x_padding">5</property> ! <property name="y_padding">5</property> ! <property name="x_options"></property> ! <property name="y_options"></property> ! </packing> ! </child> ! ! <child> ! <widget class="GtkLabel" id="labelOverall"> ! <property name="visible">True</property> ! <property name="label" translatable="yes">Overall:</property> ! <property name="use_underline">False</property> ! <property name="use_markup">False</property> ! <property name="justify">GTK_JUSTIFY_LEFT</property> ! <property name="wrap">False</property> ! <property name="selectable">False</property> ! <property name="xalign">0.5</property> ! <property name="yalign">0.5</property> ! <property name="xpad">0</property> ! <property name="ypad">0</property> ! </widget> ! <packing> ! <property name="left_attach">0</property> ! <property name="right_attach">1</property> ! <property name="top_attach">0</property> ! <property name="bottom_attach">1</property> ! <property name="x_padding">5</property> ! <property name="y_padding">5</property> ! <property name="x_options"></property> ! <property name="y_options"></property> ! </packing> ! </child> </widget> <packing> <property name="left_attach">0</property> ! <property name="right_attach">1</property> ! <property name="top_attach">2</property> ! <property name="bottom_attach">3</property> ! <property name="x_options">fill</property> </packing> </child> *************** *** 137,144 **** <packing> <property name="left_attach">0</property> ! <property name="right_attach">2</property> <property name="top_attach">3</property> <property name="bottom_attach">4</property> ! <property name="x_options">expand</property> <property name="y_options"></property> </packing> --- 266,273 ---- <packing> <property name="left_attach">0</property> ! <property name="right_attach">1</property> <property name="top_attach">3</property> <property name="bottom_attach">4</property> ! <property name="x_options"></property> <property name="y_options"></property> </packing> *************** *** 146,163 **** <child> ! <widget class="GtkProgressBar" id="progressbar"> ! <property name="width_request">258</property> <property name="visible">True</property> ! <property name="orientation">GTK_PROGRESS_LEFT_TO_RIGHT</property> ! <property name="fraction">0</property> ! <property name="pulse_step">0.1</property> </widget> <packing> <property name="left_attach">0</property> ! <property name="right_attach">2</property> ! <property name="top_attach">2</property> ! <property name="bottom_attach">3</property> <property name="x_padding">5</property> <property name="y_padding">5</property> <property name="y_options"></property> </packing> --- 275,299 ---- <child> ! <widget class="GtkLabel" id="labelStatus"> <property name="visible">True</property> ! <property name="label" translatable="yes">Waiting</property> ! <property name="use_underline">False</property> ! <property name="use_markup">False</property> ! <property name="justify">GTK_JUSTIFY_LEFT</property> ! <property name="wrap">False</property> ! <property name="selectable">False</property> ! <property name="xalign">0</property> ! <property name="yalign">0.5</property> ! <property name="xpad">5</property> ! <property name="ypad">5</property> </widget> <packing> <property name="left_attach">0</property> ! <property name="right_attach">1</property> ! <property name="top_attach">0</property> ! <property name="bottom_attach">1</property> <property name="x_padding">5</property> <property name="y_padding">5</property> + <property name="x_options"></property> <property name="y_options"></property> </packing> |
From: <iwa...@us...> - 2003-08-10 01:22:06
|
Update of /cvsroot/quickrip/quickrip/gtk In directory sc8-pr-cvs1:/tmp/cvs-serv19121/gtk Modified Files: gtkerrorbox.py gtkmain.py gtkprogress.py Log Message: Halfway working on threads for base among other things. Progress dialog changed to threaded mode. Index: gtkerrorbox.py =================================================================== RCS file: /cvsroot/quickrip/quickrip/gtk/gtkerrorbox.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** gtkerrorbox.py 9 Aug 2003 02:02:34 -0000 1.3 --- gtkerrorbox.py 10 Aug 2003 01:22:04 -0000 1.4 *************** *** 27,31 **** class GTKErrorBox: ! def quit(self, widget, data=None): self.window.destroy() return gtk.FALSE --- 27,31 ---- class GTKErrorBox: ! def quit(self, widget=None, data=None): self.window.destroy() return gtk.FALSE *************** *** 38,43 **** xml = gtk.glade.XML("".join(["gtk/glade/", title, ".glade"])) except: ! gtkerrorbox.GTKErrorBox("Error!", "Couldn't load " + title + ! ".glade file") self.quit() return xml --- 38,42 ---- xml = gtk.glade.XML("".join(["gtk/glade/", title, ".glade"])) except: ! print "Error!" + "Couldn't load " + title + ".glade file" self.quit() return xml Index: gtkmain.py =================================================================== RCS file: /cvsroot/quickrip/quickrip/gtk/gtkmain.py,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** gtkmain.py 9 Aug 2003 02:02:34 -0000 1.23 --- gtkmain.py 10 Aug 2003 01:22:04 -0000 1.24 *************** *** 43,54 **** class GTKMain(base.QuickRip): def rip(self, widget, data=None): ! print "Rip" ! self.dialogProgress.window.show_all() def scan(self, widget, data=None): - print "Scan gui" self.hideRip() self.hideScan() - self.dialogProgress.window.present() self.scanDVD() --- 43,53 ---- class GTKMain(base.QuickRip): def rip(self, widget, data=None): ! self.hideRip() ! self.hideScan() ! self.ripDVD() def scan(self, widget, data=None): self.hideRip() self.hideScan() self.scanDVD() *************** *** 260,264 **** self.initTree() self.dialogSettings = gtksettings.GTKSettings(self) - self.dialogProgress = gtkprogress.GTKProgress() self.window.show_all() --- 259,262 ---- *************** *** 445,449 **** "killall -9 python ." ! self.dialogProgress.setStatus("Starting Scanning...", 0) model = gtk.TreeStore( gobject.TYPE_STRING, #track title gobject.TYPE_STRING, #track length --- 443,448 ---- "killall -9 python ." ! self.dialogProgress = gtkprogress.GTKProgress(1) ! self.dialogProgress.setStatus("Starting Scanning...") model = gtk.TreeStore( gobject.TYPE_STRING, #track title gobject.TYPE_STRING, #track length *************** *** 472,495 **** gtk.threads_enter() print "Found %s titles" % (self.numtitles) - self.dialogProgress.setStatus("Scanning titles", 0) gtk.threads_leave() ! def ui_dispTitle(self, track): gtk.threads_enter() #update status - #print "titles num " + str(self.numtitles) self.titleIncr += 1 ! self.dialogProgress.setStatus("Reading titles", ! float(self.titleIncr) / float(self.numtitles)) self.dialogProgress.setTime(0, 0, self.numtitles - self.titleIncr) gtk.threads_leave() - def ui_finishScanning(self): gtk.threads_enter() self.showRip() self.showScan() ! self.dialogProgress.window.hide() for i in range(1, int(self.numtitles) + 1): --- 471,492 ---- gtk.threads_enter() print "Found %s titles" % (self.numtitles) gtk.threads_leave() ! self.dialogProgress.setStatus("Scanning titles") ! self.dialogProgress.setProgress(0.0) def ui_dispTitle(self, track): gtk.threads_enter() #update status self.titleIncr += 1 ! self.dialogProgress.setStatus("Reading titles") ! self.dialogProgress.setProgress(float(float(self.titleIncr) / float(self.numtitles))) self.dialogProgress.setTime(0, 0, self.numtitles - self.titleIncr) gtk.threads_leave() def ui_finishScanning(self): gtk.threads_enter() self.showRip() self.showScan() ! self.dialogProgress.exit() for i in range(1, int(self.numtitles) + 1): *************** *** 527,532 **** def ui_startRipping(self): ! self.hideScan() ! self.hideRip() def ui_newTitle(self, name, number, total, vbr): --- 524,529 ---- def ui_startRipping(self): ! self.dialogProgress = gtkprogress.GTKProgress(2) ! self.dialogProgress.setStatus("Starting Ripping...") def ui_newTitle(self, name, number, total, vbr): *************** *** 534,547 **** def ui_newPass(self, passtype): print "new pass" def ui_updateProgress(self, perc, trem, tpass): print "%s percent, %s remaining in %s" % (perc, trem, tpass) ! print "update progress" def ui_finishRipping(self): - print "finish ripping" self.showScan() self.showRip() if __name__ == "__main__": --- 531,545 ---- def ui_newPass(self, passtype): + self.dialogProgress.setStatus("Performing: " + str(passtype)) print "new pass" def ui_updateProgress(self, perc, trem, tpass): print "%s percent, %s remaining in %s" % (perc, trem, tpass) ! self.dialogProgress.setProgress(perc, 2) def ui_finishRipping(self): self.showScan() self.showRip() + self.dialogProgress.exit() if __name__ == "__main__": Index: gtkprogress.py =================================================================== RCS file: /cvsroot/quickrip/quickrip/gtk/gtkprogress.py,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** gtkprogress.py 9 Aug 2003 02:02:34 -0000 1.9 --- gtkprogress.py 10 Aug 2003 01:22:04 -0000 1.10 *************** *** 30,41 **** import gtk.glade import gtkerrorbox ! class GTKProgress: def quit(self, widget, data=None): error = gtkerrorbox.GTKErrorBox("Warning!", "Are you sure you want to stop the current task?") ! self.window.hide() return gtk.TRUE def loadGladeFile(self, title): --- 30,48 ---- import gtk.glade + import thread + import threading import gtkerrorbox + import time ! class GTKProgress(threading.Thread): def quit(self, widget, data=None): error = gtkerrorbox.GTKErrorBox("Warning!", "Are you sure you want to stop the current task?") ! self.exit() return gtk.TRUE + + def exit(self): + self.window.hide() + self.quit = 1 def loadGladeFile(self, title): *************** *** 51,62 **** return xml ! def setStatus(self, mesg, percent): ! self.lStatus.set_text(mesg) ! self.pBar.set_fraction(percent) ! self.pBar.set_text(str(int(percent * 100)) + "%") ! ! def pulse(): ! self.pBar.pulse() ! def setTime(self, hours, mins, secs): text = "Time Remaining: " --- 58,76 ---- return xml ! def setStatus(self, mesg): ! self.status = mesg ! ! def setProgress(self, percent, bar=1): ! self.percent[bar - 1] = percent ! ! def pulse(self, bar=1): ! gtk.threads_enter() ! if bar == 1: ! self.pBar1.pulse() ! elif bar == 2: ! self.pBar2.pulse() ! elif bar == 3: ! self.pBar3.pulse() ! def setTime(self, hours, mins, secs): text = "Time Remaining: " *************** *** 68,81 **** if secs > 1: text += "s" ! self.lTime.set_text(text) def __init__(self, bars=1): xml = self.loadGladeFile('gtkprogress') self.window = xml.get_widget('window') ! self.pBar = xml.get_widget('progressbar') ! # self.pBar2 = xml.get_widget(' self.lStatus = xml.get_widget('labelStatus') self.lTime = xml.get_widget('labelTime') xml.signal_autoconnect( {'on_window_delete_event': self.quit} ) xml.signal_autoconnect( {'on_buttonCancel_clicked': self.quit} ) --- 82,123 ---- if secs > 1: text += "s" ! self.time = text def __init__(self, bars=1): + threading.Thread.__init__(self) xml = self.loadGladeFile('gtkprogress') self.window = xml.get_widget('window') ! self.pBar = [] ! self.pBar.append(xml.get_widget('progressbar1')) ! self.pBar.append(xml.get_widget('progressbar2')) ! self.pBar.append(xml.get_widget('progressbar3')) ! self.label2 = xml.get_widget('label2') ! self.label3 = xml.get_widget('label3') self.lStatus = xml.get_widget('labelStatus') self.lTime = xml.get_widget('labelTime') + self.percent = [0.0, 0.0, 0.0] + self.status = "" + self.time = "" + + if bars > 1: + self.pBar[1].show_all() + self.label2.show_all() + if bars > 2: + self.pBar[2].show_all() + self.label3.show_all() xml.signal_autoconnect( {'on_window_delete_event': self.quit} ) xml.signal_autoconnect( {'on_buttonCancel_clicked': self.quit} ) + self.start() + + def run(self): + self.quit = 0 + while self.quit == 0: + + self.lStatus.set_text(self.status) + self.lTime.set_text(self.time) + for i in range(0, 3): + self.pBar[i].set_fraction(self.percent[i]) + self.pBar[i].set_text(str(int(self.percent[i] * 100)) + "%") + + time.sleep(1) |
From: <te...@us...> - 2003-08-09 10:50:10
|
Update of /cvsroot/quickrip/quickrip In directory sc8-pr-cvs1:/tmp/cvs-serv7306 Modified Files: base.py Log Message: All threading/piping now works, for scanning and ripping. Now I just need to add MPEG-2 and OGM support and base.py should be complete :-) Index: base.py =================================================================== RCS file: /cvsroot/quickrip/quickrip/base.py,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** base.py 9 Aug 2003 02:02:34 -0000 1.12 --- base.py 9 Aug 2003 10:50:07 -0000 1.13 *************** *** 20,25 **** class CommandThread(threading.Thread): """Handle threading of external commands""" ! def __init__(self, command, updatefunc, finalfunc, flushbuffer, data, lock): threading.Thread.__init__(self) self.updateFunc = updatefunc self.finalFunc = finalfunc --- 20,26 ---- class CommandThread(threading.Thread): """Handle threading of external commands""" ! def __init__(self, parent, command, updatefunc, finalfunc, flushbuffer, data, lock): threading.Thread.__init__(self) + self.parent = parent self.updateFunc = updatefunc self.finalFunc = finalfunc *************** *** 30,44 **** def run(self): - # self.lock = thread.allocate_lock() self.lock.acquire() ! self.pipe = popen2.Popen4(self.command) ! pid = self.pipe.pid totallines = [] while 1: try: if self.flushbuffer: ! line = self.pipe.fromchild.read(1000) else: ! line = self.pipe.fromchild.readline() if not line: --- 31,44 ---- def run(self): self.lock.acquire() ! self.parent.pipe = popen2.Popen4(self.command) ! pid = self.parent.pipe.pid totallines = [] while 1: try: if self.flushbuffer: ! line = self.parent.pipe.fromchild.read(1000) else: ! line = self.parent.pipe.fromchild.readline() if not line: *************** *** 64,68 **** self.lock.release() - sys.exit(2) --- 64,67 ---- *************** *** 71,76 **** """Kills current process (pipe)""" try: ! os.kill(self.pipe.pid, 9) ! os.waitpid(self.pipe.pid, os.WNOHANG) except: pass --- 70,75 ---- """Kills current process (pipe)""" try: ! os.kill(self.parent.pipe.pid, 9) ! os.waitpid(self.parent.pipe.pid, os.WNOHANG) except: pass *************** *** 191,195 **** command[:0] = [self.config[program]] ! self.thread = CommandThread(command, updatefunc, finalfunc, flushbuffer, data, self.lock) self.thread.start() --- 190,194 ---- command[:0] = [self.config[program]] ! self.thread = CommandThread(self, command, updatefunc, finalfunc, flushbuffer, data, self.lock) self.thread.start() *************** *** 208,212 **** """Scan the DVD and build up a data structure for the titles""" self.ui_startScanning() ! self.lock = thread.allocate_lock() #threading.allocate_lock() # Reset values to default (in case user scans two different discs in same session) --- 207,211 ---- """Scan the DVD and build up a data structure for the titles""" self.ui_startScanning() ! self.lock = thread.allocate_lock() # Reset values to default (in case user scans two different discs in same session) *************** *** 218,231 **** self.re_title = re.compile('There are (\d*) titles on this DVD') self.re_error = re.compile('libdvdread: Could not open device') ! self.run('mplayer', arguments, self.total_DVDInfo) #self.up_DVDInfo) - # def up_DVDInfo(self, line, data): - # could do some status update here as well... - # if self.re_error.search(line): - # print "no titles" - # self.ui_noTitles() - # elif self.re_title.search(line): - # self.numtitles = int(re_title.search(line).group(1)) - # print "***GOT NUMTITLES***" def total_DVDInfo(self, lines, data): --- 217,222 ---- self.re_title = re.compile('There are (\d*) titles on this DVD') self.re_error = re.compile('libdvdread: Could not open device') ! self.run('mplayer', arguments, self.total_DVDInfo) def total_DVDInfo(self, lines, data): *************** *** 265,271 **** for line in lines: - # print str(data) + line if re_error.search(line): - print "error on " + str(data) self.ui_noTitles() return --- 256,260 ---- *************** *** 289,294 **** chapters = re_chap.search(line).group(1) - # return chapters, alangs, slangs, time, time_label - # Clean up title i = data if i < 10: title_label = "".join(["0", str(i)]) --- 278,281 ---- *************** *** 339,342 **** --- 326,331 ---- resolution = "720" + self.lock = thread.allocate_lock() + i = 0 for title in self.torip: *************** *** 345,370 **** # Look for cropping sstep = int(title['time']) / 31 if not sstep: sstep = 1 ! arguments = ["-dvd ", str(title['id']), "-vop", "cropdetect", "-nosound", "-vo", "null", "-frames", "10", "-sstep", str(sstep)] ! re_crop = re.compile('.*-vop crop=(\d*:\d*:\d*:\d*).*') ! crop_options = {} ! common_crop = "" ! cc_hits = 0 ! for line in self.run('mplayer', arguments): ! if re_crop.search(line): ! crop = re_crop.search(line).group(1) ! try: ! crop_options[crop] = crop_options[crop] + 1 ! if crop_options[crop] > cc_hits: ! common_crop = crop ! except: ! crop_options[crop] = 1 ! title['crop'] = common_crop # Clean up output dir in case QuickRip crashed out there os.popen("".join(["rm ", self.config['outputdir'], "frameno.avi 2>/dev/null"])) if self.config['videocodec'] is 2: self.scvd(title, output, resolution) --- 334,355 ---- # Look for cropping + self.found_cropping = 0 sstep = int(title['time']) / 31 if not sstep: sstep = 1 ! arguments = ["-dvd", str(title['id']), "-vop", "cropdetect", "-nosound", "-vo", "null", "-frames", "10", "-sstep", str(sstep)] ! self.run('mplayer', arguments, self.total_Crop, None, 0, title, self.lock) ! ! # Wait until cropping is found before proceeding to build rip commands ! # (locking threads won't stop QuickRip from building commands in background) ! while 1: ! if self.found_cropping: ! del self.found_cropping ! break # Clean up output dir in case QuickRip crashed out there os.popen("".join(["rm ", self.config['outputdir'], "frameno.avi 2>/dev/null"])) + self.newpass = 1 if self.config['videocodec'] is 2: self.scvd(title, output, resolution) *************** *** 373,376 **** --- 358,362 ---- output = os.path.join(self.config['outputdir'], "".join([str(title['name']), ".ogm"])) self.oggAudio(title) + sleep(5) # makes sure the audio thread has time to start and get a lock self.aviVideo(title, output, resolution, 0) *************** *** 378,400 **** output = os.path.join(self.config['outputdir'], "".join([str(title['name']), ".avi"])) self.mp3Audio(title) self.aviVideo(title, output, resolution, 1) def mencode(self, arguments, passtype): """Run mencoder with given arguments and report progress""" ! perc = 0 ! trem = 0 re_progress = re.compile('(\d+)\%\) .*Trem:\s*(\d+\w+)\s+') ! for line in self.run('mencoder', arguments, 1): ! if re_progress.search(line): ! perc = re_progress.search(line).group(1) ! trem = re_progress.search(line).group(2) ! self.ui_updateProgress(perc, trem, passtype) def mp3Audio(self, title): """Rip the audio from a DVD title and encode as MP3""" - self.ui_newPass("mp3audio") - try: os.popen("".join(["rm ", os.path.join(self.config['outputdir'], "frameno.avi")])) --- 364,413 ---- output = os.path.join(self.config['outputdir'], "".join([str(title['name']), ".avi"])) self.mp3Audio(title) + sleep(5) # makes sure the audio thread has time to start and get a lock self.aviVideo(title, output, resolution, 1) + def total_Crop(self, lines, title): + re_crop = re.compile('-vop crop=(\d+:\d+:\d+:\d+)') + crop_options = {} + common_crop = "" + cc_hits = 0 + for line in lines: + if re_crop.search(line): + crop = re_crop.search(line).group(1) + try: + crop_options[crop] = crop_options[crop] + 1 + if crop_options[crop] > cc_hits: + common_crop = crop + except: + crop_options[crop] = 1 + title['crop'] = common_crop + self.found_cropping = 1 + + def mencode(self, arguments, passtype): """Run mencoder with given arguments and report progress""" ! self.perc = 0 ! self.trem = 0 ! self.run('mencoder', arguments, self.total_Mencode, self.update_Mencode, 1, passtype, self.lock) ! ! ! def update_Mencode(self, line, passtype): ! if self.newpass: ! self.ui_newPass(passtype) ! self.newpass = 0 re_progress = re.compile('(\d+)\%\) .*Trem:\s*(\d+\w+)\s+') ! if re_progress.search(line): ! self.perc = re_progress.search(line).group(1) ! self.trem = re_progress.search(line).group(2) ! self.ui_updateProgress(self.perc, self.trem, passtype) ! ! ! def total_Mencode(self, lines, passtype): ! self.newpass = 1 def mp3Audio(self, title): """Rip the audio from a DVD title and encode as MP3""" try: os.popen("".join(["rm ", os.path.join(self.config['outputdir'], "frameno.avi")])) *************** *** 423,427 **** def aviVideo(self, title, output, resolution, merge=1): """Rip the video from a DVD title, and optionally merge with audio""" - self.ui_newPass("video") if self.config['videocodec']: --- 436,439 ---- *************** *** 439,443 **** if merge: ! oac = "frameno" else: oac = "null" --- 451,455 ---- if merge: ! oac = "copy" else: oac = "null" *************** *** 448,457 **** if int(self.config['aspectratio']) is not 0: ! arguments.insert(3, "-aspect") ! arguments.insert(4, self.aro[self.config['aspectratio']]) ! if title['slang']: ! arguments.insert(3, "-slang") ! arguments.insert(4, title['slang']) self.mencode(arguments, "video") --- 460,469 ---- if int(self.config['aspectratio']) is not 0: ! arguments.insert(4, "-aspect") ! arguments.insert(5, self.aro[self.config['aspectratio']]) ! if title['slang'] != ' ': ! arguments.insert(4, "-slang") ! arguments.insert(5, title['slang']) self.mencode(arguments, "video") |
From: <iwa...@us...> - 2003-08-09 02:02:38
|
Update of /cvsroot/quickrip/quickrip/gtk In directory sc8-pr-cvs1:/tmp/cvs-serv10712/gtk Modified Files: gtkerrorbox.py gtkmain.py gtkprogress.py Log Message: Spawned bash threads now each share the same lock. Scanning large number of titles on dvds seems to work better now. Index: gtkerrorbox.py =================================================================== RCS file: /cvsroot/quickrip/quickrip/gtk/gtkerrorbox.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** gtkerrorbox.py 8 Aug 2003 21:43:37 -0000 1.2 --- gtkerrorbox.py 9 Aug 2003 02:02:34 -0000 1.3 *************** *** 31,37 **** return gtk.FALSE def __init__(self, title, message, parent=None): label = gtk.Label(message) ! xml = gtk.glade.XML('gtk/glade/gtkerrorbox.glade') self.window = xml.get_widget('window') self.window.set_title(title) --- 31,49 ---- return gtk.FALSE + def loadGladeFile(self, title): + try: + xml = gtk.glade.XML("".join(["glade/", title, ".glade"])) + except: + try: + xml = gtk.glade.XML("".join(["gtk/glade/", title, ".glade"])) + except: + gtkerrorbox.GTKErrorBox("Error!", "Couldn't load " + title + + ".glade file") + self.quit() + return xml + def __init__(self, title, message, parent=None): label = gtk.Label(message) ! xml = self.loadGladeFile("gtkerrorbox") self.window = xml.get_widget('window') self.window.set_title(title) Index: gtkmain.py =================================================================== RCS file: /cvsroot/quickrip/quickrip/gtk/gtkmain.py,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** gtkmain.py 8 Aug 2003 21:43:37 -0000 1.22 --- gtkmain.py 9 Aug 2003 02:02:34 -0000 1.23 *************** *** 66,70 **** def about(self, widget, data=None): box = gtkerrorbox.GTKErrorBox("About Quickrip", ! "A quick dvd ripper.\nSee the homepage at quickrip.sf.net.\nVersion " + config.version) def manual(self, widget, data=None): --- 66,71 ---- def about(self, widget, data=None): box = gtkerrorbox.GTKErrorBox("About Quickrip", ! "A quick dvd ripper.\nSee the homepage at quickrip.sf.net.\nVersion " \ ! + config.version) def manual(self, widget, data=None): *************** *** 72,76 **** def toggle(self, togglerenderer, row_num): ! print "toggled " + row_num mod = self.tree.get_model() i = mod.get_iter(row_num) --- 73,77 ---- def toggle(self, togglerenderer, row_num): ! # print "toggled " + row_num mod = self.tree.get_model() i = mod.get_iter(row_num) *************** *** 444,447 **** --- 445,449 ---- "killall -9 python ." + self.dialogProgress.setStatus("Starting Scanning...", 0) model = gtk.TreeStore( gobject.TYPE_STRING, #track title gobject.TYPE_STRING, #track length *************** *** 455,470 **** self.model = model self.modelIter = None - self.dialogProgress.setStatus("Starting Scanning...", 0) self.titleIncr = 0 def ui_configError(self, config): msg = gtkerrorbox.GTKErrorBox("Error!", "Config couldn't autodetect: " + config) def ui_noTitles(self): msg = gtkerrorbox.GTKErrorBox("Sorry!", "No DVD Video Titles were found!") def ui_dispDVD(self, numtitles): print "Found %s titles" % (self.numtitles) self.dialogProgress.setStatus("Scanning titles", 0) --- 457,477 ---- self.model = model self.modelIter = None self.titleIncr = 0 def ui_configError(self, config): + gtk.threads_enter() msg = gtkerrorbox.GTKErrorBox("Error!", "Config couldn't autodetect: " + config) + gtk.threads_leave() def ui_noTitles(self): + gtk.threads_enter() msg = gtkerrorbox.GTKErrorBox("Sorry!", "No DVD Video Titles were found!") + gtk.threads_leave() def ui_dispDVD(self, numtitles): + gtk.threads_enter() print "Found %s titles" % (self.numtitles) self.dialogProgress.setStatus("Scanning titles", 0) + gtk.threads_leave() *************** *** 496,501 **** if track['time'] >= 3600: length += str(track['time'] / 3600) + ":" ! if track['time'] >= 60: length += str((track['time'] % 3600) / 60) + ":" length += str(track['time'] % 60) --- 503,516 ---- if track['time'] >= 3600: length += str(track['time'] / 3600) + ":" ! if ((track['time'] % 3600) / 60) < 10: ! length += "0" ! length += str((track['time'] % 3600) / 60) ! length += ":" ! if (track['time'] % 60) < 10: ! length += "0" ! elif track['time'] >= 60: length += str((track['time'] % 3600) / 60) + ":" + if (track['time'] % 60) < 10: + length += "0" length += str(track['time'] % 60) *************** *** 530,536 **** self.showRip() ! # if __name__ == "__main__": ! # app = GTKMain() ! # app.main() def main(): --- 545,551 ---- self.showRip() ! if __name__ == "__main__": ! app = GTKMain() ! app.main() def main(): Index: gtkprogress.py =================================================================== RCS file: /cvsroot/quickrip/quickrip/gtk/gtkprogress.py,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** gtkprogress.py 8 Aug 2003 07:08:41 -0000 1.8 --- gtkprogress.py 9 Aug 2003 02:02:34 -0000 1.9 *************** *** 65,69 **** if mins != 0: text += str(mins) + " mins " ! self.lTime.set_text(text + str(secs) + " sec(s)") def __init__(self, bars=1): --- 65,72 ---- if mins != 0: text += str(mins) + " mins " ! text += str(secs) + " sec" ! if secs > 1: ! text += "s" ! self.lTime.set_text(text) def __init__(self, bars=1): |
From: <iwa...@us...> - 2003-08-09 02:02:37
|
Update of /cvsroot/quickrip/quickrip/gtk/glade In directory sc8-pr-cvs1:/tmp/cvs-serv10712/gtk/glade Modified Files: gtksettings.glade Log Message: Spawned bash threads now each share the same lock. Scanning large number of titles on dvds seems to work better now. Index: gtksettings.glade =================================================================== RCS file: /cvsroot/quickrip/quickrip/gtk/glade/gtksettings.glade,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** gtksettings.glade 8 Aug 2003 12:17:06 -0000 1.5 --- gtksettings.glade 9 Aug 2003 02:02:34 -0000 1.6 *************** *** 5,9 **** <widget class="GtkWindow" id="window"> ! <property name="title" translatable="yes">Settings</property> <property name="type">GTK_WINDOW_TOPLEVEL</property> <property name="window_position">GTK_WIN_POS_NONE</property> --- 5,9 ---- <widget class="GtkWindow" id="window"> ! <property name="title" translatable="yes">Preferences</property> <property name="type">GTK_WINDOW_TOPLEVEL</property> <property name="window_position">GTK_WIN_POS_NONE</property> *************** *** 23,27 **** <property name="can_focus">True</property> <property name="show_tabs">True</property> ! <property name="show_border">True</property> <property name="tab_pos">GTK_POS_TOP</property> <property name="scrollable">False</property> --- 23,27 ---- <property name="can_focus">True</property> <property name="show_tabs">True</property> ! <property name="show_border">False</property> <property name="tab_pos">GTK_POS_TOP</property> <property name="scrollable">False</property> |
From: <iwa...@us...> - 2003-08-09 02:02:37
|
Update of /cvsroot/quickrip/quickrip In directory sc8-pr-cvs1:/tmp/cvs-serv10712 Modified Files: base.py Log Message: Spawned bash threads now each share the same lock. Scanning large number of titles on dvds seems to work better now. Index: base.py =================================================================== RCS file: /cvsroot/quickrip/quickrip/base.py,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** base.py 9 Aug 2003 00:07:13 -0000 1.11 --- base.py 9 Aug 2003 02:02:34 -0000 1.12 *************** *** 15,18 **** --- 15,19 ---- import sys, os, re, popen2, ConfigParser, copy import config # QuickRip global configuration. + import thread *************** *** 29,37 **** def run(self): self.pipe = popen2.Popen4(self.command) pid = self.pipe.pid totallines = [] - if self.lock: - self.lock.acquire() while 1: try: --- 30,38 ---- def run(self): + # self.lock = thread.allocate_lock() + self.lock.acquire() self.pipe = popen2.Popen4(self.command) pid = self.pipe.pid totallines = [] while 1: try: *************** *** 61,66 **** if self.finalFunc != None: self.finalFunc(totallines, self.data) ! if self.lock: ! self.lock.release() sys.exit(2) --- 62,68 ---- if self.finalFunc != None: self.finalFunc(totallines, self.data) ! ! self.lock.release() ! sys.exit(2) *************** *** 190,194 **** self.thread = CommandThread(command, updatefunc, finalfunc, ! flushbuffer, data, lock) self.thread.start() --- 192,196 ---- self.thread = CommandThread(command, updatefunc, finalfunc, ! flushbuffer, data, self.lock) self.thread.start() *************** *** 206,209 **** --- 208,212 ---- """Scan the DVD and build up a data structure for the titles""" self.ui_startScanning() + self.lock = thread.allocate_lock() #threading.allocate_lock() # Reset values to default (in case user scans two different discs in same session) *************** *** 230,238 **** for line in lines: # there's prolly a better way to do this :) rettext += line if self.re_error.search(rettext): self.ui_noTitles() elif self.re_title.search(rettext): self.numtitles = int(self.re_title.search(rettext).group(1)) ! if self.numtitles is 0: return --- 233,243 ---- for line in lines: # there's prolly a better way to do this :) rettext += line + if self.re_error.search(rettext): self.ui_noTitles() elif self.re_title.search(rettext): self.numtitles = int(self.re_title.search(rettext).group(1)) ! ! if self.numtitles is 0: return *************** *** 242,249 **** for i in range(int(self.numtitles) + 1): if i is not 0: - lock = threading.Lock() """Find number of chapters, audio/subtitle languages & length for title""" arguments = ['-i', self.config['dvd_device'], '-T', str(i)] ! self.run('tcprobe', arguments, self.total_TitleInfo, None, 0, i, lock) def total_TitleInfo(self, lines, data): --- 247,256 ---- for i in range(int(self.numtitles) + 1): if i is not 0: """Find number of chapters, audio/subtitle languages & length for title""" arguments = ['-i', self.config['dvd_device'], '-T', str(i)] ! self.run('tcprobe', arguments, self.total_TitleInfo, None, 0, i) ! else: ! print "Error running programs!" ! print lines def total_TitleInfo(self, lines, data): *************** *** 258,264 **** for line in lines: ! print str(data) + line if re_error.search(line): ! print "error on" + str(data) self.ui_noTitles() return --- 265,271 ---- for line in lines: ! # print str(data) + line if re_error.search(line): ! print "error on " + str(data) self.ui_noTitles() return |
From: <te...@us...> - 2003-08-09 00:07:17
|
Update of /cvsroot/quickrip/quickrip In directory sc8-pr-cvs1:/tmp/cvs-serv30536 Modified Files: base.py Log Message: Some minor reg exp cleanups, and an attempt at locking threads to solve scanning problem (not that it works for me!) Index: base.py =================================================================== RCS file: /cvsroot/quickrip/quickrip/base.py,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** base.py 8 Aug 2003 07:08:41 -0000 1.10 --- base.py 9 Aug 2003 00:07:13 -0000 1.11 *************** *** 19,23 **** class CommandThread(threading.Thread): """Handle threading of external commands""" ! def __init__(self, command, updatefunc, finalfunc, flushbuffer, data): threading.Thread.__init__(self) self.updateFunc = updatefunc --- 19,23 ---- class CommandThread(threading.Thread): """Handle threading of external commands""" ! def __init__(self, command, updatefunc, finalfunc, flushbuffer, data, lock): threading.Thread.__init__(self) self.updateFunc = updatefunc *************** *** 26,29 **** --- 26,30 ---- self.command = command self.data = data + self.lock = lock def run(self): *************** *** 31,34 **** --- 32,37 ---- pid = self.pipe.pid totallines = [] + if self.lock: + self.lock.acquire() while 1: try: *************** *** 58,62 **** if self.finalFunc != None: self.finalFunc(totallines, self.data) ! sys.exit(2) --- 61,66 ---- if self.finalFunc != None: self.finalFunc(totallines, self.data) ! if self.lock: ! self.lock.release() sys.exit(2) *************** *** 180,184 **** def run(self, program, arguments, finalfunc=None, updatefunc=None, ! flushbuffer=0, data=None): """Runs a program; supply program name (string) and arguments (list)""" command = arguments --- 184,188 ---- def run(self, program, arguments, finalfunc=None, updatefunc=None, ! flushbuffer=0, data=None, lock=None): """Runs a program; supply program name (string) and arguments (list)""" command = arguments *************** *** 186,190 **** self.thread = CommandThread(command, updatefunc, finalfunc, ! flushbuffer, data) self.thread.start() --- 190,194 ---- self.thread = CommandThread(command, updatefunc, finalfunc, ! flushbuffer, data, lock) self.thread.start() *************** *** 227,235 **** rettext += line if self.re_error.search(rettext): - print "no titles" self.ui_noTitles() elif self.re_title.search(rettext): self.numtitles = int(self.re_title.search(rettext).group(1)) - print "***GOT NUMTITLES***" if self.numtitles is 0: --- 231,237 ---- *************** *** 240,250 **** for i in range(int(self.numtitles) + 1): if i is not 0: """Find number of chapters, audio/subtitle languages & length for title""" arguments = ['-i', self.config['dvd_device'], '-T', str(i)] ! self.run('tcprobe', arguments, self.total_TitleInfo, None, 0, i) def total_TitleInfo(self, lines, data): ! re_error = re.compile('No such file or directory') ! re_time = re.compile('.*title playback time: (.*):(.*):(\d*)\.\d* (\d*) sec') re_chap = re.compile('(\d*) chapter\(s\), ') re_alang = re.compile('.* ac3 (\w*) ') --- 242,253 ---- for i in range(int(self.numtitles) + 1): if i is not 0: + lock = threading.Lock() """Find number of chapters, audio/subtitle languages & length for title""" arguments = ['-i', self.config['dvd_device'], '-T', str(i)] ! self.run('tcprobe', arguments, self.total_TitleInfo, None, 0, i, lock) def total_TitleInfo(self, lines, data): ! re_error = re.compile("".join(["Can't open ", self.config['dvd_device'], " for reading"])) ! re_time = re.compile('title playback time: (\d+):(\d+):(\d+)\.\d+\s+(\d*) sec') re_chap = re.compile('(\d*) chapter\(s\), ') re_alang = re.compile('.* ac3 (\w*) ') *************** *** 253,262 **** alangs = [] slangs = [] - chapters = 0 - time = 0 - time_label = "0 hrs 0 mins 0 secs" for line in lines: if re_error.search(line): self.ui_noTitles() return --- 256,264 ---- alangs = [] slangs = [] for line in lines: + print str(data) + line if re_error.search(line): + print "error on" + str(data) self.ui_noTitles() return *************** *** 462,465 **** --- 464,470 ---- ## INHERIT THE CLASS AND SUBSTITUE THESE CLASS METHODS WITH YOUR ## OWN UI HOOKS + def ui_configError(self): + pass + def ui_startScanning(self): pass |
From: <te...@us...> - 2003-08-08 21:43:40
|
Update of /cvsroot/quickrip/quickrip/gtk In directory sc8-pr-cvs1:/tmp/cvs-serv9666/gtk Modified Files: gtkerrorbox.py gtkmain.py Log Message: A few minor fiddles to get the error box to load. N.B: When scanDVD() fails, I get lots and lots of error boxes, not one! Index: gtkerrorbox.py =================================================================== RCS file: /cvsroot/quickrip/quickrip/gtk/gtkerrorbox.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** gtkerrorbox.py 5 Aug 2003 06:31:55 -0000 1.1 --- gtkerrorbox.py 8 Aug 2003 21:43:37 -0000 1.2 *************** *** 33,37 **** def __init__(self, title, message, parent=None): label = gtk.Label(message) ! xml = gtk.glade.XML('glade/gtkerrorbox.glade') self.window = xml.get_widget('window') self.window.set_title(title) --- 33,37 ---- def __init__(self, title, message, parent=None): label = gtk.Label(message) ! xml = gtk.glade.XML('gtk/glade/gtkerrorbox.glade') self.window = xml.get_widget('window') self.window.set_title(title) Index: gtkmain.py =================================================================== RCS file: /cvsroot/quickrip/quickrip/gtk/gtkmain.py,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** gtkmain.py 8 Aug 2003 07:08:41 -0000 1.21 --- gtkmain.py 8 Aug 2003 21:43:37 -0000 1.22 *************** *** 215,222 **** def loadGladeFile(self, title): try: ! xml = gtk.glade.XML("glade/" + title + ".glade") except: try: ! xml = gtk.glade.XML("gtk/glade/" + title + ".glade") except: gtkerrorbox.GTKErrorBox("Error!", "Couldn't load " + title + --- 215,222 ---- def loadGladeFile(self, title): try: ! xml = gtk.glade.XML("".join(["glade/", title, ".glade"])) except: try: ! xml = gtk.glade.XML("".join(["gtk/glade/", title, ".glade"])) except: gtkerrorbox.GTKErrorBox("Error!", "Couldn't load " + title + *************** *** 468,471 **** --- 468,472 ---- self.dialogProgress.setStatus("Scanning titles", 0) + def ui_dispTitle(self, track): gtk.threads_enter() *************** *** 478,481 **** --- 479,483 ---- gtk.threads_leave() + def ui_finishScanning(self): gtk.threads_enter() *************** *** 528,534 **** self.showRip() ! if __name__ == "__main__": ! app = GTKMain() ! app.main() def main(): --- 530,536 ---- self.showRip() ! # if __name__ == "__main__": ! # app = GTKMain() ! # app.main() def main(): |
From: <iwa...@us...> - 2003-08-08 12:17:09
|
Update of /cvsroot/quickrip/quickrip/gtk In directory sc8-pr-cvs1:/tmp/cvs-serv11991/gtk Modified Files: gtksettings.py Log Message: Close button added to setting dialog. Index: gtksettings.py =================================================================== RCS file: /cvsroot/quickrip/quickrip/gtk/gtksettings.py,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** gtksettings.py 7 Aug 2003 06:56:58 -0000 1.12 --- gtksettings.py 8 Aug 2003 12:17:05 -0000 1.13 *************** *** 146,149 **** --- 146,150 ---- xml.signal_autoconnect( {'on_window_delete_event': self.quit} ) + xml.signal_autoconnect( {'on_close_clicked': self.quit} ) xml.signal_autoconnect( {'on_dvddevice_clicked': self.findDVD} ) xml.signal_autoconnect( {'on_output_clicked': self.findOutput} ) |
From: <iwa...@us...> - 2003-08-08 12:17:09
|
Update of /cvsroot/quickrip/quickrip/gtk/glade In directory sc8-pr-cvs1:/tmp/cvs-serv11991/gtk/glade Modified Files: gtksettings.glade Log Message: Close button added to setting dialog. Index: gtksettings.glade =================================================================== RCS file: /cvsroot/quickrip/quickrip/gtk/glade/gtksettings.glade,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** gtksettings.glade 6 Aug 2003 00:58:02 -0000 1.4 --- gtksettings.glade 8 Aug 2003 12:17:06 -0000 1.5 *************** *** 11,1448 **** <property name="resizable">True</property> <property name="destroy_with_parent">False</property> - <signal name="delete_event" handler="on_window_delete_event" last_modification_time="Mon, 04 Aug 2003 01:19:29 GMT"/> <child> ! <widget class="GtkNotebook" id="notebook1"> <property name="visible">True</property> ! <property name="can_focus">True</property> ! <property name="show_tabs">True</property> ! <property name="show_border">True</property> [...3108 lines suppressed...] ! <packing> ! <property name="type">tab</property> </packing> </child> --- 1619,1633 ---- </widget> <packing> ! <property name="padding">0</property> ! <property name="expand">False</property> ! <property name="fill">False</property> ! <property name="pack_type">GTK_PACK_END</property> </packing> </child> </widget> <packing> ! <property name="padding">0</property> ! <property name="expand">False</property> ! <property name="fill">False</property> </packing> </child> |
From: <je...@us...> - 2003-08-08 12:05:50
|
Update of /cvsroot/quickrip/quickrip/testing In directory sc8-pr-cvs1:/tmp/cvs-serv10434 Added Files: prefs.ui Log Message: Prefs test. --- NEW FILE: prefs.ui --- <!DOCTYPE UI><UI version="3.1" stdsetdef="1"> <class>Form1</class> <widget class="QDialog"> <property name="name"> <cstring>Form1</cstring> </property> <property name="geometry"> <rect> <x>0</x> <y>0</y> <width>600</width> <height>431</height> </rect> </property> <property name="caption"> <string>Form1</string> </property> <grid> <property name="name"> <cstring>unnamed</cstring> </property> <widget class="QLayoutWidget" row="0" column="0"> <property name="name"> <cstring>layout2</cstring> </property> <vbox> <property name="name"> <cstring>unnamed</cstring> </property> <widget class="QTabWidget"> <property name="name"> <cstring>tabWidget2</cstring> </property> <widget class="QWidget"> <property name="name"> <cstring>tab</cstring> </property> <attribute name="title"> <string>Tab 1</string> </attribute> </widget> <widget class="QWidget"> <property name="name"> <cstring>tab</cstring> </property> <attribute name="title"> <string>Tab 2</string> </attribute> </widget> </widget> <widget class="QLayoutWidget"> <property name="name"> <cstring>layout1</cstring> </property> <hbox> <property name="name"> <cstring>unnamed</cstring> </property> <spacer> <property name="name"> <cstring>spacer1</cstring> </property> <property name="orientation"> <enum>Horizontal</enum> </property> <property name="sizeType"> <enum>Expanding</enum> </property> <property name="sizeHint"> <size> <width>431</width> <height>20</height> </size> </property> </spacer> <widget class="QPushButton"> <property name="name"> <cstring>pushButton1</cstring> </property> <property name="text"> <string>Close</string> </property> </widget> </hbox> </widget> </vbox> </widget> </grid> </widget> <layoutdefaults spacing="6" margin="11"/> </UI> |
From: <iwa...@us...> - 2003-08-08 07:08:45
|
Update of /cvsroot/quickrip/quickrip In directory sc8-pr-cvs1:/tmp/cvs-serv30475 Modified Files: base.py Log Message: Threading working in base for scanDVD. gtkmain does threading accordingly. Status is also shown for Scan. Index: base.py =================================================================== RCS file: /cvsroot/quickrip/quickrip/base.py,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** base.py 8 Aug 2003 00:30:01 -0000 1.9 --- base.py 8 Aug 2003 07:08:41 -0000 1.10 *************** *** 19,32 **** class CommandThread(threading.Thread): """Handle threading of external commands""" ! def __init__(self, command, updatefunc, flushbuffer): threading.Thread.__init__(self) self.updateFunc = updatefunc self.flushbuffer = flushbuffer self.command = command ! def run(self): self.pipe = popen2.Popen4(self.command) pid = self.pipe.pid while 1: try: --- 19,34 ---- class CommandThread(threading.Thread): """Handle threading of external commands""" ! def __init__(self, command, updatefunc, finalfunc, flushbuffer, data): threading.Thread.__init__(self) self.updateFunc = updatefunc + self.finalFunc = finalfunc self.flushbuffer = flushbuffer self.command = command ! self.data = data def run(self): self.pipe = popen2.Popen4(self.command) pid = self.pipe.pid + totallines = [] while 1: try: *************** *** 35,55 **** else: line = self.pipe.fromchild.readline() if not line: break else: ! self.updateFunc(line) except: # For PyGtk... weird! continue ! # Clean up process table ! try: ! self.kill_pipe() ! except: ! pass try: os.waitpid(pid, os.WNOHANG) except: pass sys.exit(2) --- 37,61 ---- else: line = self.pipe.fromchild.readline() + if not line: break else: ! totallines.append(line) ! if self.updateFunc != None: ! self.updateFunc(line, self.data) except: # For PyGtk... weird! continue ! # Clean up process table--you already handle exceptions in the function ! self.kill_pipe() ! try: os.waitpid(pid, os.WNOHANG) except: pass + + if self.finalFunc != None: + self.finalFunc(totallines, self.data) sys.exit(2) *************** *** 65,70 **** - - class QuickRip: """QuickRip base class, including the following methods: --- 71,74 ---- *************** *** 175,187 **** ! def run(self, program, arguments, updatefunc, flushbuffer=0): """Runs a program; supply program name (string) and arguments (list)""" command = arguments command[:0] = [self.config[program]] ! self.thread = CommandThread(command, updatefunc, flushbuffer) self.thread.start() - def kill_pipe(self): """Kills current process (pipe)""" --- 179,192 ---- ! def run(self, program, arguments, finalfunc=None, updatefunc=None, ! flushbuffer=0, data=None): """Runs a program; supply program name (string) and arguments (list)""" command = arguments command[:0] = [self.config[program]] ! self.thread = CommandThread(command, updatefunc, finalfunc, ! flushbuffer, data) self.thread.start() def kill_pipe(self): """Kills current process (pipe)""" *************** *** 192,216 **** pass - def getDVDInfo(self): """Find number of titles on DVD""" arguments = ['-vo', 'null', '-ao', 'null', '-v', 'dvd://', '-identify', '-quiet', '-nocache'] self.re_title = re.compile('There are (\d*) titles on this DVD') self.re_error = re.compile('libdvdread: Could not open device') ! self.run('mplayer', arguments, self.up_DVDInfo) ! def up_DVDInfo(self, line): ! if self.re_error.search(line): self.ui_noTitles() ! elif self.re_title.search(line): ! self.numtitles = int(re_title.search(line).group(1)) print "***GOT NUMTITLES***" ! def getTitleInfo(self, no): ! """Find number of chapters, audio/subtitle languages & length for title""" ! arguments = ['-i', self.config['dvd_device'], '-T', str(no)] re_error = re.compile('No such file or directory') re_time = re.compile('.*title playback time: (.*):(.*):(\d*)\.\d* (\d*) sec') --- 197,248 ---- pass + # The following functions are threaded, but are processed in the order + # in which they appear here. - biggs + def scanDVD(self): + """Scan the DVD and build up a data structure for the titles""" + self.ui_startScanning() + + # Reset values to default (in case user scans two different discs in same session) + self.titles = [] + self.numtitles = 0 """Find number of titles on DVD""" arguments = ['-vo', 'null', '-ao', 'null', '-v', 'dvd://', '-identify', '-quiet', '-nocache'] self.re_title = re.compile('There are (\d*) titles on this DVD') self.re_error = re.compile('libdvdread: Could not open device') ! self.run('mplayer', arguments, self.total_DVDInfo) #self.up_DVDInfo) + # def up_DVDInfo(self, line, data): + # could do some status update here as well... + # if self.re_error.search(line): + # print "no titles" + # self.ui_noTitles() + # elif self.re_title.search(line): + # self.numtitles = int(re_title.search(line).group(1)) + # print "***GOT NUMTITLES***" ! def total_DVDInfo(self, lines, data): ! rettext = "" # recompile lines from array to big string ! for line in lines: # there's prolly a better way to do this :) ! rettext += line ! if self.re_error.search(rettext): ! print "no titles" self.ui_noTitles() ! elif self.re_title.search(rettext): ! self.numtitles = int(self.re_title.search(rettext).group(1)) print "***GOT NUMTITLES***" + if self.numtitles is 0: + return + + self.ui_dispDVD(self.numtitles) ! for i in range(int(self.numtitles) + 1): ! if i is not 0: ! """Find number of chapters, audio/subtitle languages & length for title""" ! arguments = ['-i', self.config['dvd_device'], '-T', str(i)] ! self.run('tcprobe', arguments, self.total_TitleInfo, None, 0, i) + def total_TitleInfo(self, lines, data): re_error = re.compile('No such file or directory') re_time = re.compile('.*title playback time: (.*):(.*):(\d*)\.\d* (\d*) sec') *************** *** 221,226 **** alangs = [] slangs = [] ! for line in self.run('tcprobe', arguments): if re_error.search(line): self.ui_noTitles() --- 253,261 ---- alangs = [] slangs = [] + chapters = 0 + time = 0 + time_label = "0 hrs 0 mins 0 secs" ! for line in lines: if re_error.search(line): self.ui_noTitles() *************** *** 245,295 **** chapters = re_chap.search(line).group(1) ! return chapters, alangs, slangs, time, time_label ! ! ! def scanDVD(self): ! """Scan the DVD and build up a data structure for the titles""" ! self.ui_startScanning() ! ! # Reset values to default (in case user scans two different discs in same session) ! self.titles = [] ! self.numtitles = 0 ! ! self.getDVDInfo() ! ! if self.numtitles is 0: ! return ! self.ui_dispDVD(self.numtitles) ! ! for i in range(int(self.numtitles) + 1): ! if i is not 0: ! # Get title information from disc ! chapters, alangs, slangs, time, time_label = self.getTitleInfo(i) ! # Clean up title ! if i < 10: title_label = "".join(["0", str(i)]) ! else: title_label = str(i) ! ! title = {} ! title['id'] = i ! title['name'] = title_label ! title['numchapters'] = int(chapters) ! title['time'] = int(time) ! title['timelabel'] = time_label ! title['size'] = 680 ! title['vbr'] = self.calcRate(int(time), 96, 680) ! title['abr'] = 128 #biggs added ! title['rip'] = "no" ! title['alangs'] = alangs ! title['alang'] = 'en' ! title['slangs'] = slangs ! title['slang'] = ' ' # biggs changed to a double space ! ! self.titles.append(title) ! self.ui_dispTitle(title) ! self.ui_finishScanning() def ripDVD(self): --- 280,309 ---- chapters = re_chap.search(line).group(1) ! # return chapters, alangs, slangs, time, time_label # Clean up title ! i = data ! if i < 10: title_label = "".join(["0", str(i)]) ! else: title_label = str(i) ! title = {} ! title['id'] = i ! title['name'] = title_label ! title['numchapters'] = int(chapters) ! title['time'] = int(time) ! title['timelabel'] = time_label ! title['size'] = 680 ! title['vbr'] = self.calcRate(int(time), 96, 680) ! title['abr'] = 128 #biggs added ! title['rip'] = "no" ! title['alangs'] = alangs ! title['alang'] = 'en' ! title['slangs'] = slangs ! title['slang'] = ' ' # biggs changed to a double space ! self.titles.append(title) ! self.ui_dispTitle(title) + if len(self.titles) == self.numtitles: + self.ui_finishScanning() def ripDVD(self): *************** *** 445,450 **** import output print output.bold("NOT IMPLEMENTED YET!") - - ## INHERIT THE CLASS AND SUBSTITUE THESE CLASS METHODS WITH YOUR --- 459,462 ---- |
From: <iwa...@us...> - 2003-08-08 07:08:45
|
Update of /cvsroot/quickrip/quickrip/gtk/glade In directory sc8-pr-cvs1:/tmp/cvs-serv30475/gtk/glade Modified Files: gtkmain.glade gtkprogress.glade Log Message: Threading working in base for scanDVD. gtkmain does threading accordingly. Status is also shown for Scan. Index: gtkmain.glade =================================================================== RCS file: /cvsroot/quickrip/quickrip/gtk/glade/gtkmain.glade,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** gtkmain.glade 7 Aug 2003 13:29:40 -0000 1.9 --- gtkmain.glade 8 Aug 2003 07:08:42 -0000 1.10 *************** *** 3,7 **** <glade-interface> - <requires lib="gnome"/> <widget class="GtkWindow" id="window"> --- 3,6 ---- *************** *** 207,211 **** <property name="border_width">5</property> <property name="visible">True</property> ! <property name="tooltip" translatable="yes">Select multiple tracks, then click "Rip" button</property> <property name="can_focus">True</property> <property name="headers_visible">True</property> --- 206,210 ---- <property name="border_width">5</property> <property name="visible">True</property> ! <property name="tooltip" translatable="yes">Select multiple tracks for processing, then click "Rip"</property> <property name="can_focus">True</property> <property name="headers_visible">True</property> Index: gtkprogress.glade =================================================================== RCS file: /cvsroot/quickrip/quickrip/gtk/glade/gtkprogress.glade,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** gtkprogress.glade 6 Aug 2003 10:58:40 -0000 1.3 --- gtkprogress.glade 8 Aug 2003 07:08:42 -0000 1.4 *************** *** 5,15 **** <widget class="GtkWindow" id="window"> ! <property name="title" translatable="yes">Working...</property> <property name="type">GTK_WINDOW_TOPLEVEL</property> <property name="window_position">GTK_WIN_POS_CENTER</property> <property name="modal">True</property> ! <property name="default_width">388</property> ! <property name="default_height">135</property> ! <property name="resizable">False</property> <property name="destroy_with_parent">False</property> --- 5,13 ---- <widget class="GtkWindow" id="window"> ! <property name="title" translatable="yes">QuickRip Status</property> <property name="type">GTK_WINDOW_TOPLEVEL</property> <property name="window_position">GTK_WIN_POS_CENTER</property> <property name="modal">True</property> ! <property name="resizable">True</property> <property name="destroy_with_parent">False</property> *************** *** 17,31 **** <widget class="GtkTable" id="table1"> <property name="visible">True</property> ! <property name="n_rows">3</property> ! <property name="n_columns">3</property> ! <property name="homogeneous">True</property> <property name="row_spacing">0</property> <property name="column_spacing">0</property> <child> <widget class="GtkButton" id="buttonCancel"> <property name="border_width">5</property> <property name="visible">True</property> <property name="can_focus">True</property> <property name="relief">GTK_RELIEF_NORMAL</property> <signal name="clicked" handler="on_buttonCancel_clicked" last_modification_time="Mon, 04 Aug 2003 01:03:28 GMT"/> --- 15,79 ---- <widget class="GtkTable" id="table1"> <property name="visible">True</property> ! <property name="n_rows">4</property> ! <property name="n_columns">2</property> ! <property name="homogeneous">False</property> <property name="row_spacing">0</property> <property name="column_spacing">0</property> <child> + <widget class="GtkLabel" id="labelStatus"> + <property name="visible">True</property> + <property name="label" translatable="yes">Ripping track 1/3, etc...</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0</property> + <property name="yalign">0.5</property> + <property name="xpad">5</property> + <property name="ypad">5</property> + </widget> + <packing> + <property name="left_attach">0</property> + <property name="right_attach">2</property> + <property name="top_attach">0</property> + <property name="bottom_attach">1</property> + <property name="x_options"></property> + <property name="y_options"></property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="labelTime"> + <property name="visible">True</property> + <property name="label" translatable="yes">Time Remaining: N/A</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0</property> + <property name="yalign">0.5</property> + <property name="xpad">5</property> + <property name="ypad">5</property> + </widget> + <packing> + <property name="left_attach">0</property> + <property name="right_attach">2</property> + <property name="top_attach">1</property> + <property name="bottom_attach">2</property> + <property name="x_options"></property> + <property name="y_options"></property> + </packing> + </child> + + <child> <widget class="GtkButton" id="buttonCancel"> <property name="border_width">5</property> <property name="visible">True</property> + <property name="has_default">True</property> <property name="can_focus">True</property> + <property name="has_focus">True</property> <property name="relief">GTK_RELIEF_NORMAL</property> <signal name="clicked" handler="on_buttonCancel_clicked" last_modification_time="Mon, 04 Aug 2003 01:03:28 GMT"/> *************** *** 88,96 **** </widget> <packing> ! <property name="left_attach">2</property> ! <property name="right_attach">3</property> ! <property name="top_attach">2</property> ! <property name="bottom_attach">3</property> ! <property name="x_options">fill</property> <property name="y_options"></property> </packing> --- 136,144 ---- </widget> <packing> ! <property name="left_attach">0</property> ! <property name="right_attach">2</property> ! <property name="top_attach">3</property> ! <property name="bottom_attach">4</property> ! <property name="x_options">expand</property> <property name="y_options"></property> </packing> *************** *** 99,102 **** --- 147,151 ---- <child> <widget class="GtkProgressBar" id="progressbar"> + <property name="width_request">258</property> <property name="visible">True</property> <property name="orientation">GTK_PROGRESS_LEFT_TO_RIGHT</property> *************** *** 106,163 **** <packing> <property name="left_attach">0</property> ! <property name="right_attach">3</property> ! <property name="top_attach">1</property> ! <property name="bottom_attach">2</property> <property name="x_padding">5</property> <property name="y_padding">5</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="label2"> - <property name="visible">True</property> - <property name="label" translatable="yes">Status:</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0</property> - <property name="yalign">0.5</property> - <property name="xpad">5</property> - <property name="ypad">5</property> - </widget> - <packing> - <property name="left_attach">0</property> - <property name="right_attach">1</property> - <property name="top_attach">0</property> - <property name="bottom_attach">1</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="labelStatus"> - <property name="visible">True</property> - <property name="label" translatable="yes">Ripping track 1/3, etc...</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0</property> - <property name="yalign">0.5</property> - <property name="xpad">5</property> - <property name="ypad">5</property> - </widget> - <packing> - <property name="left_attach">1</property> - <property name="right_attach">3</property> - <property name="top_attach">0</property> - <property name="bottom_attach">1</property> - <property name="x_options">fill</property> <property name="y_options"></property> </packing> --- 155,163 ---- <packing> <property name="left_attach">0</property> ! <property name="right_attach">2</property> ! <property name="top_attach">2</property> ! <property name="bottom_attach">3</property> <property name="x_padding">5</property> <property name="y_padding">5</property> <property name="y_options"></property> </packing> |
From: <iwa...@us...> - 2003-08-08 07:08:45
|
Update of /cvsroot/quickrip/quickrip/gtk In directory sc8-pr-cvs1:/tmp/cvs-serv30475/gtk Modified Files: gtkmain.py gtkprogress.py Log Message: Threading working in base for scanDVD. gtkmain does threading accordingly. Status is also shown for Scan. Index: gtkmain.py =================================================================== RCS file: /cvsroot/quickrip/quickrip/gtk/gtkmain.py,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** gtkmain.py 8 Aug 2003 00:30:01 -0000 1.20 --- gtkmain.py 8 Aug 2003 07:08:41 -0000 1.21 *************** *** 51,56 **** self.hideScan() self.dialogProgress.window.present() - # cmd = CommandThread("sleep 2; ls /bin", self.results) - # cmd.start() self.scanDVD() --- 51,54 ---- *************** *** 124,136 **** def rowChange(self, widget, data=None): self.inRowChange = "true" - selected = self.tree.get_selection() - (self.model, self.modelIter) = selected.get_selected() - newtrack = self.model.get_value(self.modelIter, 5) - if newtrack != self.oldtrack: - self.oldtrack = newtrack - else: - return - track = newtrack adj = self.sAudio.get_adjustment() adj.value = float(track['abr']) --- 122,138 ---- def rowChange(self, widget, data=None): + try: + selected = self.tree.get_selection() + (self.model, self.modelIter) = selected.get_selected() + newtrack = self.model.get_value(self.modelIter, 5) + if newtrack != self.oldtrack: + self.oldtrack = newtrack + else: + return + track = newtrack + except: + return #treeview may be not yet filled + self.inRowChange = "true" adj = self.sAudio.get_adjustment() adj.value = float(track['abr']) *************** *** 429,432 **** --- 431,437 ---- self.buttonScan.show() self.miScan.show() + + def modelSort(self): + pass def main(self): *************** *** 435,439 **** ################################# HOOKS def ui_startScanning(self): ! print "start scanning backend" model = gtk.TreeStore( gobject.TYPE_STRING, #track title gobject.TYPE_STRING, #track length --- 440,447 ---- ################################# HOOKS def ui_startScanning(self): ! print "If you get lockups, please upgrade your PyGTK to at least " + \ ! "version 1.99.17. Program can be killed by Ctrl+Z and " + \ ! "killall -9 python ." ! model = gtk.TreeStore( gobject.TYPE_STRING, #track title gobject.TYPE_STRING, #track length *************** *** 443,450 **** gobject.TYPE_PYOBJECT, #reference to object to set based on rip gobject.TYPE_STRING) #projected size self.tree.set_model(model) self.model = model self.modelIter = None ! def ui_configError(self, config): msg = gtkerrorbox.GTKErrorBox("Error!", "Config couldn't autodetect: " + config) --- 451,461 ---- gobject.TYPE_PYOBJECT, #reference to object to set based on rip gobject.TYPE_STRING) #projected size + #model.set_sort_func(0, self.modelSort) self.tree.set_model(model) self.model = model self.modelIter = None ! self.dialogProgress.setStatus("Starting Scanning...", 0) ! self.titleIncr = 0 ! def ui_configError(self, config): msg = gtkerrorbox.GTKErrorBox("Error!", "Config couldn't autodetect: " + config) *************** *** 455,494 **** def ui_dispDVD(self, numtitles): print "Found %s titles" % (self.numtitles) def ui_dispTitle(self, track): ! if self.modelIter == None: ! self.modelIter = self.model.insert_before(None, None) ! else : ! self.modelIter = self.model.append(None, None)#self.modelIter, None) ! # str = { "first": "1st", "second": "3rd" } ! # model.set_value(i, 0, str["first"]) ! # model.set_value(i, 1, str["second"]) ! # model.set_value(i, 2, "third") ! # model.set_value(i, 3, "forth") ! # this will nest a child and i will point to the child ! # i = model.append(i, None) ! length = "" ! if track['time'] >= 3600: ! length += str(track['time'] / 3600) + ":" ! if track['time'] >= 60: ! length += str((track['time'] % 3600) / 60) + ":" ! length += str(track['time'] % 60) ! ! track['slangs'].insert(0, [" ", "Not Specified"]) ! self.model.set_value(self.modelIter, 0, track['name']) ! self.model.set_value(self.modelIter, 1, length) ! self.model.set_value(self.modelIter, 2, config.langs[track['alang']]) ! self.model.set_value(self.modelIter, 3, config.langs[track['slang']]) ! self.model.set_value(self.modelIter, 4, gtk.FALSE) ! self.model.set_value(self.modelIter, 5, track) ! self.updateSize() def ui_finishScanning(self): ! print "finish scanning" self.showRip() self.showScan() self.dialogProgress.window.hide() ! # for i in range(1, int(self.numtitles) + 1): ! # print "title add " + str(i) def ui_startRipping(self): --- 466,511 ---- def ui_dispDVD(self, numtitles): print "Found %s titles" % (self.numtitles) + self.dialogProgress.setStatus("Scanning titles", 0) def ui_dispTitle(self, track): ! gtk.threads_enter() ! #update status ! #print "titles num " + str(self.numtitles) ! self.titleIncr += 1 ! self.dialogProgress.setStatus("Reading titles", ! float(self.titleIncr) / float(self.numtitles)) ! self.dialogProgress.setTime(0, 0, self.numtitles - self.titleIncr) ! gtk.threads_leave() def ui_finishScanning(self): ! gtk.threads_enter() self.showRip() self.showScan() self.dialogProgress.window.hide() ! ! for i in range(1, int(self.numtitles) + 1): ! if self.modelIter == None: ! self.modelIter = self.model.insert_before(None, None) ! else: ! self.modelIter = self.model.append(None, None)#self.modelIter, None) ! ! track = self.titles[i-1] ! length = "" ! if track['time'] >= 3600: ! length += str(track['time'] / 3600) + ":" ! if track['time'] >= 60: ! length += str((track['time'] % 3600) / 60) + ":" ! length += str(track['time'] % 60) ! ! track['slangs'].insert(0, [" ", "Not Specified"]) ! self.model.set_value(self.modelIter, 0, track['name']) ! self.model.set_value(self.modelIter, 1, length) ! self.model.set_value(self.modelIter, 2, config.langs[track['alang']]) ! self.model.set_value(self.modelIter, 3, config.langs[track['slang']]) ! self.model.set_value(self.modelIter, 4, gtk.FALSE) ! self.model.set_value(self.modelIter, 5, track) ! self.updateSize() ! ! gtk.threads_leave() def ui_startRipping(self): Index: gtkprogress.py =================================================================== RCS file: /cvsroot/quickrip/quickrip/gtk/gtkprogress.py,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** gtkprogress.py 7 Aug 2003 06:56:58 -0000 1.7 --- gtkprogress.py 8 Aug 2003 07:08:41 -0000 1.8 *************** *** 50,57 **** self.quit() return xml ! def __init__(self): xml = self.loadGladeFile('gtkprogress') self.window = xml.get_widget('window') xml.signal_autoconnect( {'on_window_delete_event': self.quit} ) --- 50,77 ---- self.quit() return xml + + def setStatus(self, mesg, percent): + self.lStatus.set_text(mesg) + self.pBar.set_fraction(percent) + self.pBar.set_text(str(int(percent * 100)) + "%") + + def pulse(): + self.pBar.pulse() + + def setTime(self, hours, mins, secs): + text = "Time Remaining: " + if hours != 0: + text += str(hours) + " hours " + if mins != 0: + text += str(mins) + " mins " + self.lTime.set_text(text + str(secs) + " sec(s)") ! def __init__(self, bars=1): xml = self.loadGladeFile('gtkprogress') self.window = xml.get_widget('window') + self.pBar = xml.get_widget('progressbar') + # self.pBar2 = xml.get_widget(' + self.lStatus = xml.get_widget('labelStatus') + self.lTime = xml.get_widget('labelTime') xml.signal_autoconnect( {'on_window_delete_event': self.quit} ) |