Changeset edb747718564c058a13dbca8f9e7358d83c7b792

Show
Ignore:
Timestamp:
03/02/08 01:29:52 (10 months ago)
Author:
wgw <tjm1100@gmail.com>
git-committer:
wgw <tjm1100@gmail.com> 1204442992 -0600
git-parent:

[76b6596620086bd3b1d7fa1349af03c5a538337e], [48e5447199435cb9695489516056d65842b74acc]

git-author:
wgw <tjm1100@gmail.com> 1204442992 -0600
Message:

Merge branch 'master' of git://repo.or.cz/pyTivo/krkeegan

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • config.py

    rea972e2 redb7477  
    77config = ConfigParser.ConfigParser() 
    88p = os.path.dirname(__file__) 
    9 config.read(os.path.join(p, 'pyTivo.conf')) 
     9config_file = os.path.join(p, 'pyTivo.conf') 
     10config.read(config_file) 
     11 
     12def reset(): 
     13    global config 
     14    del config 
     15    config = ConfigParser.ConfigParser() 
     16    config.read(config_file) 
    1017 
    1118def getGUID(): 
  • httpserver.py

    rc3d52f8 r48e5447  
    2929        except KeyError: 
    3030            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) 
    3136 
    3237class TivoHTTPHandler(BaseHTTPServer.BaseHTTPRequestHandler): 
     
    109114        t = Template(file=os.path.join(SCRIPTDIR, 'templates', 
    110115                                       '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>' 
    111121        self.wfile.write(t) 
    112122        self.end_headers() 
  • plugins/music/music.py

    rc6d88c9 r9776082  
    1111SCRIPTDIR = os.path.dirname(__file__) 
    1212 
    13 FFMPEG = config.get('Server', 'ffmpeg') 
     13def ffmpeg_path(): 
     14    return config.get('Server', 'ffmpeg') 
    1415 
    1516CLASS_NAME = 'Music' 
     
    120121            if mswindows: 
    121122                fname = fname.encode('iso8859-1') 
    122             cmd = [FFMPEG, '-i', fname, '-acodec', 'libmp3lame', '-ab',  
     123            cmd = [ffmpeg_path(), '-i', fname, '-acodec', 'libmp3lame', '-ab',  
    123124                   '320k', '-ar', '44100', '-f', 'mp3', '-'] 
    124125            if seek: 
     
    203204                if mswindows: 
    204205                    fname = fname.encode('iso8859-1') 
    205                 cmd = [FFMPEG, '-i', fname] 
     206                cmd = [ffmpeg_path(), '-i', fname] 
    206207                ffmpeg = subprocess.Popen(cmd, stderr=subprocess.PIPE, 
    207208                                               stdout=subprocess.PIPE,  
  • plugins/video/transcode.py

    rcaed72b redb7477  
    44 
    55info_cache = lrucache.LRUCache(1000) 
    6  
    7 BUFF_SIZE = config.getBuffSize() 
    8 FFMPEG = config.get('Server', 'ffmpeg') 
    96videotest = os.path.join(os.path.dirname(__file__), 'videotest.mpg') 
     7 
     8def ffmpeg_path(): 
     9    return config.get('Server', 'ffmpeg') 
    1010 
    1111# XXX BIG HACK 
     
    4242    settings['video_br'] = config.getVideoBR(tsn) 
    4343    settings['max_video_br'] = config.getMaxVideoBR() 
    44     settings['buff_size'] = BUFF_SIZE 
     44    settings['buff_size'] = config.getBuffSize() 
    4545    settings['aspect_ratio'] = ' '.join(select_aspect(inFile, tsn)) 
    4646 
    4747    cmd_string = config.getFFMPEGTemplate(tsn) % settings 
    4848 
    49     cmd = [FFMPEG, '-i', inFile] + cmd_string.split() 
     49    cmd = [ffmpeg_path(), '-i', inFile] + cmd_string.split() 
    5050    print 'transcoding to tivo model '+tsn[:3]+' using ffmpeg command:' 
    5151    print ' '.join(cmd) 
     
    294294        return True, True, True, True, True, True, True, True, True 
    295295 
    296     cmd = [FFMPEG, '-i', inFile ]  
     296    cmd = [ffmpeg_path(), '-i', inFile ]  
    297297    ffmpeg = subprocess.Popen(cmd, stderr=subprocess.PIPE, stdout=subprocess.PIPE, stdin=subprocess.PIPE) 
    298298 
     
    403403 
    404404def video_check(inFile, cmd_string): 
    405     cmd = [FFMPEG, '-i', inFile] + cmd_string.split() 
     405    cmd = [ffmpeg_path(), '-i', inFile] + cmd_string.split() 
    406406    ffmpeg = subprocess.Popen(cmd, stdout=subprocess.PIPE) 
    407407    try: 
  • plugins/video/video.py

    rc3d52f8 r48e5447  
    2121    extensions = None 
    2222 
    23 hack83 = config.getHack83() 
    24  
    25 if hack83: 
     23if config.getHack83(): 
    2624    debug_write(__name__, fn_attr(), ['Hack83 is enabled.']) 
    2725 
     
    328326        # If you are running 8.3 software you want to enable hack83 
    329327        # in the config file 
    330  
    331         if hack83: 
     328        if config.getHack83(): 
    332329            print '=' * 73 
    333330            query, hackPath = self.hack(handler, query, subcname) 
  • templates/info_page.tmpl

    r1ac04c9 r61e5f71  
    11<html> 
    22    <body> 
    3         This is a pyTivo server 
     3        This is a pyTivo server<br> 
     4        $admin 
    45    </body> 
    56</html>