From be8404e101603495976a0164838957a67b71d509 Mon Sep 17 00:00:00 2001 From: Tim Abbott Date: Thu, 18 Oct 2012 10:37:34 -0400 Subject: [PATCH] zephyr_mirror: Read in API keys from a file in your MIT homedir. (imported from commit eb0fcf032b26388da1785d41bd182218559bfd06) --- api/zephyr_mirror.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/api/zephyr_mirror.py b/api/zephyr_mirror.py index f8081f90c3..8f88894015 100755 --- a/api/zephyr_mirror.py +++ b/api/zephyr_mirror.py @@ -53,10 +53,14 @@ parser.add_option('--site', action='store') parser.add_option('--api-key', dest='api_key', - default="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + default=None, action='store') (options, args) = parser.parse_args() +if options.api_key is None: + api_key_file = os.path.join(os.environ["HOME"], "Private", ".humbug-api-key") + options.api_key = file(api_key_file).read().strip() + sys.path.append(".") sys.path.append(os.path.dirname(os.path.dirname(__file__))) import api.common