git://git.onelab.eu
/
sfa.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
some odd code was obviously broken, it was using a str variable and then
[sfa.git]
/
clientbin
/
setRecord.py
diff --git
a/clientbin/setRecord.py
b/clientbin/setRecord.py
index
886b801
..
493400c
100755
(executable)
--- a/
clientbin/setRecord.py
+++ b/
clientbin/setRecord.py
@@
-1,4
+1,4
@@
-#!/usr/bin/
python
+#!/usr/bin/
env python3
"""
Updates record objects
"""
Updates record objects
@@
-58,7
+58,7
@@
def replaceDict(newval, recordDict, options):
Replaces field in dict
"""
# Check type of old field matches type of new field
Replaces field in dict
"""
# Check type of old field matches type of new field
- for (key, val) in newval.ite
rite
ms():
+ for (key, val) in newval.items():
recordDict[key] = val
recordDict[key] = val
@@
-66,7
+66,7
@@
def modDict(newval, recordDict, options):
"""
Checks type of existing field, addends new field
"""
"""
Checks type of existing field, addends new field
"""
- for (key, val) in newval.ite
rite
ms():
+ for (key, val) in newval.items():
if (type(recordDict[key]) == list):
if (type(val) == list):
recordDict[key] = recordDict[key] + val
if (type(recordDict[key]) == list):
if (type(val) == list):
recordDict[key] = recordDict[key] + val
@@
-98,7
+98,7
@@
def main():
if args:
editDict(args, record_dict, options)
if options.DEBUG:
if args:
editDict(args, record_dict, options)
if options.DEBUG:
- print
"New Record:\n%s" % record_dict
+ print
("New Record:\n%s" % record_dict)
record.parse_dict(record_dict)
s = record.toxml()
record.parse_dict(record_dict)
s = record.toxml()
@@
-108,4
+108,4
@@
if __name__ == '__main__':
try:
main()
except Exception as e:
try:
main()
except Exception as e:
- print
e
+ print
(e)