Package pyxmpp2 :: Package mainloop :: Module interfaces :: Class MainLoop
[hide private]

Class MainLoop


Base class for main loop implementations.
Nested Classes [hide private]
  __metaclass__
Metaclass for defining Abstract Base Classes (ABCs).
Instance Methods [hide private]
 
add_handler(self, handler)
Add a new handler to the main loop.
 
remove_handler(self, handler)
Add a new handler to the main loop.
 
delayed_call(self, delay, function)
Schedule function to be called from the main loop after delay seconds.
 
quit(self)
Make the loop stop after the current iteration.
 
loop(self, timeout=None)
Run the loop.
 
loop_iteration(self, timeout=1)
Single loop iteration.

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __init__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables [hide private]
  __abstractmethods__ = frozenset(['add_handler', 'finished', 'l...
  _abc_cache = <_weakrefset.WeakSet object at 0x86c13ec>
  _abc_negative_cache = <_weakrefset.WeakSet object at 0x86c142c>
  _abc_negative_cache_version = 10
  _abc_registry = <_weakrefset.WeakSet object at 0x86c138c>
Properties [hide private]
  started
True then the loop has been started.
  finished
True then the loop has been finished or is about to finish (the final iteration in progress).

Inherited from object: __class__

Method Details [hide private]

add_handler(self, handler)

 
Add a new handler to the main loop.
Parameters:
Decorators:
  • @abstractmethod

remove_handler(self, handler)

 

Add a new handler to the main loop.

Do nothing if the handler is not registered at the main loop.

Parameters:
Decorators:
  • @abstractmethod

delayed_call(self, delay, function)

 
Schedule function to be called from the main loop after delay seconds.
Parameters:
  • delay (float) - seconds to wait

quit(self)

 
Make the loop stop after the current iteration.
Decorators:
  • @abstractmethod

loop(self, timeout=None)

 
Run the loop.
Parameters:
  • timeout (float) - time to loop, if not given the method will run until finished
Decorators:
  • @abstractmethod

loop_iteration(self, timeout=1)

 
Single loop iteration.
Parameters:
  • timeout (float) - maximum time (in seconds) to block for
Decorators:
  • @abstractmethod

Class Variable Details [hide private]

__abstractmethods__

Value:
frozenset(['add_handler',
           'finished',
           'loop',
           'loop_iteration',
           'quit',
           'remove_handler',
           'started'])

Property Details [hide private]

started

True then the loop has been started.
Get Method:
unreachable.started(self) - True then the loop has been started.

finished

True then the loop has been finished or is about to finish (the final iteration in progress).
Get Method:
unreachable.finished(self) - True then the loop has been finished or is about to finish (the final iteration in progress).