Changeset 9d2b62c372c3bb7efda006cd3e2564910e56d4c5

Show
Ignore:
Timestamp:
03/10/08 20:07:28 (10 months ago)
Author:
KRKeegan <-NOSPAM-kevin@krkeegan.com>
git-committer:
KRKeegan <-NOSPAM-kevin@krkeegan.com> 1205197648 -0700
git-parent:

[d23649dbc46a02e6b0a660893ad5be80ffec0332]

git-author:
KRKeegan <-NOSPAM-kevin@krkeegan.com> 1205197648 -0700
Message:

Add stop, try again functions

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • plugins/admin/admin.py

    r39ff75a r9d2b62c  
    278278            outfile = os.path.join(togo_path, "".join(name)) 
    279279 
    280             status[theurl] = {'running':True, 'error':'', 'rate':''
     280            status[theurl] = {'running':True, 'error':'', 'rate':'', 'finished':False
    281281 
    282282            thread.start_new_thread(Admin.get_tivo_file, (self, theurl, password, tivoIP, outfile)) 
     
    295295            t.text = '<h3>Missing Data.</h3>  <br>You must set both "tivo_mak" and "togo_path" before using this function.' 
    296296            handler.wfile.write(t) 
    297              
     297 
     298    def ToGoStop(self, handler, query): 
     299        parse_url = urlparse(str(query['Url'][0])) 
     300        theurl = 'http://' + parse_url[1].split(':')[0] + parse_url[2] + "?" + parse_url[4] 
     301         
     302        status[theurl]['running'] = False 
     303         
     304        subcname = query['Container'][0] 
     305        cname = subcname.split('/')[0] 
     306        handler.send_response(200) 
     307        handler.end_headers() 
     308        t = Template(file=os.path.join(SCRIPTDIR,'templates', 'redirect.tmpl')) 
     309        t.container = cname 
     310        t.text = '<h3>Transfer Stopped.</h3>  <br>Your transfer has been stopped.' 
     311        handler.wfile.write(t) 
  • plugins/admin/templates/npl.tmpl

    rd23649d r9d2b62c  
    6767                                        #set $this_status = $status[$unquote($row['Url'])] 
    6868                                        #if $this_status['running'] and $this_status['rate'] != "" 
    69                                                 Transfering - $this_status['rate'] KB/s                                  
     69                                                Transfering - $this_status['rate'] KB/s<br> 
     70                                                <a href="/TiVoConnect?Command=ToGoStop&Container=$(container)&Url=$(row['Url'])">Stop Transfer</a> 
    7071                                        #elif $this_status['running'] and $this_status['rate'] == "" 
    71                                                 Initiating Transfer. Please Wait 
     72                                                Initiating Transfer.<br> 
     73                                                Please Wait 
    7274                                        #elif $this_status['error'] 
    73                                                 Error - $this_status['error'] 
     75                                                Error - $this_status['error']<br> 
     76                                                <a href="/TiVoConnect?Command=ToGo&Container=$(container)&Url=$(row['Url'])">Try Transfer Again.</a> 
     77                                        #elif $this_status['finished'] 
     78                                                Transfer Complete! 
    7479                                        #else 
    75                                                 Transfer Complete 
     80                                                Transfer Stopped<br> 
     81                                                <a href="/TiVoConnect?Command=ToGo&Container=$(container)&Url=$(row['Url'])">Try Transfer Again.</a> 
    7682                                        #endif 
    7783                                #else