git://git.onelab.eu
/
sfa.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
21a641e
)
access dictionary by key instead of getattr
author
Tony Mack
<tmack@cs.princeton.edu>
Thu, 9 Jul 2009 20:40:10 +0000
(20:40 +0000)
committer
Tony Mack
<tmack@cs.princeton.edu>
Thu, 9 Jul 2009 20:40:10 +0000
(20:40 +0000)
sfa/util/record.py
patch
|
blob
|
history
diff --git
a/sfa/util/record.py
b/sfa/util/record.py
index
35b5faa
..
4b01edf
100644
(file)
--- a/
sfa/util/record.py
+++ b/
sfa/util/record.py
@@
-214,7
+214,10
@@
class GeniRecord(dict):
if fieldname == "key":
val = self.get_key()
else:
- val = self[fieldname]
+ try:
+ val = getattr(self, fieldname)
+ except:
+ val = self[fieldname]
if isinstance(val, str):
return "'" + str(val) + "'"
else: