Changes between Version 10 and Version 11 of Development/1.2/Plugin


Ignore:
Timestamp:
09/11/2009 03:56:43 PM (13 years ago)
Author:
andar
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Development/1.2/Plugin

    v10 v11  
    176176 
    177177client.myplugin.get_config().addCallback(on_get_config) 
    178  
    179178}}} 
    180179 
     
    194193    "total_upload": 0 
    195194} 
    196  
    197195}}} 
    198196 
     
    218216        self.config["total_upload"] = self.total_upload 
    219217        self.config["total_download"] = self.total_download 
    220  
    221218}}} 
    222219 
     
    234231        self.total_upload = self.config["total_upload"] + status["total_upload"] 
    235232        self.total_download = self.config["total_download"] + status["total_download"] 
    236  
    237233}}} 
    238234 
     
    249245 
    250246from twisted.internet.task import LoopingCall 
    251  
    252247}}} 
    253248 
     
    265260        self.update_status_timer.start(2) 
    266261 
    267 }}} 
    268  
    269 The syntax for the `LoopingCall` is simple, it just takes function you wish to call in the timer.  Next, we simply `start()` the timer with a value in seconds that determines it's frequency, in this case the function will be called every 2 seconds. 
    270  
     262    def disable(self): 
     263        self.update_status_timer.stop() 
     264 
     265        self.config["total_upload"] = self.total_upload 
     266        self.config["total_download"] = self.total_download 
     267}}} 
     268 
     269The syntax for the `LoopingCall` is simple, it just takes function you wish to call in the timer.  Next, we simply `start()` the timer with a value in seconds that determines it's frequency, in this case the function will be called every 2 seconds.  In our `disable()` method we `stop()` the timer. 
     270