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:
f2b9f9e
)
make dump tolerant of uninitialized records
author
Scott Baker
<bakers@cs.arizona.edu>
Wed, 21 Jan 2009 19:56:09 +0000
(19:56 +0000)
committer
Scott Baker
<bakers@cs.arizona.edu>
Wed, 21 Jan 2009 19:56:09 +0000
(19:56 +0000)
util/record.py
patch
|
blob
|
history
diff --git
a/util/record.py
b/util/record.py
index
50e3e67
..
086723d
100644
(file)
--- a/
util/record.py
+++ b/
util/record.py
@@
-39,10
+39,14
@@
class GeniRecord():
# @param pointer is a pointer to a PLC record
# @param dict if !=None, then fill in this record from the dictionary
# @param pointer is a pointer to a PLC record
# @param dict if !=None, then fill in this record from the dictionary
- def __init__(self, name=None, gid=None, type=None, pointer=None, dict=None):
+ def __init__(self, name=None, gid=None, type=None, pointer=None, dict=None
, string=None
):
self.dirty = True
self.pl_info = None
self.geni_info = None
self.dirty = True
self.pl_info = None
self.geni_info = None
+ self.name = None
+ self.gid = None
+ self.type = None
+ self.pointer = None
if name:
self.set_name(name)
if gid:
if name:
self.set_name(name)
if gid:
@@
-53,6
+57,8
@@
class GeniRecord():
self.set_pointer(pointer)
if dict:
self.load_from_dict(dict)
self.set_pointer(pointer)
if dict:
self.load_from_dict(dict)
+ if string:
+ self.load_from_string(string)
##
# Set the name of the record
##
# Set the name of the record
@@
-258,7
+264,10
@@
class GeniRecord():
print " hrn:", self.name
print " type:", self.type
print " gid:"
print " hrn:", self.name
print " type:", self.type
print " gid:"
- self.get_gid_object().dump(8, dump_parents)
+ if (not self.gid):
+ print " None"
+ else:
+ self.get_gid_object().dump(8, dump_parents)
print " pointer:", self.pointer
print " geni_info:"
print " pointer:", self.pointer
print " geni_info:"