Add set_event argument to .shutdown() method
This commit is contained in:
parent
bbe3210bb6
commit
85189e8b36
|
@ -726,10 +726,19 @@ class Powerline(object):
|
|||
pass
|
||||
yield FailedUnicode(safe_unicode(e))
|
||||
|
||||
def shutdown(self):
|
||||
'''Shut down all background threads. Must be run only prior to exiting
|
||||
current application.
|
||||
def shutdown(self, set_event=True):
|
||||
'''Shut down all background threads.
|
||||
|
||||
:param bool set_event:
|
||||
Set ``shutdown_event`` and call ``renderer.shutdown`` which should
|
||||
shut down all threads. Set it to False unless you are exiting an
|
||||
application.
|
||||
|
||||
If set to False this does nothing more then resolving reference
|
||||
cycle ``powerline → config_loader → bound methods → powerline`` by
|
||||
unsubscribing from config_loader events.
|
||||
'''
|
||||
if set_event:
|
||||
self.shutdown_event.set()
|
||||
try:
|
||||
self.renderer.shutdown()
|
||||
|
|
Loading…
Reference in New Issue