summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoe Robinson <joe@lc8n.com>2020-12-01 11:25:15 +0000
committerJoe Robinson <joe@lc8n.com>2020-12-01 11:25:15 +0000
commit8ec80fddc0b814860af17556c41e361be4d8ea9e (patch)
treee22ecf3038e28517d6f6a6b51fc8009f70c77381
parentf3ef5e6f63baad99f61eef6c6d28eaba335263a9 (diff)
parent0a819ab26d8670dfbfb1c0714d5f911aed7ed5ad (diff)
Merge branch 'fix_add' into 'master'HEADmaster
Fix adding new items See merge request CarpNet/saucypy!2
-rwxr-xr-xsaucypy4
1 files changed, 2 insertions, 2 deletions
diff --git a/saucypy b/saucypy
index 3ed0f9d..1843ade 100755
--- a/saucypy
+++ b/saucypy
@@ -6,7 +6,7 @@ import optparse
import shlex
import sys
-VERSION = "1.0.3"
+VERSION = "1.0.4"
ENTRIES_FILE = "saucypy.json"
@@ -38,13 +38,13 @@ def main():
if options.add:
key, value = options.add
- entries[key] = value
matches = find( key, entries )
if len( matches ) > 1:
exact_match = list(filter( lambda x: x == key, matches))
if exact_match:
print ("There is already an item named " + key)
else:
+ entries[key] = value
json.dump( entries, open( ENTRIES_FILE, "w" ), indent = 4, sort_keys = True )
print (key + ": " + value + " added")
elif options.count: