def from_json_text(cls, text, number=None, validate=True): """ Create an incident from JSON text. @param text: JSON text describing an incident. @type text: L{unicode} @param number: The number of the incident. If C{number} is not C{None} and C{text} includes an incident number that is different than C{number}, raise an L{InvalidDataError}. @type number: L{int} @param validate: If true, raise L{InvalidDataError} is the data does not validate as a fully-well-formed incident. @type validate: L{bool} """ root = from_json_text(text) return cls.from_json(root, number, validate)
def from_json_text(cls, text, number=None, validate=True): root = from_json_text(text) return cls.from_json(root, number, validate)
def expressionFromJSONText(jsonText): json = from_json_text(jsonText) return expressionFromJSON(json)