summaryrefslogtreecommitdiffstats
path: root/gd_diff.py
diff options
context:
space:
mode:
authorrsiddharth <s@ricketyspace.net>2016-11-13 01:20:43 +0000
committerrsiddharth <s@ricketyspace.net>2016-11-13 01:20:43 +0000
commite4dd3db7afd52ff7de7acd128195decedf465f23 (patch)
treeafabf19792ed041e5147f2c82f49f1699bed7538 /gd_diff.py
parentba6981811e863e9929db87533a88b8ead52f9369 (diff)
Add `pkgs_dir` function.
* gd_diff.py (pkgs_dir): New function. * tests/test_gd_diff.py (test_pkgs_dir): Test for `pkgs_dir`.
Diffstat (limited to 'gd_diff.py')
-rw-r--r--gd_diff.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/gd_diff.py b/gd_diff.py
index 384e92f..63621a0 100644
--- a/gd_diff.py
+++ b/gd_diff.py
@@ -229,6 +229,18 @@ def config_file():
return os.path.join(config_dir(), 'config')
+def pkgs_dir():
+ """Return the `pkgs` directory.
+
+ As a side effect, the directory is created if it does not exist.
+ """
+ pd = os.path.join(config_dir(), 'pkgs')
+ if not os.path.isdir(pd):
+ os.mkdir(pd)
+
+ return pd
+
+
def configured_p():
"""Returns True if gns-deb-diff is configured; False otherwise.
"""