Exemplo n.º 1
0
    def gui_states_callback(self, dslist, haspeerlist):
        """ Override BaseApp """
        (playing_dslist, totalhelping,
         totalspeed) = BaseApp.gui_states_callback(self, dslist, haspeerlist)
        try:
            self.report_periodic_vod_stats(playing_dslist)
        except:
            print_exc()

        for ds in playing_dslist:
            d = ds.get_download()
            duser = self.dusers[d]
            uic = duser['uic']

            # Generate info string for all
            [
                topmsg, msg, duser['said_start_playback'],
                duser['decodeprogress']
            ] = get_status_msgs(ds, self.approxplayerstate, self.appname,
                                duser['said_start_playback'],
                                duser['decodeprogress'], totalhelping,
                                totalspeed)
            info = msg
            #if DEBUG:
            #    print >>sys.stderr, 'bg: 4INFO: Sending',info
            uic.info(info)
 def gui_states_callback(self,dslist,haspeerlist):
     """ Override BaseApp """
     (playing_dslist,totalhelping,totalspeed) = BaseApp.gui_states_callback(self,dslist,haspeerlist)
     try:
         self.report_periodic_vod_stats(playing_dslist)
     except:
         print_exc()
    
     for ds in playing_dslist:
         d = ds.get_download()
         duser = self.dusers[d]
         uic = duser['uic']
         
         # Generate info string for all
         [topmsg,msg,duser['said_start_playback'],duser['decodeprogress']] = get_status_msgs(ds,self.approxplayerstate,self.appname,duser['said_start_playback'],duser['decodeprogress'],totalhelping,totalspeed)
         info = msg
         #if DEBUG:
         #    print >>sys.stderr, 'bg: 4INFO: Sending',info
         uic.info(info)
Exemplo n.º 3
0
    def gui_states_callback(self,dslist,haspeerlist):
        """ Override BaseApp """
        #print >>sys.stderr,time.asctime(),'-', "bg: gui_states_callback",currentThread().getName()
        (playing_dslist,totalhelping,totalspeed) = BaseApp.gui_states_callback(self,dslist,haspeerlist)
#        print >>sys.stderr,time.asctime(),'-', "playing_dslist=",playing_dslist,"  totalhelping=",totalhelping,"  down=",totalspeed[DOWNLOAD],"  up=",totalspeed[UPLOAD],"\n"
        try:
            self.report_periodic_vod_stats(playing_dslist)
        except:
            print_exc()
       
        for ds in playing_dslist:
            d = ds.get_download()
            duser = self.dusers[d]
            uic = duser['uic']
            if uic is not None:
                # Generate info string for all
#                [topmsg,msg,duser['said_start_playback'],duser['decodeprogress']] = get_status_msgs(ds,self.approxplayerstate,self.appname,duser['said_start_playback'],duser['decodeprogress'],totalhelping,totalspeed)
                info = 'totalhelping='+str(totalhelping)+"\tdown="+str(round(totalspeed[DOWNLOAD]))+" KB/s\tup="+str(round(totalspeed[UPLOAD]))+" KB/s"
#		info = msg
                #if DEBUG:
                #    print >>sys.stderr, time.asctime(),'-', 'bg: 4INFO: Sending',info
                uic.info(info)