def GetTestModeData(self): testModeData = None testModeDataFilePath = self.GetTestModeDataFilePath() if File.Exists(testModeDataFilePath): testModeData = json_util.DeserializeToJObject(File.ReadAllText(testModeDataFilePath)) else: testModeData = json_util.JObject() testModeData[TEST_MODE_DATA__SESSION_ID] = None testModeData[TEST_MODE_DATA__REVIT_PROCESS_IDS] = json_util.JArray() return testModeData
def WithTextFileJsonObject(textFilePath, action): result = None try: textFileContents = text_file_util.ReadFromTextFile(textFilePath) jobject = None try: jobject = json_util.DeserializeToJObject(textFileContents) result = action(jobject) except json_util.JSON.JsonReaderException, e: result = None except IOException, e: result = None
def ReadSnapshotDataRevitJournalFilePath(snapshotDataFilePath): text = text_file_util.ReadFromTextFile(snapshotDataFilePath) jobjectSnapshotData = json_util.DeserializeToJObject(text) return jobjectSnapshotData[SNAPSHOT_DATA__REVIT_JOURNAL_FILE].ToObject[str]()