test: Unregister agents on keyboard interrupt

Control-C now calls UnregisterAgent(), so the agents exit cleanly.
This commit is contained in:
Aki Niemi 2010-12-03 14:47:40 +02:00
parent 4f2311b2e2
commit 4da8836495
2 changed files with 12 additions and 2 deletions

View File

@ -44,4 +44,9 @@ if __name__ == '__main__':
print "Agent registered"
mainloop = gobject.MainLoop()
mainloop.run()
try:
mainloop.run()
except KeyboardInterrupt:
pn.UnregisterAgent(path)
mainloop.run()

View File

@ -62,4 +62,9 @@ if __name__ == '__main__':
print "Agent registered"
mainloop = gobject.MainLoop()
mainloop.run()
try:
mainloop.run()
except KeyboardInterrupt:
pn.UnregisterAgent(path)
mainloop.run()