From: <te...@us...> - 2004-03-05 16:37:19
|
Update of /cvsroot/quickrip/ng/cli In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv590/cli Modified Files: cli.py Log Message: Bugfixes, mostly in notify_* methods Index: cli.py =================================================================== RCS file: /cvsroot/quickrip/ng/cli/cli.py,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** cli.py 5 Mar 2004 00:57:18 -0000 1.5 --- cli.py 5 Mar 2004 16:15:15 -0000 1.6 *************** *** 229,233 **** numtitles_to_rip += 1 print "- Track %2s (%s/%s.avi) at %skbps" % (t['id'], \ ! self.config['outputdir'], t['name'], t['vbr']) # Have they selected any titles? if numtitles_to_rip is 0: --- 229,233 ---- numtitles_to_rip += 1 print "- Track %2s (%s/%s.avi) at %skbps" % (t['id'], \ ! self.config['outputdir'], t['name'], str(int(t['vbr']))) # Have they selected any titles? if numtitles_to_rip is 0: *************** *** 247,251 **** self.ripDVD() print "" ! print output.bold("Ripping complete. Hit enter to return to the main menu") null = raw_input("") del null --- 247,252 ---- self.ripDVD() print "" ! print "" ! print output.bold("* Ripping complete. Hit enter to return to the main menu") null = raw_input("") del null *************** *** 372,381 **** ! def int_newTitle(self, name, number, total, vbr): ! #print "" print "* Ripping title %2s (%s of %s)" % (name, number, total) ! def int_newPass(self, passtype): slashn = "" # Finish off last pass' line --- 373,382 ---- ! def notify_newTitle(self, name, number, total, vbr): ! print "" print "* Ripping title %2s (%s of %s)" % (name, number, total) ! def notify_newPass(self, passtype): slashn = "" # Finish off last pass' line *************** *** 386,409 **** sys.stdout.write("|\n") sys.stdout.write(slashn + passtype + " |") # (Re)set progress meter for new pass self.spinner = "\|/-\|/-" self.spinpos = 0 width = os.popen("tput cols").read() ! width = float(width) ! self.jumper = 100 / (width - 20) self.n = 0 ! def int_updateProgress(self, perc, trem, tpass): # Auto-resize UI? for opt in sys.argv: if opt in ['-a', '--autoresize']: width = os.popen("tput cols").read() ! width = float(width) ! self.jumper = 100 / (width - 20) ! n = int(int(perc) / self.jumper) # Rewrite percentage if int(perc) <= 9: ! sys.stdout.write(" " + str(int(perc)) + "% |") else: sys.stdout.write(" " + str(int(perc)) + "% |") --- 387,409 ---- sys.stdout.write("|\n") sys.stdout.write(slashn + passtype + " |") + sys.stdout.flush() # (Re)set progress meter for new pass self.spinner = "\|/-\|/-" self.spinpos = 0 width = os.popen("tput cols").read() ! self.jumper = 100.0 / (float(width) - 20.0) self.n = 0 ! def notify_updateProgress(self, perc, trem, passtype): # Auto-resize UI? for opt in sys.argv: if opt in ['-a', '--autoresize']: width = os.popen("tput cols").read() ! self.jumper = 100.0 / (float(width) - 20.0) ! n = int(float(perc) / self.jumper) # Rewrite percentage if int(perc) <= 9: ! sys.stdout.write(" " + str(int(perc)) + "% |") else: sys.stdout.write(" " + str(int(perc)) + "% |") *************** *** 411,417 **** sys.stdout.write("=" * n) # Rewrite spinner ! sys.stdout.write(self.spinner[self.spinpos]) self.spinpos=(self.spinpos+1)%8 sys.stdout.flush() def main(): --- 411,426 ---- sys.stdout.write("=" * n) # Rewrite spinner ! if int(perc) == 100: ! sys.stdout.write("|") ! else: ! sys.stdout.write(self.spinner[self.spinpos]) self.spinpos=(self.spinpos+1)%8 sys.stdout.flush() + # Wipe out spinner + sys.stdout.write("\b" * (8+n)) + + + def notify_finishTitle(self, passtype): + self.notify_updateProgress(100, 0, passtype) def main(): |