Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.
I'm attempting to write a session management feature. The basic idea:
sessionFile = None
print "saving session: %s" % (sessionFile)
sessionFile = notepad.getCurrentFilename()
ext = os.path.splitext(sessionFile)[1:]
if ext == "npp":
files = editor.getText().split("\n")
print "opening session: %s" % (sessionFile)
I'm expecting the shutdown notification to fire when the main window is closed, but it's not happening for some reason.
Any idea why this isn't working?
NOTIFICATION.READY is never sent - that happens just before Python is initialised.
What you need to do is add the script to your startup.py (or import it), and run the ready() directly.
Note that print in a script will write into the current document. Use console.write() to write to the console.
I'm not 100% sure that NOTIFICATION.SHUTDOWN works exactly as it should. Post an update here if this doesn't appear to get called.
This does not appear to be called.