LazyLibrarian/example_custom_notification.py

25 lines
616 B
Python
Raw Permalink Normal View History

2017-03-16 16:27:34 +00:00
#!/usr/bin/python
# NOTE make sure the above path to python is correct for your environment
2017-03-16 16:27:34 +00:00
# The parameter list passed is a list of database columns (name and data)
# for a book or magazine. Read them back into a dictionary.
# For this example, just return the formatted dictionary
2017-03-16 16:27:34 +00:00
import sys
mydict = {}
2017-03-16 16:27:34 +00:00
try:
args = sys.argv[1:]
while len(args) > 1:
mydict[args[0]] = args[1]
args = args[2:]
except Exception as err:
sys.stderr.write("%s\n" % err)
exit(1)
res = ''
for item in mydict:
# column name: value
res = res + "%s: %s\n" % (item, mydict[item])
2017-03-16 16:27:34 +00:00
print(res)
exit(0)