From 396861feb19be7f07207b2a478e95729f89dd14a Mon Sep 17 00:00:00 2001 From: Keegan McAllister Date: Mon, 18 Feb 2013 19:00:54 -0500 Subject: [PATCH] Consistently use #!/usr/bin/env python At Ksplice we used /usr/bin/python because we shipped dependencies as Debian / Red Hat packages, which would be installed against the system Python. We were also very careful to use only Python 2.3 features so that even old system Python would still work. None of that is true at Humbug. We expect users to install dependencies themselves, so it's more likely that the Python in $PATH is correct. On OS X in particular, it's common to have five broken Python installs and there's no expectation that /usr/bin/python is the right one. The files which aren't marked executable are not interesting to run as scripts, so we just remove the line there. (In general it's common to have libraries that can also be executed, to run test cases or whatever, but that's not the case here.) (imported from commit 437d4aee2c6e66601ad3334eefd50749cce2eca6) --- bin/humbug-send | 2 +- bots/check-mirroring | 2 +- bots/feedback-bot | 2 +- bots/sync-public-streams | 2 +- bots/zephyr_mirror.py | 2 +- bots/zephyr_mirror_backend.py | 2 +- examples/get-public-streams | 2 +- examples/list-members | 2 +- examples/list-subscriptions | 2 +- examples/print-messages | 2 +- examples/print-next-message | 2 +- examples/send-message | 2 +- examples/subscribe | 2 +- examples/unsubscribe | 2 +- humbug/__init__.py | 1 - integrations/trac/humbug_trac.py | 1 - 16 files changed, 14 insertions(+), 16 deletions(-) diff --git a/bin/humbug-send b/bin/humbug-send index 96d4fb6..dc8d593 100755 --- a/bin/humbug-send +++ b/bin/humbug-send @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python # -*- coding: utf-8 -*- # humbug-send -- Sends a message to the specified recipients. diff --git a/bots/check-mirroring b/bots/check-mirroring index 3485836..23651a3 100755 --- a/bots/check-mirroring +++ b/bots/check-mirroring @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python import sys import time import optparse diff --git a/bots/feedback-bot b/bots/feedback-bot index d7d56f5..2900dd6 100755 --- a/bots/feedback-bot +++ b/bots/feedback-bot @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python import sys from os import path import logging diff --git a/bots/sync-public-streams b/bots/sync-public-streams index 63f0b33..f6d7170 100755 --- a/bots/sync-public-streams +++ b/bots/sync-public-streams @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python import sys from os import path import logging diff --git a/bots/zephyr_mirror.py b/bots/zephyr_mirror.py index ceffbc4..7d35c58 100755 --- a/bots/zephyr_mirror.py +++ b/bots/zephyr_mirror.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python # Copyright (C) 2012 Humbug, Inc. # # Permission is hereby granted, free of charge, to any person diff --git a/bots/zephyr_mirror_backend.py b/bots/zephyr_mirror_backend.py index 76efc0e..b065048 100755 --- a/bots/zephyr_mirror_backend.py +++ b/bots/zephyr_mirror_backend.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python # Copyright (C) 2012 Humbug, Inc. # # Permission is hereby granted, free of charge, to any person diff --git a/examples/get-public-streams b/examples/get-public-streams index 0ea9d16..e3d4d8b 100755 --- a/examples/get-public-streams +++ b/examples/get-public-streams @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright © 2012 Humbug, Inc. diff --git a/examples/list-members b/examples/list-members index 9edb9c2..d0aff93 100755 --- a/examples/list-members +++ b/examples/list-members @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright © 2013 Humbug, Inc. diff --git a/examples/list-subscriptions b/examples/list-subscriptions index c460f5e..d91ab1d 100755 --- a/examples/list-subscriptions +++ b/examples/list-subscriptions @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright © 2012 Humbug, Inc. diff --git a/examples/print-messages b/examples/print-messages index a20dc19..5373af9 100755 --- a/examples/print-messages +++ b/examples/print-messages @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright © 2012 Humbug, Inc. diff --git a/examples/print-next-message b/examples/print-next-message index e0b3294..6d6f601 100755 --- a/examples/print-next-message +++ b/examples/print-next-message @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright © 2012 Humbug, Inc. diff --git a/examples/send-message b/examples/send-message index fadcbe0..12f7005 100755 --- a/examples/send-message +++ b/examples/send-message @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright © 2012 Humbug, Inc. diff --git a/examples/subscribe b/examples/subscribe index a5d7c97..1d2fe9f 100755 --- a/examples/subscribe +++ b/examples/subscribe @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright © 2012 Humbug, Inc. diff --git a/examples/unsubscribe b/examples/unsubscribe index e73be0b..b63a78f 100755 --- a/examples/unsubscribe +++ b/examples/unsubscribe @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright © 2012 Humbug, Inc. diff --git a/humbug/__init__.py b/humbug/__init__.py index 971eecf..3828224 100644 --- a/humbug/__init__.py +++ b/humbug/__init__.py @@ -1,4 +1,3 @@ -#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright © 2012 Humbug, Inc. diff --git a/integrations/trac/humbug_trac.py b/integrations/trac/humbug_trac.py index 099a31d..6cc7394 100644 --- a/integrations/trac/humbug_trac.py +++ b/integrations/trac/humbug_trac.py @@ -1,4 +1,3 @@ -#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright © 2012 Humbug, Inc.