def GetSessionData(sessionId, sessionStartTime, sessionEndTime, sessionDataFolderPath, sessionError): sessionData = { "sessionStartTime": time_util.GetTimestampObject(sessionStartTime), "sessionEndTime": time_util.GetTimestampObject(sessionEndTime) if sessionEndTime is not None else None, "sessionId": sessionId, "sessionFolder": path_util.ExpandedFullNetworkPath(sessionDataFolderPath), "sessionError": sessionError, "username": environment.GetUserName(), "machineName": environment.GetMachineName(), "gatewayAddresses": network_util.GetGatewayAddresses(), "ipAddresses": network_util.GetIPAddresses() } return sessionData
def GetSnapshotData(sessionId, revitFilePath, snapshotStartTime, snapshotEndTime, snapshotFolderPath, revitJournalFilePath, snapshotError): projectFolderName = path_util.GetProjectFolderNameFromRevitProjectFilePath( revitFilePath) projectModelFolderPath = Path.GetDirectoryName(revitFilePath) modelName = snapshot_data_util.GetRevitModelName(revitFilePath) modelFileLastModified = path_util.GetLastWriteTimeUtc(revitFilePath) modelFileSize = path_util.GetFileSize(revitFilePath) modelRevitVersion = revit_file_util.GetRevitFileVersion(revitFilePath) modelRevitVersionDetails = snapshot_data_util.GetRevitFileVersionDetails( revitFilePath) snapshotData = { "projectFolderName": projectFolderName, "modelFolder": path_util.ExpandedFullNetworkPath(projectModelFolderPath), "modelName": modelName, "modelFileLastModified": (time_util.GetTimestampObject(modelFileLastModified) if modelFileLastModified is not None else None), "modelFileSize": modelFileSize, "modelRevitVersion": modelRevitVersion, "modelRevitVersionDetails": modelRevitVersionDetails, "snapshotStartTime": (time_util.GetTimestampObject(snapshotStartTime) if snapshotStartTime is not None else None), "snapshotEndTime": (time_util.GetTimestampObject(snapshotEndTime) if snapshotEndTime is not None else None), "sessionId": sessionId, "snapshotFolder": path_util.ExpandedFullNetworkPath(snapshotFolderPath), "snapshotError": snapshotError, "username": environment.GetUserName(), "machineName": environment.GetMachineName(), "gatewayAddresses": network_util.GetGatewayAddresses(), "ipAddresses": network_util.GetIPAddresses(), snapshot_data_util.SNAPSHOT_DATA__REVIT_JOURNAL_FILE: revitJournalFilePath } return snapshotData