Révision | a6ded9f1f3f9e41fea0a1dd9f8a28fcf55f9761d (tree) |
---|---|
l'heure | 2012-12-24 10:07:31 |
Auteur | Shinya TAKEBAYASHI <omoikanenomikoto@gmai...> |
Commiter | Shinya TAKEBAYASHI |
Implemented Ctrl-C process
@@ -1,6 +1,6 @@ | ||
1 | 1 | #!/usr/bin/env python |
2 | 2 | |
3 | -import sys, os, re | |
3 | +import sys, os, re, signal | |
4 | 4 | from libs import term, config, general |
5 | 5 | |
6 | 6 | include_path = [] |
@@ -59,8 +59,13 @@ def findheader(filename): | ||
59 | 59 | |
60 | 60 | print('') |
61 | 61 | |
62 | +def sigint(num, frame): | |
63 | + print('process interrupted.') | |
64 | + sys.exit(2) | |
62 | 65 | |
63 | 66 | if __name__ == '__main__': |
67 | + signal.signal(signal.SIGINT, sigint) | |
68 | + | |
64 | 69 | if len(sys.argv) == 1: |
65 | 70 | general.print_usage() |
66 | 71 | sys.exit(2) |