From 5fe04877836e0c524299355cddf9545093d98e87 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) --- zephyr_mirror.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/zephyr_mirror.py b/zephyr_mirror.py index f8081f9..8f88894 100755 --- a/zephyr_mirror.py +++ b/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