Exemplo n.º 1
0
def setEtag(gevent):
    gevent['etag'] = compressLongInt(abs(hash(repr(gevent))))
Exemplo n.º 2
0
from scal2.ics import *
from scal2.cal_types import to_jd, jd_to, DATE_GREG
from scal2.locale_man import tr as _
from scal2 import core

from scal2 import event_lib
from scal2.event_lib import Account

auth_local_webserver = True
auth_host_name = 'localhost'
auth_host_port = [8080, 8090]

STATUS_UNCHANCHED, STATUS_ADDED, STATUS_DELETED, STATUS_MODIFIED = range(4)

calcEtag = lambda gevent: core.compressLongInt(abs(hash(repr(gevent))))

decodeIcsStartEnd = lambda value: {
    ('dateTime' if 'T' in value else 'date'): value,
    'timeZone': 'GMT',
}


def encodeIcsStartEnd(value):
    timeZone = value.get('timeZone', 'GMT')  ## FIXME
    if 'date' in value:
        icsValue = value['date'].replace('-', '')
    elif 'dateTime' in value:
        icsValue = value['dateTime'].replace('-', '').replace(':', '')
    else:
        raise ValueError('bad gcal start/end value %r' % value)