Vega strike Python Modules doc  0.5.1
Documentation of the " Modules " folder of Vega strike
 All Data Structures Namespaces Files Functions Variables
_Timer Class Reference
Inheritance diagram for _Timer:
Thread _Verbose

Public Member Functions

def __init__
 
def cancel
 
def run
 
- Public Member Functions inherited from Thread
def __init__
 
def __repr__
 
def start
 
def run
 
def join
 
def getName
 
def setName
 
def isAlive
 
def isDaemon
 
def setDaemon
 
- Public Member Functions inherited from _Verbose
def __init__
 
def __init__
 

Data Fields

 interval
 
 function
 
 args
 
 kwargs
 
 finished
 

Detailed Description

Call a function after a specified number of seconds:

t = Timer(30.0, f, args=[], kwargs={})
t.start()
t.cancel() # stop the timer's action if it's still waiting

Definition at line 493 of file threading.py.

Constructor & Destructor Documentation

def __init__ (   self,
  interval,
  function,
  args = [],
  kwargs = {} 
)

Definition at line 501 of file threading.py.

502  def __init__(self, interval, function, args=[], kwargs={}):
503  Thread.__init__(self)
504  self.interval = interval
505  self.function = function
506  self.args = args
507  self.kwargs = kwargs
508  self.finished = Event()

Member Function Documentation

def cancel (   self)
Stop the timer if it hasn't finished yet

Definition at line 509 of file threading.py.

510  def cancel(self):
511  """Stop the timer if it hasn't finished yet"""
512  self.finished.set()
def run (   self)

Definition at line 513 of file threading.py.

References SMTPResponseException.args, SMTPSenderRefused.args, SMTPRecipientsRefused.args, _Timer.args, _Timer.function, _Timer.interval, and _Timer.kwargs.

514  def run(self):
515  self.finished.wait(self.interval)
516  if not self.finished.isSet():
517  self.function(*self.args, **self.kwargs)
518  self.finished.set()
519 
520 # Special thread class to represent the main thread
521 # This is garbage collected through an exit handler

Field Documentation

args

Definition at line 505 of file threading.py.

finished

Definition at line 507 of file threading.py.

function

Definition at line 504 of file threading.py.

interval

Definition at line 503 of file threading.py.

kwargs

Definition at line 506 of file threading.py.


The documentation for this class was generated from the following file: