[aur-general] Handling interruptions
Hi, Added a few lines of code that handles the situation somewhat cleaner if a user presses ctrl-c while namcap is running. Best regards, Alexander Rødseth
--- namcap.py | 19 +++++++++++++++++++ 1 files changed, 19 insertions(+), 0 deletions(-) diff --git a/namcap.py b/namcap.py index cca5dd6..f26cdf7 100755 --- a/namcap.py +++ b/namcap.py @@ -19,6 +19,25 @@ # # +# Try to catch ctrl-c in a cleaner way +try: + import signal + def signal_handler(signal, frame): + print("\nInterrupted") + try: + sys.exit(2) + except NameError: + import sys + sys.exit(2) + signal.signal(signal.SIGINT, signal_handler) +except KeyboardInterrupt: + print("\nInterrupted") + try: + sys.exit(1) + except NameError: + import sys + sys.exit(1) + import getopt import imp import os -- 1.7.8
Am 09.12.2011 11:21, schrieb Alexander Rødseth:
--- namcap.py | 19 +++++++++++++++++++ 1 files changed, 19 insertions(+), 0 deletions(-)
How about actually posting to the right list? https://mailman.archlinux.org/mailman/listinfo/arch-projects
Sorry, wrong list. :P -- Cordially, Alexander Rødseth Arch Linux Trusted User (xyproto on IRC, trontonic on AUR)
To my defence, the wiki also had it wrong: "If you have a patch (fixing a bug or a new namcap module), then you can send it to the arch-general mailing list." https://wiki.archlinux.org/index.php/Namcap#What_is_it.3F - Alexander
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 09/12/11 07:50, Alexander Rødseth wrote:
To my defence, the wiki also had it wrong:
"If you have a patch (fixing a bug or a new namcap module), then you can send it to the arch-general mailing list." https://wiki.archlinux.org/index.php/Namcap#What_is_it.3F
- Alexander
HAHA don't you realize that you're sending this thread to aur-general right? pwned. Glasses are good, you know? ahahaha - -- Angel Velásquez angvp @ irc.freenode.net Arch Linux Developer / Trusted User Linux Counter: #359909 http://www.angvp.com -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iQEcBAEBAgAGBQJO4e3wAAoJEEKh2xXsEzut0JMH/3XVWsR2DSPntqw0yFVxMIzp LlEL5x8tGimvDQparSn6NSMYTv7m1ra4d4bc7tbD5pEWiYoqdlv1KpgZ557LRB2x vZBYP7lHWXwkXFRtSBEdes+92zOn1a6GsAxd4+JSqTmmQHuA94e/aSsDRAFGYU3x BPnWM5m8mBvH7FXNOWf7LQM8UiDg26nglrVEFaLp4CE3d+93sQ+lbfU/PNkoc1vu Z5uLEfi0U3dlKGTWeIlpCKL/QF7kw2A+0NPWV1a1Tss11//zRxnI1o9ZarfcIvAc 7aGRtMYM/Xk3prK8XPzAQBNeI7kbCuZzRpPE1f1w4RkBu+axJpuRyOO5k60ULzY= =XQfj -----END PGP SIGNATURE-----
Hi, 2011/12/9 Angel Velásquez <angvp@archlinux.org>:
HAHA don't you realize that you're sending this thread to aur-general right?
pwned. Glasses are good, you know? ahahaha
I know, I wrote that the wiki "also had it wrong", admitting my mistake. - Alexander
On 9 December 2011 19:27, Alexander Rødseth <rodseth@gmail.com> wrote:
Hi,
2011/12/9 Angel Velásquez <angvp@archlinux.org>:
HAHA don't you realize that you're sending this thread to aur-general right?
pwned. Glasses are good, you know? ahahaha
I know, I wrote that the wiki "also had it wrong", admitting my mistake.
At that time there was no projects mailing list to send patches, and arch-general was this avenue until just recently. So that's not really wrong. Anyway, not a big issue. Send to the correct list again. -- GPG/PGP ID: C0711BF1
participants (4)
-
Alexander Rødseth
-
Angel Velásquez
-
Ray Rashif
-
Thomas Bächler