Changeset edb747718564c058a13dbca8f9e7358d83c7b792
- Timestamp:
- 03/02/08 01:29:52 (10 months ago)
- git-parent:
[76b6596620086bd3b1d7fa1349af03c5a538337e], [48e5447199435cb9695489516056d65842b74acc]
- Files:
-
- config.py (modified) (1 diff)
- httpserver.py (modified) (2 diffs)
- plugins/admin/__init__.py (added)
- plugins/admin/admin.py (added)
- plugins/admin/templates/admin.tmpl (added)
- plugins/admin/templates/redirect.tmpl (added)
- plugins/admin/templates/settings.tmpl (added)
- plugins/music/music.py (modified) (3 diffs)
- plugins/video/transcode.py (modified) (4 diffs)
- plugins/video/video.py (modified) (2 diffs)
- templates/info_page.tmpl (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
config.py
rea972e2 redb7477 7 7 config = ConfigParser.ConfigParser() 8 8 p = os.path.dirname(__file__) 9 config.read(os.path.join(p, 'pyTivo.conf')) 9 config_file = os.path.join(p, 'pyTivo.conf') 10 config.read(config_file) 11 12 def reset(): 13 global config 14 del config 15 config = ConfigParser.ConfigParser() 16 config.read(config_file) 10 17 11 18 def getGUID(): httpserver.py
rc3d52f8 r48e5447 29 29 except KeyError: 30 30 print 'Unable to add container', name 31 32 def reset(self): 33 self.containers.clear() 34 for section, settings in config.getShares(): 35 self.add_container(section, settings) 31 36 32 37 class TivoHTTPHandler(BaseHTTPServer.BaseHTTPRequestHandler): … … 109 114 t = Template(file=os.path.join(SCRIPTDIR, 'templates', 110 115 'info_page.tmpl')) 116 t.admin = '' 117 for section, settings in config.getShares(): 118 if 'type' in settings and settings['type'] == 'admin': 119 t.admin += '<a href="/TiVoConnect?Command=Admin&Container=' + section\ 120 + '">pyTivo Web Configuration</a><br>' 111 121 self.wfile.write(t) 112 122 self.end_headers() plugins/music/music.py
rc6d88c9 r9776082 11 11 SCRIPTDIR = os.path.dirname(__file__) 12 12 13 FFMPEG = config.get('Server', 'ffmpeg') 13 def ffmpeg_path(): 14 return config.get('Server', 'ffmpeg') 14 15 15 16 CLASS_NAME = 'Music' … … 120 121 if mswindows: 121 122 fname = fname.encode('iso8859-1') 122 cmd = [ FFMPEG, '-i', fname, '-acodec', 'libmp3lame', '-ab',123 cmd = [ffmpeg_path(), '-i', fname, '-acodec', 'libmp3lame', '-ab', 123 124 '320k', '-ar', '44100', '-f', 'mp3', '-'] 124 125 if seek: … … 203 204 if mswindows: 204 205 fname = fname.encode('iso8859-1') 205 cmd = [ FFMPEG, '-i', fname]206 cmd = [ffmpeg_path(), '-i', fname] 206 207 ffmpeg = subprocess.Popen(cmd, stderr=subprocess.PIPE, 207 208 stdout=subprocess.PIPE, plugins/video/transcode.py
rcaed72b redb7477 4 4 5 5 info_cache = lrucache.LRUCache(1000) 6 7 BUFF_SIZE = config.getBuffSize()8 FFMPEG = config.get('Server', 'ffmpeg')9 6 videotest = os.path.join(os.path.dirname(__file__), 'videotest.mpg') 7 8 def ffmpeg_path(): 9 return config.get('Server', 'ffmpeg') 10 10 11 11 # XXX BIG HACK … … 42 42 settings['video_br'] = config.getVideoBR(tsn) 43 43 settings['max_video_br'] = config.getMaxVideoBR() 44 settings['buff_size'] = BUFF_SIZE44 settings['buff_size'] = config.getBuffSize() 45 45 settings['aspect_ratio'] = ' '.join(select_aspect(inFile, tsn)) 46 46 47 47 cmd_string = config.getFFMPEGTemplate(tsn) % settings 48 48 49 cmd = [ FFMPEG, '-i', inFile] + cmd_string.split()49 cmd = [ffmpeg_path(), '-i', inFile] + cmd_string.split() 50 50 print 'transcoding to tivo model '+tsn[:3]+' using ffmpeg command:' 51 51 print ' '.join(cmd) … … 294 294 return True, True, True, True, True, True, True, True, True 295 295 296 cmd = [ FFMPEG, '-i', inFile ]296 cmd = [ffmpeg_path(), '-i', inFile ] 297 297 ffmpeg = subprocess.Popen(cmd, stderr=subprocess.PIPE, stdout=subprocess.PIPE, stdin=subprocess.PIPE) 298 298 … … 403 403 404 404 def video_check(inFile, cmd_string): 405 cmd = [ FFMPEG, '-i', inFile] + cmd_string.split()405 cmd = [ffmpeg_path(), '-i', inFile] + cmd_string.split() 406 406 ffmpeg = subprocess.Popen(cmd, stdout=subprocess.PIPE) 407 407 try: plugins/video/video.py
rc3d52f8 r48e5447 21 21 extensions = None 22 22 23 hack83 = config.getHack83() 24 25 if hack83: 23 if config.getHack83(): 26 24 debug_write(__name__, fn_attr(), ['Hack83 is enabled.']) 27 25 … … 328 326 # If you are running 8.3 software you want to enable hack83 329 327 # in the config file 330 331 if hack83: 328 if config.getHack83(): 332 329 print '=' * 73 333 330 query, hackPath = self.hack(handler, query, subcname) templates/info_page.tmpl
r1ac04c9 r61e5f71 1 1 <html> 2 2 <body> 3 This is a pyTivo server 3 This is a pyTivo server<br> 4 $admin 4 5 </body> 5 6 </html>
