From: <je...@us...> - 2003-06-21 16:24:13
|
Update of /cvsroot/quickrip/quickrip In directory sc8-pr-cvs1:/tmp/cvs-serv29436 Modified Files: cli.py Log Message: Removed dependency on module `output'. Index: cli.py =================================================================== RCS file: /cvsroot/quickrip/quickrip/cli.py,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** cli.py 19 Jun 2003 02:39:24 -0000 1.9 --- cli.py 21 Jun 2003 16:24:10 -0000 1.10 *************** *** 10,36 **** """ try: ! import sys ! except ImportError: ! print "Unable to import module sys" ! raise SystemExit ! ! try: ! import os ! except ImportError: ! print "Unable to import module os" ! raise SystemExit ! ! try: ! import re ! except ImportError: ! print "Unable to import module re" ! raise SystemExit ! ! try: ! import output except ImportError: ! print "Unable to import module output" raise SystemExit ! from dvd import * --- 10,18 ---- """ try: ! import sys, os, re except ImportError: ! print "Unable to import any of sys, os, re modules" raise SystemExit ! from dvd import * *************** *** 56,60 **** os.system("clear") #print "QuickRip v0.6, (C) Tom Chance, 2003" ! print output.bold("%s v%s, %s\n" % (__app__, __version__, __copyright__)) if mode == 'entry': self.outdir = self.config['outputdir'] --- 38,43 ---- os.system("clear") #print "QuickRip v0.6, (C) Tom Chance, 2003" ! #print output.bold("%s v%s, %s\n" % (__app__, __version__, __copyright__)) ! print "%s v%s, %s\n" % (__app__, __version__, __copyright__) if mode == 'entry': self.outdir = self.config['outputdir'] *************** *** 62,71 **** self.aLanguage = "en" self.sLanguage = "None" ! print output.bold("\nHit enter to scan DVD") try: null = raw_input() del null except KeyboardInterrupt: ! print output.bold("\n\nExiting...") sys.exit(2) self.scanDVD() --- 45,56 ---- self.aLanguage = "en" self.sLanguage = "None" ! #print output.bold("\nHit enter to scan DVD") ! print "\nHit enter to scan DVD" try: null = raw_input() del null except KeyboardInterrupt: ! #print output.bold("\n\nExiting...") ! print "\n\nExiting..." sys.exit(2) self.scanDVD() *************** *** 73,77 **** elif mode == 'toplevel': ! print output.bold("\nTracks on DVD: ((*) means track will be ripped)") for track in self.tracks: star = " " --- 58,63 ---- elif mode == 'toplevel': ! #print output.bold("\nTracks on DVD: ((*) means track will be ripped)") ! print "\nTracks on DVD: ((*) means track will be ripped)" for track in self.tracks: star = " " *************** *** 101,105 **** passes = 2 print "" ! print output.bold("More Settings") print "" print "Paths:" --- 87,92 ---- passes = 2 print "" ! #print output.bold("More Settings") ! print "More Settings" print "" print "Paths:" *************** *** 131,135 **** elif mode == 'rip': print "" ! print output.bold("* QuickRip will rip these DVD tracks:") trackno = 0 for track in self.tracks: --- 118,123 ---- elif mode == 'rip': print "" ! #print output.bold("* QuickRip will rip these DVD tracks:") ! print "* QuickRip will rip these DVD tracks:" trackno = 0 for track in self.tracks: *************** *** 138,147 **** print "Track %2s (%s/%s.avi) at %skbps" % (track['id'], self.outdir, track['name'], track['vbr']) if trackno == 0: ! print output.bold("You don't seem to have selected any tracks to rip!") ! print output.bold("Hit enter to return to the main menu") null = raw_input() del null self.main("toplevel") ! print output.bold("Hit enter to begin ripping, or 'b' to return to the menu") null = raw_input("> ") if null == 'b': --- 126,138 ---- print "Track %2s (%s/%s.avi) at %skbps" % (track['id'], self.outdir, track['name'], track['vbr']) if trackno == 0: ! #print output.bold("You don't seem to have selected any tracks to rip!") ! print "You don't seem to have selected any tracks to rip!" ! #print output.bold("Hit enter to return to the main menu") ! print "Hit enter to return to the main menu" null = raw_input() del null self.main("toplevel") ! #print output.bold("Hit enter to begin ripping, or 'b' to return to the menu") ! print "Hit enter to begin ripping, or 'b' to return to the menu" null = raw_input("> ") if null == 'b': *************** *** 153,157 **** def askTrack(self): ! print output.bold("Enter letter/track number to edit information, or 'r' to start ripping") try: choice = raw_input("> ") --- 144,149 ---- def askTrack(self): ! #print output.bold("Enter letter/track number to edit information, or 'r' to start ripping") ! print "Enter letter/track number to edit information, or 'r' to start ripping" try: choice = raw_input("> ") *************** *** 179,183 **** track = self.tracks[choice - 1] except: ! print output.bold("Invalid track number!") self.askTrack() self.main("track", track) --- 171,176 ---- track = self.tracks[choice - 1] except: ! #print output.bold("Invalid track number!") ! print "Invalid track number!" self.askTrack() self.main("track", track) *************** *** 185,192 **** def changeDir(self): #print "" ! print output.bold("\nEnter new output directory:") path = raw_input("> ") if os.path.exists(path) == 0: ! print output.bold("Invalid directory!") self.changeDir() else: --- 178,187 ---- def changeDir(self): #print "" ! #print output.bold("\nEnter new output directory:") ! print "\nEnter new output directory:" path = raw_input("> ") if os.path.exists(path) == 0: ! #print output.bold("Invalid directory!") ! print "Invalid directory!" self.changeDir() else: *************** *** 196,208 **** def changeVolume(self): #print "" ! print output.bold("\nEnter new volume adjustment (0-10):") vol = raw_input("> ") try: vol = int(vol) except: ! print output.bold("Invalid volume adjustment!") self.changeVolume() if vol < 0 or vol > 10: ! print output.bold("Invalid volume adjustment!") self.changeVolume() self.volumead = vol --- 191,206 ---- def changeVolume(self): #print "" ! #print output.bold("\nEnter new volume adjustment (0-10):") ! print "\nEnter new volume adjustment (0-10):" vol = raw_input("> ") try: vol = int(vol) except: ! #print output.bold("Invalid volume adjustment!") ! print "Invalid volume adjustment!" self.changeVolume() if vol < 0 or vol > 10: ! #print output.bold("Invalid volume adjustment!") ! print "Invalid volume adjustment!" self.changeVolume() self.volumead = vol *************** *** 214,218 **** langs = langs + lang + " " #print "" ! print output.bold("\nEnter audio language (%s)" % (langs)) langchoice = raw_input("> ") success = 0 --- 212,217 ---- langs = langs + lang + " " #print "" ! #print output.bold("\nEnter audio language (%s)" % (langs)) ! print "\nEnter audio language (%s)" % (langs) langchoice = raw_input("> ") success = 0 *************** *** 222,226 **** success = 1 if success == 0: ! print output.bold("Invalid language!") self.changeALang() del success, lang, langchoice --- 221,226 ---- success = 1 if success == 0: ! #print output.bold("Invalid language!") ! print "Invalid language!" self.changeALang() del success, lang, langchoice *************** *** 233,237 **** langs = langs + lang + " " #print "" ! print output.bold("\nEnter subtitle language (%s)" % (langs)) langchoice = raw_input("> ") success = 0 --- 233,238 ---- langs = langs + lang + " " #print "" ! #print output.bold("\nEnter subtitle language (%s)" % (langs)) ! print "\nEnter subtitle language (%s)" % (langs) langchoice = raw_input("> ") success = 0 *************** *** 244,248 **** success = 1 if success == 0: ! print output.bold("Invalid language!") self.changeSLang() del success, lang, langchoice --- 245,250 ---- success = 1 if success == 0: ! #print output.bold("Invalid language!") ! print "Invalid language!" self.changeSLang() del success, lang, langchoice *************** *** 255,259 **** def askSettings(self): #print "" ! print output.bold("\nEnter letter to change setting, or 'b' to go back to the track listing") choice = raw_input("> ") --- 257,262 ---- def askSettings(self): #print "" ! #print output.bold("\nEnter letter to change setting, or 'b' to go back to the track listing") ! print "\nEnter letter to change setting, or 'b' to go back to the track listing" choice = raw_input("> ") *************** *** 279,291 **** self.main("toplevel") else: ! print output.bold("Invalid operation!") self.askSettings() def changePath(self, type): #print "" ! print output.bold("\nEnter new path for %s:" % (type)) path = raw_input("> ") if not os.path.exists(path): ! print output.bold("Invalid path!") self.changePath(type) self.config[type] = path --- 282,297 ---- self.main("toplevel") else: ! #print output.bold("Invalid operation!") ! print "Invalid operation!" self.askSettings() def changePath(self, type): #print "" ! #print output.bold("\nEnter new path for %s:" % (type)) ! print "\nEnter new path for %s:" % (type) path = raw_input("> ") if not os.path.exists(path): ! #print output.bold("Invalid path!") ! print "Invalid path!" self.changePath(type) self.config[type] = path *************** *** 294,298 **** def changeDeinterlacing(self): #print "" ! print output.bold("\nEnter interlacing option:") for key in self.dio.keys(): print "(%s) %s" % (str(key), self.dio[key]) --- 300,305 ---- def changeDeinterlacing(self): #print "" ! #print output.bold("\nEnter interlacing option:") ! print "\nEnter interlacing option:" for key in self.dio.keys(): print "(%s) %s" % (str(key), self.dio[key]) *************** *** 303,307 **** null = self.dio[choice] except: ! print output.bold("Invalid option!") self.changeDeinterlacing() self.config['deinterlacing'] = choice --- 310,315 ---- null = self.dio[choice] except: ! #print output.bold("Invalid option!") ! print "Invalid option!" self.changeDeinterlacing() self.config['deinterlacing'] = choice *************** *** 310,314 **** def changeAspectRatio(self): #print "" ! print output.bold("\nEnter aspect ratio:") for key in self.aro.keys(): print "(%s) %s" % (str(key), self.aro[key]) --- 318,323 ---- def changeAspectRatio(self): #print "" ! #print output.bold("\nEnter aspect ratio:") ! print "\nEnter aspect ratio:" for key in self.aro.keys(): print "(%s) %s" % (str(key), self.aro[key]) *************** *** 317,330 **** choice = raw_input("> ") except KeyboardInterrupt: ! print output.bold("\n\nExiting...") sys.exit(2) try: choice = int(choice) except ValueError, error_message: ! print output.bold("Invalid value:", error_message) try: null = self.aro[choice] except: ! print output.bold("Invalid ratio!") self.changeAspectRatio() self.config['aspectratio'] = choice --- 326,342 ---- choice = raw_input("> ") except KeyboardInterrupt: ! #print output.bold("\n\nExiting...") ! print "\n\nExiting..." sys.exit(2) try: choice = int(choice) except ValueError, error_message: ! #print output.bold("Invalid value:", error_message) ! print "Invalid value:", error_message try: null = self.aro[choice] except: ! #print output.bold("Invalid ratio!") ! print "Invalid ratio!" self.changeAspectRatio() self.config['aspectratio'] = choice *************** *** 333,348 **** def changePasses(self): #print "" ! print output.bold("\nEnter number of passes (see online documentation) (1, 2 or 3):") try: choice = raw_input("> ") except KeyboardInterrupt: ! print output.bold("\n\nExiting...") sys.exit(2) try: choice = int(choice) except ValueError, error_message: ! print output.bold("Invalid value:", error_message) if choice < 1 or choice > 3: ! print output.bold("Invalid number!") self.changePasses() self.config['passes'] = choice --- 345,364 ---- def changePasses(self): #print "" ! #print output.bold("\nEnter number of passes (see online documentation) (1, 2 or 3):") ! print "\nEnter number of passes (see online documentation) (1, 2 or 3):" try: choice = raw_input("> ") except KeyboardInterrupt: ! #print output.bold("\n\nExiting...") ! print "\n\nExiting..." sys.exit(2) try: choice = int(choice) except ValueError, error_message: ! #print output.bold("Invalid value:", error_message) ! print "Invalid value:", error_message if choice < 1 or choice > 3: ! #print output.bold("Invalid number!") ! print "Invalid number!" self.changePasses() self.config['passes'] = choice *************** *** 350,361 **** def changePDAMode(self): ! print output.bold("\nPDA Mode: (yes/no):") try: choice = raw_input("> ") except KeyboardInterrupt: ! print output.bold("\n\nExiting...") sys.exit(2) if choice not in ['yes', 'no']: ! print output.bold("Invalid option!") self.changePDAMode() if choice == 'yes': --- 366,380 ---- def changePDAMode(self): ! #print output.bold("\nPDA Mode: (yes/no):") ! print "\nPDA Mode: (yes/no):" try: choice = raw_input("> ") except KeyboardInterrupt: ! #print output.bold("\n\nExiting...") ! print "\n\nExiting..." sys.exit(2) if choice not in ['yes', 'no']: ! #print output.bold("Invalid option!") ! print "Invalid option!" self.changePDAMode() if choice == 'yes': *************** *** 379,388 **** self.parser.write(open(self.configfile, 'w')) print "* Completed" ! print output.bold("Press enter to continue") try: null = raw_input() del null except KeyboardInterrupt: ! print output.bold("\n\nExiting...") sys.exit(2) self.main("settings") --- 398,409 ---- self.parser.write(open(self.configfile, 'w')) print "* Completed" ! #print output.bold("Press enter to continue") ! print "Press enter to continue" try: null = raw_input() del null except KeyboardInterrupt: ! #print output.bold("\n\nExiting...") ! print "\n\nExiting..." sys.exit(2) self.main("settings") *************** *** 391,399 **** def changeTrack(self, track): #print "" ! print output.bold("\nEnter letter to change information, or 'b' to go back to the track listing") try: choice = raw_input("> ") except KeyboardInterrupt: ! print output.bold("\n\nExiting...") sys.exit(2) --- 412,422 ---- def changeTrack(self, track): #print "" ! #print output.bold("\nEnter letter to change information, or 'b' to go back to the track listing") ! print "\nEnter letter to change information, or 'b' to go back to the track listing" try: choice = raw_input("> ") except KeyboardInterrupt: ! #print output.bold("\n\nExiting...") ! print "\n\nExiting..." sys.exit(2) *************** *** 409,422 **** self.main("toplevel") else: ! print output.bold("Invalid operation!") self.changeTrack(track) def changeName(self, track): #print "" ! print output.bold("\nEnter new name:") try: name = raw_input("> ") except KeyboardInterrupt: ! print output.bold("\n\nExiting...") sys.exit(2) track['name'] = name --- 432,448 ---- self.main("toplevel") else: ! #print output.bold("Invalid operation!") ! print "Invalid operation!" self.changeTrack(track) def changeName(self, track): #print "" ! #print output.bold("\nEnter new name:") ! print "\nEnter new name:" try: name = raw_input("> ") except KeyboardInterrupt: ! #print output.bold("\n\nExiting...") ! print "\n\nExiting..." sys.exit(2) track['name'] = name *************** *** 425,438 **** def changeSize(self, track): #print "" ! print output.bold("\nEnter new file size (MB):") try: size = raw_input("> ") except KeyboardInterrupt: ! print output.bold("\n\nExiting...") sys.exit(2) try: size = int(size) except ValueError: ! print output.bold("Invalid size!") self.changeSize(track) track['size'] = size --- 451,467 ---- def changeSize(self, track): #print "" ! #print output.bold("\nEnter new file size (MB):") ! print "\nEnter new file size (MB):" try: size = raw_input("> ") except KeyboardInterrupt: ! #print output.bold("\n\nExiting...") ! print "\n\nExiting..." sys.exit(2) try: size = int(size) except ValueError: ! #print output.bold("Invalid size!") ! print "Invalid size!" self.changeSize(track) track['size'] = size *************** *** 442,458 **** def changeABR(self, track): #print "" ! print output.bold("\nEnter new audio bitrate (kbps) [64, 96, 128, 160]:") try: abr = raw_input("> ") except KeyboardInterrupt: ! print output.bold("\n\nExiting...") sys.exit(2) try: abr = int(abr) except: ! print output.bold("Invalid bitrate!") self.changeABR(track) if abr != 64 and abr != 96 and abr != 128 and abr != 160: ! print output.bold("Invalid bitrate!") self.changeABR(track) track['abr'] = abr --- 471,491 ---- def changeABR(self, track): #print "" ! #print output.bold("\nEnter new audio bitrate (kbps) [64, 96, 128, 160]:") ! print "\nEnter new audio bitrate (kbps) [64, 96, 128, 160]:" try: abr = raw_input("> ") except KeyboardInterrupt: ! #print output.bold("\n\nExiting...") ! print "\n\nExiting..." sys.exit(2) try: abr = int(abr) except: ! #print output.bold("Invalid bitrate!") ! print "Invalid bitrate!" self.changeABR(track) if abr != 64 and abr != 96 and abr != 128 and abr != 160: ! #print output.bold("Invalid bitrate!") ! print "Invalid bitrate!" self.changeABR(track) track['abr'] = abr *************** *** 462,473 **** def changeRip(self, track): #print "" ! print output.bold("\nRip track? [yes/no]:") try: rip = raw_input("> ") except KeyboardInterrupt: ! print output.bold("\n\nExiting...") sys.exit(2) if rip not in ['yes', 'no']: ! print output.bold("Invalid option!") self.changeRip(track) track['rip'] = rip --- 495,509 ---- def changeRip(self, track): #print "" ! #print output.bold("\nRip track? [yes/no]:") ! print "\nRip track? [yes/no]:" try: rip = raw_input("> ") except KeyboardInterrupt: ! #print output.bold("\n\nExiting...") ! print "\n\nExiting..." sys.exit(2) if rip not in ['yes', 'no']: ! #print output.bold("Invalid option!") ! print "Invalid option!" self.changeRip(track) track['rip'] = rip *************** *** 475,479 **** def int_configError(self, bin): ! print output.bold("Configuration error: Unable to find %s, check it is installed" % (bin)) sys.exit(2) --- 511,516 ---- def int_configError(self, bin): ! #print output.bold("Configuration error: Unable to find %s, check it is installed" % (bin)) ! print "Configuration error: Unable to find %s, check it is installed" % (bin) sys.exit(2) |