summaryrefslogtreecommitdiffstats
path: root/gd_diff.py
diff options
context:
space:
mode:
Diffstat (limited to 'gd_diff.py')
-rw-r--r--gd_diff.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/gd_diff.py b/gd_diff.py
index 5f069d1..220f832 100644
--- a/gd_diff.py
+++ b/gd_diff.py
@@ -6,6 +6,7 @@
# gns-deb-diff is under the Public Domain. See
# <https://creativecommons.org/publicdomain/zero/1.0>
+import json
import os
import re
import shlex
@@ -229,6 +230,19 @@ def config_file():
return os.path.join(config_dir(), 'config')
+def read_config_file():
+ """Return config as a Python Object; False when config does not \
+ exist.
+
+ """
+ cf = config_file()
+
+ if not os.path.isfile(cf):
+ return False
+
+ return json.load(open(cf, 'r'))
+
+
def pkgs_dir():
"""Return the `pkgs` directory.