Exemple #1
0
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'])
Exemple #2
0
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]
Exemple #3
0
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'])
Exemple #4
0
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]
Exemple #5
0
def literalNow(): # missing zone
    wrongZone = iso8601.ctime(time.time())
    return Literal(wrongZone, datatype=XS['dateTime'])
Exemple #6
0
def literalNow():  # missing zone
    wrongZone = iso8601.ctime(time.time())
    return Literal(wrongZone, datatype=XS['dateTime'])