pyxmpp2.mainloop.interfaces.MainLoop

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. |
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([``])``
| _abc_cache = `<_weakrefset.WeakSet object at 0x8719a4c>`
| _abc_negative_cache = `<_weakrefset.WeakSet object at 0x8719a8c>`
| _abc_negative_cache_version = `10`
| _abc_registry = `<_weakrefset.WeakSet object at 0x87199ec>`

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: `handler` (IOHandler or EventHandler or TimeoutHandler) - the handler object to add

### 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: `handler` (IOHandler or EventHandler or TimeoutHandler) - the handler object to add

### loop(self, timeout=None) |
Run the loop. Parameters: `timeout` (`float`) - time to loop, if not given the method will run until finished

### loop_iteration(self, timeout=1) |
Single loop iteration. Parameters: `timeout` (`float`) - maximum time (in seconds) to block for

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).