Add a method to find a Terminal object by its UUID

This commit is contained in:
Chris Jones 2011-08-24 22:38:56 +01:00
parent e4f125b441
commit 0c22433ef3
1 changed files with 9 additions and 0 deletions

View File

@ -139,6 +139,15 @@ class Terminator(Borg):
dbg('Terminator::deregister_terminal: %d terminals remain' %
len(self.terminals))
def find_terminal_by_uuid(self, uuid):
"""Search our terminals for one matching the supplied UUID"""
dbg('searching self.terminals for: %s' % uuid)
for terminal in self.terminals:
dbg('checking: %s (%s)' % (terminal.uuid.urn, terminal))
if terminal.uuid.urn == uuid:
return terminal
return None
def new_window(self, cwd=None):
"""Create a window with a Terminal in it"""
maker = Factory()