diff options
author | Sam Thursfield <sam.thursfield@codethink.co.uk> | 2015-02-13 12:30:40 +0000 |
---|---|---|
committer | Sam Thursfield <sam.thursfield@codethink.co.uk> | 2015-02-13 12:30:40 +0000 |
commit | d9ad77ea43f99f3f6d58f66cb1bfe261d966c730 (patch) | |
tree | a7292917733da4b550bc9010077a4b839a06f56d /distbuild/mainloop.py | |
parent | 92e8cdbfa2687a0fcfe58f1ffc338171a5f8dc94 (diff) | |
parent | 503517b75c8fc99306e4a852e876fdbca2b79d39 (diff) | |
download | morph-d9ad77ea43f99f3f6d58f66cb1bfe261d966c730.tar.gz |
Merge branch 'sam/distbuild-errors'
Reviewed-By: Pedro Alvarez <pedro.alvarez@codethink.co.uk>
Reviewed-By: Francisco Redondo Marchena <francisco.marchena@codethink.co.uk>
Diffstat (limited to 'distbuild/mainloop.py')
-rw-r--r-- | distbuild/mainloop.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/distbuild/mainloop.py b/distbuild/mainloop.py index f0e5eebc..97e439f3 100644 --- a/distbuild/mainloop.py +++ b/distbuild/mainloop.py @@ -1,6 +1,6 @@ # mainloop/mainloop.py -- select-based main loop # -# Copyright (C) 2012, 2014 Codethink Limited +# Copyright (C) 2012, 2014-2015 Codethink Limited # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -56,7 +56,10 @@ class MainLoop(object): def remove_state_machine(self, machine): logging.debug('MainLoop.remove_state_machine: %s' % machine) self._machines.remove(machine) - + + def n_state_machines_of_type(self, machine_type): + return len([m for m in self._machines if isinstance(m, machine_type)]) + def add_event_source(self, event_source): logging.debug('MainLoop.add_event_source: %s' % event_source) self._sources.append(event_source) |