Adds a model history to a model.
45 def printStatus(message, status):
47 if status == LIBSBML_OPERATION_SUCCESS:
48 statusString =
"succeeded" 49 elif status == LIBSBML_INVALID_OBJECT:
50 statusString =
"invalid object" 51 elif status == LIBSBML_OPERATION_FAILED:
52 statusString =
"operation failed" 54 statusString =
"unknown" 56 print (message + statusString )
60 """usage: addModelHistory <input-filename> <output-filename> 61 Adds a model history to the model 69 errors = d.getNumErrors()
72 print(
"Read Error(s):" )
74 print(
"Correct the above and re-run." )
79 c.setFamilyName(
"Keating")
80 c.setGivenName(
"Sarah")
81 c.setEmail(
"sbml-team@caltech.edu")
82 c.setOrganization(
"University of Hertfordshire")
84 status = h.addCreator(c)
85 printStatus(
"Status for addCreator: ", status)
87 date = Date(
"1999-11-13T06:54:32")
88 date2 = Date(
"2007-11-30T06:54:00-02:00")
90 status = h.setCreatedDate(date)
91 printStatus(
"Set created date: ", status)
93 status = h.setModifiedDate(date2)
94 printStatus(
"Set modified date: ", status)
96 status = d.getModel().setModelHistory(h)
97 printStatus(
"Set model history: ", status)
103 if __name__ ==
'__main__':