[meld] bin/meld: Add a SIGINT signal handler for convenience (bgo#739719)



commit bfe965e056b67e250645938275252df959b21dad
Author: Kai Willadsen <kai willadsen gmail com>
Date:   Sun Nov 9 08:43:01 2014 +1000

    bin/meld: Add a SIGINT signal handler for convenience (bgo#739719)
    
    This handler does no nice cleanup or anything, but that makes it
    functionally equivalent to Meld 1.8.x in terms of behaviour. We *could*
    add nicer handling to ensure that e.g., VC temp files get cleaned up,
    but that's another problem.

 bin/meld |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
---
diff --git a/bin/meld b/bin/meld
index d25f003..062221c 100755
--- a/bin/meld
+++ b/bin/meld
@@ -21,6 +21,7 @@ from __future__ import print_function
 import locale
 import logging
 import os
+import signal
 import subprocess
 import sys
 
@@ -259,5 +260,6 @@ if __name__ == '__main__':
     setup_resources()
 
     import meld.meldapp
+    signal.signal(signal.SIGINT, lambda *args: meld.meldapp.app.quit())
     status = meld.meldapp.app.run(sys.argv)
     sys.exit(status)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]