Exemplo n.º 1
0
 def remove_playing_download(self, d2remove):
     """ Called when sesscb_remove_playing_callback has determined that
     we should remove this Download, because it would take too much
     bandwidth to download it and the user is apparently no longer
     interested. 
     """
     BaseApp.remove_playing_download(self, d2remove)
     if d2remove in self.dusers:
         if DEBUG:
             print >> sys.stderr, "bg: remove_playing_download"
         if 'streaminfo' in self.dusers[d2remove]:
             stream = self.dusers[d2remove]['streaminfo']['stream']
             stream.close()  # Close original stream.
         del self.dusers[d2remove]
 def remove_playing_download(self,d2remove):
     """ Called when sesscb_remove_playing_callback has determined that
     we should remove this Download, because it would take too much
     bandwidth to download it and the user is apparently no longer
     interested. 
     """
     BaseApp.remove_playing_download(self,d2remove)
     if d2remove in self.dusers:
         if DEBUG:
             print >>sys.stderr,"bg: remove_playing_download"
         if 'streaminfo' in self.dusers[d2remove]:
             stream = self.dusers[d2remove]['streaminfo']['stream']
             stream.close() # Close original stream. 
         del self.dusers[d2remove]
Exemplo n.º 3
0
 def gui_webui_halt_download(self,d2halt,stop=False):
     """ Called when user has decided to stop or remove a specific DL via webUI.
     For stop the Download is not removed. """
     if d2halt in self.dusers:
         try:
             duser = self.dusers[d2halt]
             olduic = duser['uic'] 
             if olduic is not None:
                 print >>sys.stderr,time.asctime(),'-', "bg: gui_webui_halt_download: Oops, someone interested, removing anyway"
                 olduic.shutdown()
             if 'streaminfo' in duser:
                 # Download was already playing, clean up.
                 stream = duser['streaminfo']['stream']
                 stream.close() # Close original stream.
         finally: 
             del self.dusers[d2halt]
     if stop:
         BaseApp.stop_playing_download(self,d2halt)
     else:
         BaseApp.remove_playing_download(self,d2halt)
Exemplo n.º 4
0
 def remove_playing_download(self,d2remove):
     """ Called when sesscb_remove_playing_callback has determined that
     we should remove this Download, because it would take too much
     bandwidth to download it. However, we must check in another user has not
     become interested. 
     """
     if DEBUG:
         print >>sys.stderr,time.asctime(),'-', "bg: remove_playing_download @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@"
     if d2remove in self.dusers:
         duser = self.dusers[d2remove]
         if duser['uic'] is None:
             # No interest
             if DEBUG:
                 print >>sys.stderr,time.asctime(),'-', "bg: remove_playing_download: Yes, no interest"
             BaseApp.remove_playing_download(self,d2remove)
             if 'streaminfo' in duser:
                 stream = duser['streaminfo']['stream']
                 stream.close() # Close original stream. 
             del self.dusers[d2remove]
         elif DEBUG:
             print >>sys.stderr,time.asctime(),'-', "bg: remove_playing_download: No, someone interested",`duser['uic']`