def __unicode__(self): return u"{1} event \"{0}\" at {2}".format( self.Description, unicode(self.EventClass) if self.EventClass is not None else u"raw", TimeUtils.fromTimestamp(self.StartTime).strftime( Formatting.priyomdate))
def appendDateElement(parentNode, name, value, useNamespace=namespace): date = TimeUtils.fromTimestamp(value) node = appendTextElement(parentNode, name, date.strftime(Formatting.priyomdate), useNamespace=useNamespace) node.set(u"unix", unicode(value)) return node
def priyom_timestamp(s): if allowNone and (((type(s) == str or type(s) == unicode) and (len(s) == 0 or s.lower() == "none")) or s is None): return None if type(s) == int or type(s) == float: if asDate: return TimeUtils.fromTimestamp(s) else: return s if asDate: return datetime.strptime(s, Formatting.priyomdate) else: return TimeUtils.toTimestamp(datetime.strptime(s, Formatting.priyomdate))
def timestamp(value): return TimeUtils.fromTimestamp(value).strftime(priyomdate)
def __unicode__(self): return u"{1} event \"{0}\" at {2}".format( self.Description, unicode(self.EventClass) if self.EventClass is not None else u"raw", TimeUtils.fromTimestamp(self.StartTime).strftime(Formatting.priyomdate) )
def toTableRow(self, tr): HTMLIntf.SubElement(tr, u"td").text = TimeUtils.fromTimestamp( self.Timestamp).strftime(priyomdate) HTMLIntf.SubElement(tr, u"th").text = self.Title HTMLIntf.SubElement(HTMLIntf.SubElement(tr, u"td"), u"p").text = self.Contents
def toTableRow(self, tr): HTMLIntf.SubElement(tr, u"td").text = TimeUtils.fromTimestamp(self.Timestamp).strftime(priyomdate) HTMLIntf.SubElement(tr, u"th").text = self.Title HTMLIntf.SubElement(HTMLIntf.SubElement(tr, u"td"), u"p").text = self.Contents