From: <te...@us...> - 2004-03-05 00:34:03
|
Update of /cvsroot/quickrip/ng In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22847 Modified Files: base.py config.py Log Message: Finished configuration screen in cli.py (including support work in base.py and config.py) Index: base.py =================================================================== RCS file: /cvsroot/quickrip/ng/base.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** base.py 4 Mar 2004 02:30:16 -0000 1.4 --- base.py 5 Mar 2004 00:12:29 -0000 1.5 *************** *** 46,51 **** self.numtitles = 0 self.titles = [] - self.dio = config.dio - self.aro = config.dio self.configfile = os.path.join(os.path.expanduser("~"), ".quickriprc") self.loadConfig() --- 46,49 ---- *************** *** 56,63 **** self.parser = ConfigParser.ConfigParser() if not os.path.isfile(self.configfile): ! self.parser.write(open(self.configfile, 'w')) ! self.parser.readfp(open(self.configfile, 'r')) ! variables = { \ 'mplayer': ['paths', self.findProgram("mplayer")], \ 'mencoder': ['paths', self.findProgram("mencoder")], \ --- 54,65 ---- self.parser = ConfigParser.ConfigParser() if not os.path.isfile(self.configfile): ! cfg = open(self.configfile, 'w') ! self.parser.write(cfg) ! cfg.close() ! cfg = open(self.configfile, 'r') ! self.parser.readfp(cfg) ! cfg.close() ! self.variables = { \ 'mplayer': ['paths', self.findProgram("mplayer")], \ 'mencoder': ['paths', self.findProgram("mencoder")], \ *************** *** 67,79 **** 'dvd_device': ['paths', os.path.join("/", "dev", "dvd")], \ 'deinterlacing': ['vencode', 'Off'], \ ! 'aspectratio': ['vencode', 0], \ 'videocodec': ['vencode', 'divx'], \ ! 'pdamode': ['vencode', 0], \ 'audiocodec': ['aencode', 'mp3'], \ ! 'volumead': ['aencode', 0], \ } ! for key in variables.keys(): ! self.cautiousLoad(variables[key][0], key, variables[key][1]) --- 69,82 ---- 'dvd_device': ['paths', os.path.join("/", "dev", "dvd")], \ 'deinterlacing': ['vencode', 'Off'], \ ! 'aspectratio': ['vencode', 'Default'], \ 'videocodec': ['vencode', 'divx'], \ ! 'pdamode': ['vencode', 'Off'], \ 'audiocodec': ['aencode', 'mp3'], \ ! 'volumead': ['aencode', '0'], \ ! 'logging': ['general', 'Off'] \ } ! for key in self.variables.keys(): ! self.cautiousLoad(self.variables[key][0], key, self.variables[key][1]) *************** *** 90,94 **** self.parser.add_section(section) self.parser.set(section, var, default) ! self.parser.write(open(self.configfile, 'w')) --- 93,99 ---- self.parser.add_section(section) self.parser.set(section, var, default) ! cfg = open(self.configfile, 'w') ! self.parser.write(cfg) ! cfg.close() *************** *** 102,105 **** --- 107,119 ---- + def saveConfig(self): + """Save the configuration file""" + for key in self.variables.keys(): + self.parser.set(self.variables[key][0], key, self.config[key]) + cfg = open(self.configfile, 'w') + self.parser.write(cfg) + cfg.close() + + def calcRate(self, length, audiobr, filesize): """Calculate bitrate for video based on: Index: config.py =================================================================== RCS file: /cvsroot/quickrip/ng/config.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** config.py 4 Mar 2004 02:30:16 -0000 1.2 --- config.py 5 Mar 2004 00:12:29 -0000 1.3 *************** *** 12,15 **** --- 12,16 ---- import os + # Basic information app = "QuickRip" author = "Tom Chance <tom...@gm...>" *************** *** 18,28 **** copyright = "(C) 2003 Tom Chance" license = "GNU General Public License (GPL) (see LICENSE file)" paths = os.environ['PATH'].split(":") required_programs = ['mplayer', 'mencoder'] icon = os.path.join("icons", "quickrip.xpm") qr_dir = "/usr/share/quickrip" ! aro = {0: 'Default', 1: '4:3', 2: '16:9', 3: '2.35:1'} ! dio = {0 : 'None', 1: 'dint', 2: 'il', 3: 'lavcdeint', 4: 'pp=lb'} ! abr = {0: 64, 1: 96, 2: 128, 3: 160, 4: 190} langs = { \ " ": "Not Specified", "aa": "Afar", "ab": "Abkhazian", "af": "Afrikaans", "am": "Amharic", \ --- 19,34 ---- copyright = "(C) 2003 Tom Chance" license = "GNU General Public License (GPL) (see LICENSE file)" + + # Misc paths = os.environ['PATH'].split(":") required_programs = ['mplayer', 'mencoder'] icon = os.path.join("icons", "quickrip.xpm") qr_dir = "/usr/share/quickrip" ! ! # Options for options :) ! video_codecs = ['divx', 'xvid', 'mpeg2'] ! audio_codecs = ['mp3', 'ogg'] ! aspect_ratios = ['Default', '4:3', '16:9', '2.35:1'] ! audio_bitrates = ['32', '48', '64', '96', '128', '160', '192', '256', '350'] langs = { \ " ": "Not Specified", "aa": "Afar", "ab": "Abkhazian", "af": "Afrikaans", "am": "Amharic", \ |