Beispiel #1
0
 def convertPythonValueToPromptoValue(self, context, value, returnType):
     if isinstance(value, datetime):
         from prompto.value.DateTimeValue import DateTimeValue
         return DateTimeValue(value)
     else:
         return super().convertPythonValueToPromptoValue(
             context, value, returnType)  # TODO for now
Beispiel #2
0
 def plusTime(self, time):
     dt = datetime(self.value.year, self.value.month, self.value.day,
                   time.value.hour, time.value.minute, time.value.second,
                   time.value.microsecond // 1000)
     from prompto.value.DateTimeValue import DateTimeValue
     return DateTimeValue(dt)
Beispiel #3
0
 def __init__(self, text):
     dt = DateTimeValue.Parse(text[1:-1])
     super(DateTimeLiteral, self).__init__(text, dt)