Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def unserialize(self, val):
CompositeType.unserialize(self, val)
minutes = self.minutes.value
hours = minutes // 60
days = hours // 24
hours -= (days*24)
minutes -= (days*24*60)+(hours*60)
try:
self.value = datetime.datetime(self.year.value, self.month.value, days+1, hours, minutes)
except ValueError:
debug('value error while attempting to construct datetime object')
self.value = None
def unserialize(self, val):
CompositeType.unserialize(self, val)
self.value = datetime.time(self.hour.value, self.minute.value, self.second.value)
def unserialize(self, val):
CompositeType.unserialize(self, val)
self.value = datetime.time(self.hour.value, self.minute.value, self.second.value)
def unserialize(self, val):
CompositeType.unserialize(self, val)
try:
self.value = datetime.date(self.year.value+PLUGWISE_EPOCH, self.month.value, self.day.value)
except ValueError:
debug('value error while attempting to construct DateStr object')
self.value = None