#!/usr/bin/env python """emano - quitDialogue.py""" def quitDialogue(editor): mods = 0 buflen = len(editor.documents) this = editor.doc.modified() for doc in editor.documents: if doc.modified(): mods += 1 if mods: if mods == 1: if this: msg = 'File modified: ' else: msg = '1 of %s files modified: ' % buflen else: msg = '%s of %s files modified: ' % (mods, buflen) editor.dialogue(msg + 'really quit? [Y/n]: ', editor.menu.quit) else: editor.menu.exit() if __name__=="__main__": print __doc__