Strips the given SBML Level 3 package from the given SBML file.
46 """usage: stripPackage.py input-filename package-to-strip output-filename 56 if not os.path.exists(infile):
57 print(
"[Error] %s : No such file." % infile)
62 sbmldoc = reader.readSBML(infile)
64 if sbmldoc.getNumErrors() > 0:
65 if sbmldoc.getError(0).getErrorId() == libsbml.XMLFileUnreadable:
68 elif sbmldoc.getError(0).getErrorId() == libsbml.XMLFileOperationError:
78 props.addOption(
"stripPackage",
True,
"Strip SBML Level 3 package constructs from the model")
79 props.addOption(
"package", package,
"Name of the SBML Level 3 package to be stripped")
80 if sbmldoc.convert(props) != libsbml.LIBSBML_OPERATION_SUCCESS:
81 print(
"[Error] Conversion failed...")
84 writer.writeSBML(sbmldoc, outfile)
85 print(
"[OK] stripped package '%s' from %s to %s" % (package, infile, outfile))
87 if __name__ ==
'__main__':