#@+leo-ver=4
#@+node:@file quit_leo.py
"""A plugin showing how to force Leo to quit."""

from leoPlugins import *
from leoGlobals import *

def forceLeoToQuit(tag,keywords):
	if not app.initing:
		print "forceLeoToQuit",tag
		app.forceShutdown()

if 0: # Force a shutdown during startup.
	print "quitting during startup"
	app.forceShutdown()

if 0: # Force a shutdown at any other time, even "idle" time.

	# Exception: do not call app.forceShutdown in a "start2" hook.

	print __doc__
	registerHandler("idle",forceLeoToQuit)

	__version__ = "1.2"
	plugin_signon(__name__)
#@nonl
#@-node:@file quit_leo.py
#@-leo
