From 9a69de496a961ed4ad297aa8ad87a2eefae80c49 Mon Sep 17 00:00:00 2001 From: Sverre Rabbelier Date: Tue, 15 Jul 2008 00:10:46 +0200 Subject: [PATCH] gitstats: Allow specifying True, False, or None in the config file This teaches config.py to translate True, False, and None into the actual Python objects. --- src/git_stats/config.py | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/git_stats/config.py b/src/git_stats/config.py index 45ffe36..407628d 100644 --- a/src/git_stats/config.py +++ b/src/git_stats/config.py @@ -5,12 +5,12 @@ import os def read(path="config"): """Reads in the specified file + Understands both 'True', 'False', and 'None'. The file is expected to have the following format: .* [GitStats]\n - key = value - key2 = value2 - + [key = value\n]* + .* Args: @@ -46,6 +46,15 @@ def read(path="config"): key = splitline[0].rstrip() value = splitline[1].lstrip() + if value == "False": + value = False + + if value == "True": + value = True + + if value == "None": + value = None + config[key] = value return config -- 2.11.4.GIT