def isDirty(self, *args): date = self.getSelectedDate() time = self.getSelectedTime() datetime = QDateTime(date, time) if self.mode == "Date": value = datetime.toString("ddd d MMM yyyy") elif self.mode == "Time": value = datetime.toString("hh:mm ap") else: value = datetime.toString("ddd d MMM yyyy 'at' hh:mm ap") self.label.setText("Set as: {}".format(value))
def isDirty(self, *args): date = self.getSelectedDate() time = self.getSelectedTime() datetime = QDateTime(date, time) if self.mode == "Date": value = datetime.toString("ddd d MMM yyyy") elif self.mode == "Time": value = datetime.toString("h:m ap") else: value = datetime.toString("ddd d MMM yyyy 'at' h:m ap") self.label.setText(value)
def add_talk(self): date = self.addTalkWidget.dateEdit.date() startTime = self.addTalkWidget.startTimeEdit.time() datetime = QDateTime(date, startTime) # original "time" is now "startTime" presentation = Presentation( unicode(self.addTalkWidget.titleLineEdit.text()), unicode(self.addTalkWidget.presenterLineEdit.text()), "", # description "", # level unicode(self.addTalkWidget.eventLineEdit.text()), unicode(self.addTalkWidget.roomLineEdit.text()), unicode(datetime.toString()), unicode(self.addTalkWidget.endTimeEdit.text())) # Do not add talks if they are empty strings if (len(presentation.title) == 0): return self.db.insert_presentation(presentation) # cleanup self.addTalkWidget.titleLineEdit.clear() self.addTalkWidget.presenterLineEdit.clear() self.failureModel.select() self.hide_add_talk_widget()
def add_talk(self): date = self.addTalkWidget.dateEdit.date() time = self.addTalkWidget.timeEdit.time() datetime = QDateTime(date, time) presentation = Presentation( unicode(self.addTalkWidget.titleLineEdit.text()), unicode(self.addTalkWidget.presenterLineEdit.text()), "", # description "", # level unicode(self.addTalkWidget.eventLineEdit.text()), unicode(self.addTalkWidget.roomLineEdit.text()), unicode(datetime.toString(Qt.ISODate))) # Do not add talks if they are empty strings if (len(presentation.title) == 0): return self.db.insert_presentation(presentation) # cleanup self.addTalkWidget.titleLineEdit.clear() self.addTalkWidget.presenterLineEdit.clear() self.presentationModel.select() self.hide_add_talk_widget() # If this is launched from the recording app # refresh the talk list if self.recordapp: self.recordapp.load_event_list()
def add_talk(self): date = self.addTalkWidget.dateEdit.date() time = self.addTalkWidget.timeEdit.time() datetime = QDateTime(date, time) presentation = Presentation(unicode(self.addTalkWidget.titleLineEdit.text()), unicode(self.addTalkWidget.presenterLineEdit.text()), "", # description "", # level unicode(self.addTalkWidget.eventLineEdit.text()), unicode(self.addTalkWidget.roomLineEdit.text()), unicode(datetime.toString(Qt.ISODate))) # Do not add talks if they are empty strings if (len(presentation.title) == 0): return self.db.insert_presentation(presentation) # cleanup self.addTalkWidget.titleLineEdit.clear() self.addTalkWidget.presenterLineEdit.clear() self.presentationModel.select() self.hide_add_talk_widget() # If this is launched from the recording app # refresh the talk list if self.recordapp: self.recordapp.load_event_list()
def add_talk(self): date = self.addTalkWidget.dateEdit.date() time = self.addTalkWidget.timeEdit.time() datetime = QDateTime(date, time) presentation = Presentation(unicode(self.addTalkWidget.titleLineEdit.text()), unicode(self.addTalkWidget.presenterLineEdit.text()), "", # description "", # level unicode(self.addTalkWidget.eventLineEdit.text()), unicode(self.addTalkWidget.roomLineEdit.text()), unicode(datetime.toString())) # Do not add talks if they are empty strings if (len(presentation.title) == 0): return self.db.insert_presentation(presentation) # cleanup self.addTalkWidget.titleLineEdit.clear() self.addTalkWidget.presenterLineEdit.clear() self.failureModel.select() self.hide_add_talk_widget()
def __init__(self, date): if date: d = QDateTime(QDate(0, 0, 0)) d.setTime_t(int(date)) EdwCell.__init__(self, d.toString("yyyy-MM-dd hh:mm")) else: EdwCell.__init__(self, tr("Never"))
def __convertXData(self, data): loc = QLocale() out = [] for polozka in data: time = QDateTime() time.setTime_t(polozka) out.append(time.toString(loc.dateFormat(QLocale.ShortFormat))) return out
class DateLabel(QLabel): def __init__(self, text, parent, date_format): self.date_format = date_format self.t = QDateTime() super(DateLabel, self).__init__(text=text, parent=parent) def setValue(self, unixtimestampe): """Set the text with a value from a unix timestamp""" self.t.setTime_t(unixtimestampe) super(DateLabel, self).setText(self.t.toString(self.date_format))
def tickStringsDate(self, values, scale, spacing): """Return HH:mm:ss strings from unixtime values""" # FIXME Change date format depending of min max value # FIXME Make better date locator out = [] for value in values: t = QDateTime() t.setTime_t(value) out.append(t.toString('HH:mm:ss')) return out
class JRodosModelOutputConfig(ProviderConfig): def __init__(self): ProviderConfig.__init__(self) self.url = 'http://localhost:8080/geoserver/wps' #self.url = 'http://172.19.115.90:8080/geoserver/wps' self.wps_id = 'gs:JRodosGeopkgWPS' # gs:JRodosWPS = one zipped shapefile, gs:JRodosGeopkgWPS = one GeoPackage self.user = '******' self.password = '******' # taskArg parameter: self.jrodos_project = "'wps-test-3'" # dataitem parameter: self.jrodos_path = "'Model data=;=Output=;=Prognostic Results=;=Potential doses=;=Total potential dose=;=effective'" # jrodos_path= "'Model data=;=Output=;=Prognostic Results=;=Cloud arrival time=;=Cloud arrival time'" # 1 # jrodos_path = "'Model data=;=Output=;=Prognostic Results=;=Activity concentrations=;=Air concentration, time integrated near ground surface=;=I -135'" # 24 # jrodos_path = "'Model data=;=Output=;=Prognostic Results=;=Activity concentrations=;=Air concentration, time integrated near ground surface=;=Cs-137'" # 24 # jrodos_path = "'Model data=;=Output=;=Prognostic Results=;=Activity concentrations=;=Ground contamination dry+wet=;=I -135'" # 24 # jrodos_path = "'Model data=;=Output=;=Prognostic Results=;=Activity concentrations=;=Ground contamination dry+wet=;=Cs-137'" # 24 # jrodos_path = "'Model data=;=Output=;=Prognostic Results=;=Potential doses=;=Total potential dose=;=effective'" # this 3 props define the column parameter self.jrodos_datetime_start = QDateTime(QDate(2016, 05, 17), QTime(6, 0)) self.jrodos_model_time = -1 # IN MINUTES ! self.jrodos_model_step = 3600 # IN SECONDS ! self.jrodos_columns = 0 # starting at 0, but can also be a range: '0,' '0-23', '0-' # vertical parameter: self.jrodos_verticals = 0 # z / layers # actual output format for WPS self.jrodos_format = "application/zip" # format = "application/zip" "text/xml; subtype=wfs-collection/1.0" self.jrodos_datetime_start = QDateTime(QDate(2016, 05, 17), QTime(6, 0)) self.jrodos_datetime_format = "yyyy-MM-ddTHH:mm:ss.000 00:00" # '2016-04-25T08:00:00.000+00:00' self.timestamp = datetime.now().strftime("%Y%m%d%H%M%f") self.units = '' def __str__(self): return u"""WPS settings:\n WPS id: {}\n WPS url: {}\n outputdir: {}\n user: {}\n password: {}\n project: {}\n path: {}\n format: {}\n modeltime(minutes): {} ({} hours)\n step(seconds): {} ({} minutes)\n columns: {}\n verticals: {}\n format: {}\n start : {}\n units : {} """.format(self.wps_id, self.url, self.output_dir, self.user, self.password, self.jrodos_project, self.jrodos_path, self.jrodos_format, self.jrodos_model_time, self.jrodos_model_time/60, self.jrodos_model_step, self.jrodos_model_step/60, self.jrodos_columns, self.jrodos_verticals, self.jrodos_datetime_format, self.jrodos_datetime_start.toString(self.jrodos_datetime_format), self.units) @property def output_dir(self): return Utils.jrodos_dirname(self.jrodos_project, self.jrodos_path, self.timestamp)
class LogResultRow(): def __init__(self, logFeature, featureLayer, pkeyName, geomColumn): self.featureLayer = featureLayer self.fields = featureLayer.dataProvider().fields() self.logFeature = QgsFeature(logFeature) self.geomColumn = geomColumn self.date = QDateTime().fromString(logFeature["action_tstamp_clk"], Qt.ISODate) print logFeature[ "action_tstamp_clk"], self.date, self.date.toMSecsSinceEpoch() self.dateMs = self.date.toMSecsSinceEpoch() self.logData = self.logFeature["row_data"] self.layerFeatureId = int(self.getFieldValue(self.logData, pkeyName)) def getFieldValue(self, data, fieldName): if data is None: return None p = fieldRe(fieldName).search(data) if p: value = "" data = data[p.end():] p = dataReWithQuote.match(data) if p: value = data[p.start() + 1:p.end() - 1] else: p = dataReWithoutQuote.match(data) if p: value = data[p.start():p.end() - 1] else: p = dataReWithoutQuoteEndOfString.match(data) if p: value = data[p.start():p.end()] return value return None def dateStr(self): return self.date.toString("ddd dd MMM yyyy hh:mm") def user(self): return self.logFeature["session_user_name"] def action(self): action = self.logFeature["action"] if action == "I": #return u"\u002B" # plus sign return "insert" if action == "U": #return u"\u2713" # check sign return "update" if action == "D": #return u"\u2A2F" # cross sign return "delete" raise NameError("Invalid action %s" % action) def application(self): return self.logFeature["application_name"] def clientIP(self): return self.logFeature["client_addr"] def clientPort(self): return self.logFeature["client_port"] def changedFields(self): data = self.logFeature["changed_fields"] columns = "" for field in self.fields: if self.getFieldValue(data, field.name()) is not None: columns += field.name() + ", " return columns[:-2] def changedGeometry(self): data = self.logFeature["changed_fields"] geometry = self.getFieldValue(data, self.geomColumn) return geometry is not None def changedGeometryStr(self): if self.changedGeometry(): return u"\u2713" # i.e. check sign else: return "" def geometry(self): if self.geomColumn is None: return QgsGeometry() ewkb = "%s" % self.getFieldValue(self.logData, self.geomColumn) return geometryTools.ewkb2gqgis(ewkb) def data(self): out = dict() for field in self.fields: out[field.name()] = self.getFieldValue(self.logData, field.name()) return out def getLayerFeature(self): layerFeature = QgsFeature() featReq = QgsFeatureRequest().setFilterFid(self.layerFeatureId) if not self.featureLayer.hasGeometryType(): featReq.setFlags(QgsFeatureRequest.NoGeometry) if self.featureLayer.getFeatures(featReq).nextFeature(layerFeature): return layerFeature else: return None def restoreFeature(self): if not self.featureLayer.isEditable(): return False currentFeature = self.getLayerFeature() editBuffer = self.featureLayer.editBuffer() if currentFeature is not None: fid = currentFeature.id() for idx, field in enumerate(self.fields): value = self.getFieldValue(self.logData, field.name()) editBuffer.changeAttributeValue(fid, idx, value) if self.featureLayer.hasGeometryType(): editBuffer.changeGeometry(fid, self.geometry()) else: newFeature = QgsFeature() newFeature.setFields(self.fields) newFeature.initAttributes(self.fields.size()) for field in self.fields: value = self.getFieldValue(self.logData, field.name()) newFeature[field.name()] = QVariant(value) if self.featureLayer.hasGeometryType(): newFeature.setGeometry(self.geometry()) editBuffer.addFeature(newFeature)
def isDirty(self, *args): date = self.getSelectedDate() time = self.getSelectedTime() datetime = QDateTime(date, time) value = datetime.toString("ddd d MMM yyyy 'at' h:m ap") self.ui.label.setText(value)
class LogResultRow(): def __init__(self, logFeature, featureLayer, pkeyName, geomColumn): self.featureLayer = featureLayer self.fields = featureLayer.dataProvider().fields() self.logFeature = QgsFeature(logFeature) self.geomColumn = geomColumn self.date = QDateTime().fromString(logFeature["action_tstamp_clk"], Qt.ISODate) print logFeature["action_tstamp_clk"], self.date, self.date.toMSecsSinceEpoch() self.dateMs = self.date.toMSecsSinceEpoch() self.logData = self.logFeature["row_data"] self.layerFeatureId = int(self.getFieldValue(self.logData, pkeyName)) def getFieldValue(self, data, fieldName): if data is None: return None p = fieldRe(fieldName).search(data) if p: value = "" data = data[p.end():] p = dataReWithQuote.match(data) if p: value = data[p.start()+1:p.end()-1] else: p = dataReWithoutQuote.match(data) if p: value = data[p.start():p.end()-1] else: p = dataReWithoutQuoteEndOfString.match(data) if p: value = data[p.start():p.end()] return value return None def dateStr(self): return self.date.toString("ddd dd MMM yyyy hh:mm") def user(self): return self.logFeature["user_name"] def action(self): action = self.logFeature["action"] if action == "I": #return u"\u002B" # plus sign return "insert" if action == "U": #return u"\u2713" # check sign return "update" if action == "D": #return u"\u2A2F" # cross sign return "delete" raise NameError("Invalid action %s" % action) def clientIP(self): return self.logFeature["addr"] def changedFields(self): data = self.logFeature["changed_fields"] columns = "" for field in self.fields: if self.getFieldValue(data, field.name()) is not None: columns += field.name() + ", " return columns[:-2] def changedGeometry(self): data = self.logFeature["changed_fields"] geometry = self.getFieldValue(data, self.geomColumn) return geometry is not None def changedGeometryStr(self): if self.changedGeometry(): return u"\u2713" # i.e. check sign else: return "" def geometry(self): if self.geomColumn is None: return QgsGeometry() ewkb = "%s" % self.getFieldValue(self.logData, self.geomColumn) return geometryTools.ewkb2gqgis(ewkb) def data(self): out = dict() for field in self.fields: out[field.name()] = self.getFieldValue(self.logData, field.name()) return out def getLayerFeature(self): layerFeature = QgsFeature() featReq = QgsFeatureRequest().setFilterFid(self.layerFeatureId) if not self.featureLayer.hasGeometryType(): featReq.setFlags(QgsFeatureRequest.NoGeometry) if self.featureLayer.getFeatures(featReq).nextFeature(layerFeature): return layerFeature else: return None def restoreFeature(self): if not self.featureLayer.isEditable(): return False currentFeature = self.getLayerFeature() editBuffer = self.featureLayer.editBuffer() if currentFeature is not None: fid = currentFeature.id() for idx, field in enumerate(self.fields): value = self.getFieldValue(self.logData, field.name()) editBuffer.changeAttributeValue(fid, idx, value) if self.featureLayer.hasGeometryType(): editBuffer.changeGeometry(fid, self.geometry()) else: newFeature = QgsFeature() newFeature.setFields(self.fields) newFeature.initAttributes(self.fields.size()) for field in self.fields: value = self.getFieldValue(self.logData, field.name()) newFeature[field.name()] = value if self.featureLayer.hasGeometryType(): newFeature.setGeometry(self.geometry()) editBuffer.addFeature(newFeature)
class QASession(QARecord): def __init__(self): QARecord.__init__() self.Type = QARecordType.Session self.NULLDATE = QDateTime(QDate(2222, 2, 22), QTime(22, 22, 22, 22)) self.dwgCreated = QDateTime() self.dwgSaved = QDateTime() self.dwgFileName = None self.dwgSizeOpened = 0 self.dwgSizeClosed = 0 self.tagName = None self.tagProject = None self.tagReason = None self.tagSection = None self.sessionType = None self.qaLastSaved = QDateTime() self.closed = QDateTime() self.correlation = None self.corrupted = None def method_6(self, stringBuilder_0, string_0, bool_0, bool_1): if (bool_0): QARecord.smethod_0(self.title, stringBuilder_0) self.HtmlBody(stringBuilder_0, string_0) if (bool_1): QARecord.smethod_1(stringBuilder_0) def method_9(self, stringBuilder_0, string_0): if (not String.IsNullOrEmpty(string_0)): stringBuilder_0.Append("\n{0}\n\n".format(string_0)) stringBuilder_0.AppendLine(self.Text) def method_10(self, object_0, object_1, string_0): self.WordDocumentBody(object_0, object_1, string_0) QARecord.method_10(object_0, object_1, string_0) def method_12(self, string_0, string_1): return "<tr><td><b>{0}</b></td><td>{1}</td></tr>".format( string_0, string_1) def method_13(self, string_0, string_1, string_2): if (String.IsNullOrEmpty(string_2)): return self.method_12(string_0, string_1) return "<tr><td {0}><b>{1}</b></td><td {2}>{3}</td></tr>".format( string_2, string_0, string_2, string_1) def method_14(self, binaryReader_0, qafileVersion_0): #TODO: UnCompleted pass # switch (qafileVersion_0) # { # case QAFileVersion.V8: # case QAFileVersion.V8_1: # { # base.Stamp = DateTime.FromOADate(binaryReader_0.ReadDouble()); # this.dwgCreated = DateTime.FromOADate(binaryReader_0.ReadDouble()); # this.dwgSaved = DateTime.FromOADate(binaryReader_0.ReadDouble()); # this.dwgFileName = Encoding.Default.GetString(binaryReader_0.ReadBytes(binaryReader_0.ReadInt32())); # this.dwgSizeOpened = binaryReader_0.ReadDouble(); # this.dwgSizeClosed = binaryReader_0.ReadDouble(); # this.tagName = Encoding.Default.GetString(binaryReader_0.ReadBytes(binaryReader_0.ReadInt32())); # this.tagProject = Encoding.Default.GetString(binaryReader_0.ReadBytes(binaryReader_0.ReadInt32())); # this.tagReason = Encoding.Default.GetString(binaryReader_0.ReadBytes(binaryReader_0.ReadInt32())); # this.tagSection = Encoding.Default.GetString(binaryReader_0.ReadBytes(binaryReader_0.ReadInt32())); # this.sessionType = (QASessionType)binaryReader_0.ReadByte(); # this.qaLastSaved = DateTime.FromOADate(binaryReader_0.ReadDouble()); # this.closed = DateTime.FromOADate(binaryReader_0.ReadDouble()); # this.correlation = binaryReader_0.ReadBoolean(); # break; # } # case QAFileVersion.V10: # { # base.Stamp = DateTime.FromBinary(binaryReader_0.ReadInt64()); # this.dwgCreated = DateTime.FromBinary(binaryReader_0.ReadInt64()); # this.dwgSaved = DateTime.FromBinary(binaryReader_0.ReadInt64()); # this.dwgFileName = Encoding.Unicode.GetString(binaryReader_0.ReadBytes(binaryReader_0.ReadInt32())); # this.dwgSizeOpened = binaryReader_0.ReadDouble(); # this.dwgSizeClosed = binaryReader_0.ReadDouble(); # this.tagName = Encoding.Unicode.GetString(binaryReader_0.ReadBytes(binaryReader_0.ReadInt32())); # this.tagProject = Encoding.Unicode.GetString(binaryReader_0.ReadBytes(binaryReader_0.ReadInt32())); # this.tagReason = Encoding.Unicode.GetString(binaryReader_0.ReadBytes(binaryReader_0.ReadInt32())); # this.tagSection = Encoding.Unicode.GetString(binaryReader_0.ReadBytes(binaryReader_0.ReadInt32())); # this.sessionType = (QASessionType)binaryReader_0.ReadByte(); # this.qaLastSaved = DateTime.FromBinary(binaryReader_0.ReadInt64()); # this.closed = DateTime.FromBinary(binaryReader_0.ReadInt64()); # this.correlation = binaryReader_0.ReadBoolean(); # break; # } # default: # { # throw new NotSupportedException(); # } # } # if (QADocument.ProgressUpdate != null) # { # QADocument.ProgressUpdate((int)(binaryReader_0.BaseStream.Position * (long)100 / binaryReader_0.BaseStream.Length)); # } # int num = binaryReader_0.ReadInt32(); # for (int i = 0; i < num; i++) # { # base.Children.Add(QARecord.smethod_2(binaryReader_0, qafileVersion_0)); # } def WordDocumentBody(self, wordApp, wordDoc, title): raise SystemError def HtmlBody(self, lines, title): lines.AppendLine("<div align=\"center\">") lines.AppendLine( "<table border=\"0\" cellpadding=\"2\" cellspacing=\"0\">") lines.AppendLine("<tbody>") if (self.sessionType == QASessionType.Started): lines.AppendLine(self.method_12(Captions.PROJECT, self.tagProject)) lines.AppendLine(self.method_12(Captions.NAME, self.tagName)) lines.AppendLine(self.method_12(Captions.SECTION, self.tagSection)) lines.AppendLine(self.method_12(Captions.REASON, self.tagReason)) lines.AppendLine(self.method_12(Captions.DWG_NAME, self.dwgFileName)) if (not self.dwgCreated.toString() == self.NULLDATE.toString()): lines.AppendLine( self.method_12(Captions.DWG_CREATED, Extensions.smethod_19(self.dwgCreated))) if (not self.dwgSaved.toString() == self.NULLDATE.toString()): lines.AppendLine( self.method_12(Captions.DWG_LAST_SAVED, Extensions.smethod_19(self.dwgSaved))) if (self.dwgSizeOpened > 0): if (self.dwgSizeOpened >= 1024): lines.AppendLine( self.method_12( Captions.DWG_SIZE_SESSION_OPENED, "{0:0.###} {1}".format( self.dwgSizeOpened / float(1024), Captions.MB))) else: lines.AppendLine( self.method_12( Captions.DWG_SIZE_SESSION_OPENED, "{0:0.###} {1}".format(self.dwgSizeOpened, Captions.KB))) if (self.dwgSizeClosed > 0): if (self.dwgSizeClosed >= 1024): lines.AppendLine( self.method_12( Captions.DWG_SIZE_SESSION_SAVED, "{0:0.###} {1}".format( self.dwgSizeClosed / float(1024), Captions.MB))) else: lines.AppendLine( self.method_12( Captions.DWG_SIZE_SESSION_SAVED, "{0:0.###} {1}".format(self.dwgSizeClosed, Captions.KB))) if (not self.qaLastSaved.toString() == self.NULLDATE.toString()): lines.AppendLine( self.method_12(Captions.QA_LAST_SAVED, Extensions.smethod_19(self.qaLastSaved))) if (not self.correlation): lines.AppendLine( self.method_13(Captions.WARNING, Captions.NO_CORRELATION, "style=\"color: rgb(255, 0, 0);\"")) if (self.corrupted): lines.AppendLine( self.method_13(Captions.WARNING, Captions.POSSIBLE_QA_FILE_CORRUPTION, "style=\"color: rgb(255, 0, 0);\"")) lines.AppendLine("</tbody>") lines.AppendLine("</table>") lines.AppendLine("</div>") def getClosed(self): return self.closed def setClosed(self, val): self.closed = val Closed = property(getClosed, setClosed, None, None) def getCorrelation(self): return self.correlation def setCorrelation(self, val): self.correlation = val Correlation = property(getCorrelation, setCorrelation, None, None) def getCorrupted(self): return self.corrupted def setCorrupted(self, val): self.corrupted = val Corrupted = property(getCorrupted, setCorrupted, None, None) def getDwgCreated(self): return self.dwgCreated def setDwgCreated(self, val): self.dwgCreated = val DwgCreated = property(getDwgCreated, setDwgCreated, None, None) def getDwgFileName(self): return self.dwgFileName def setDwgFileName(self, val): self.dwgFileName = val DwgFileName = property(getDwgFileName, setDwgFileName, None, None) def getDwgSaved(self): return self.dwgSaved def setDwgSaved(self, val): self.dwgSaved = val DwgSaved = property(getDwgSaved, setDwgSaved, None, None) def getDwgSizeClosed(self): return self.dwgSizeClosed def setDwgSizeClosed(self, val): self.dwgSizeClosed = val DwgSizeClosed = property(getDwgSizeClosed, setDwgSizeClosed, None, None) def getDwgSizeOpened(self): return self.dwgSizeOpened def setDwgSizeOpened(self, val): self.dwgSizeOpened = val DwgSizeOpened = property(getDwgSizeOpened, setDwgSizeOpened, None, None) def getQaLastSaved(self): return self.qaLastSaved def setQaLastSaved(self, val): self.qaLastSaved = val QaLastSaved = property(getQaLastSaved, setQaLastSaved, None, None) def getSessionType(self): return self.sessionType def setSessionType(self, val): self.sessionType = val SessionType = property(getSessionType, setSessionType, None, None) def getTagName(self): return self.tagName def setTagName(self, val): self.tagName = val TagName = property(getTagName, setTagName, None, None) def getTagProject(self): return self.tagProject def setTagProject(self, val): self.tagProject = val TagProject = property(getTagProject, setTagProject, None, None) def getTagReason(self): return self.tagReason def setTagReason(self, val): self.tagReason = val TagReason = property(getTagReason, setTagReason, None, None) def getTagSection(self): return self.tagSection def setTagSection(self, val): self.tagSection = val TagSection = property(getTagSection, setTagSection, None, None) def getText(self): stringBuilder = StringBuilder() if (self.sessionType == QASessionType.Started): stringBuilder.AppendLine("{0}\t{1}".format(Captions.PROJECT, self.tagProject)) stringBuilder.AppendLine("{0}\t{1}".format(Captions.NAME, self.tagName)) stringBuilder.AppendLine("{0}\t{1}".format(Captions.SECTION, self.tagSection)) stringBuilder.AppendLine("{0}\t{1}".format(Captions.REASON, self.tagReason)) stringBuilder.AppendLine("{0}\t{1}".format(Captions.DWG_NAME, self.dwgFileName)) if (not self.dwgCreated.toString() == self.NULLDATE.toString()): stringBuilder.AppendLine("{0}\t{1}".format( Captions.DWG_CREATED, Extensions.smethod_19(self.dwgCreated))) if (not self.dwgSaved.toString() == self.NULLDATE.toString()): stringBuilder.AppendLine("{0}\t{1}".format( Captions.DWG_LAST_SAVED, Extensions.smethod_19(self.dwgSaved))) if (self.dwgSizeOpened > 0): if (self.dwgSizeOpened >= 1024): stringBuilder.AppendLine("{0}\t{1}".format( Captions.DWG_SIZE_SESSION_OPENED, "{0:0.###} {1}".format(self.dwgSizeOpened / float(1024), Captions.MB))) else: stringBuilder.AppendLine("{0}\t{1}".format( Captions.DWG_SIZE_SESSION_OPENED, "{0:0.###} {1}".format(self.dwgSizeOpened, Captions.KB))) if (self.dwgSizeClosed > 0): if (self.dwgSizeClosed >= 1024): stringBuilder.AppendLine("{0}\t{1}".format( Captions.DWG_SIZE_SESSION_SAVED, "{0:0.###} {1}".format(self.dwgSizeClosed / float(1024), Captions.MB))) else: stringBuilder.AppendLine("{0}\t{1}".format( Captions.DWG_SIZE_SESSION_SAVED, "{0:0.###} {1}".format(self.dwgSizeClosed, Captions.KB))) if (not self.qaLastSaved.toString() == self.NULLDATE.toString()): stringBuilder.AppendLine("{0}\t{1}".format( Captions.QA_LAST_SAVED, Extensions.smethod_19(self.qaLastSaved))) if (not self.correlation): stringBuilder.AppendLine("{0}\t{1}".format( Captions.WARNING, Captions.NO_CORRELATION)) if (self.corrupted): stringBuilder.AppendLine("{0}\t{1}".format( Captions.WARNING, Captions.POSSIBLE_QA_FILE_CORRUPTION)) return stringBuilder.ToString() def setText(self, val): raise SystemError Text = property(getText, None, None, None)