def literalFromAmtrakTime(date, t): """ date is xs:date Literal t is like '8:53 pm' or '(9:53 pm)' i'm totally omitting the timezone for now """ secs = time.mktime(time.strptime(str(date) + " " + t.strip('()'), "%Y-%m-%d %I:%M %p")) wrongZone = iso8601.ctime(secs) noZone = wrongZone.rsplit('-', 1)[0] return Literal(noZone, datatype=XS['dateTime'])
def dataIn(**kw): now = time.time() if kw['signal'] == 'temps': #print now, sorted(kw['temps'].items()) typed = dict([(k.decode('ascii'), float(v)) for k,v in kw['temps'].items()]) typed[u'time'] = iso8601.ctime(now).decode('ascii') #appendToLog() history[:] = history[-1000:] + [typed]
def literalFromAmtrakTime(date, t): """ date is xs:date Literal t is like '8:53 pm' or '(9:53 pm)' i'm totally omitting the timezone for now """ secs = time.mktime( time.strptime(str(date) + " " + t.strip('()'), "%Y-%m-%d %I:%M %p")) wrongZone = iso8601.ctime(secs) noZone = wrongZone.rsplit('-', 1)[0] return Literal(noZone, datatype=XS['dateTime'])
def dataIn(**kw): now = time.time() if kw['signal'] == 'temps': #print now, sorted(kw['temps'].items()) typed = dict([(k.decode('ascii'), float(v)) for k, v in kw['temps'].items()]) typed[u'time'] = iso8601.ctime(now).decode('ascii') #appendToLog() history[:] = history[-1000:] + [typed]
def literalNow(): # missing zone wrongZone = iso8601.ctime(time.time()) return Literal(wrongZone, datatype=XS['dateTime'])