Beispiel #1
0
def startSession(sessionId, instant):
    "Starts the session"
    data = '{"instant":"' + formatDatetime(instant) + '"}'
    url = SessionsUrl + '/' + str(sessionId) + '/start'
    post(data, url)
    print("Start the session " + str(sessionId))
    return
Beispiel #2
0
def addSession(name, start, end, sessionType):
    "This adds a Session"
    data = '{"type":"' + sessionType + '", "name":"' + name + '", "start":"' + formatDatetime(
        start) + '", "end":"' + formatDatetime(end) + '"}'
    post(data, SessionsUrl)
    print("Session " + name + " added")
    sessionResponse = getSessionByName(name)
    return sessionResponse
Beispiel #3
0
def endSession(sessionId, instant):
    "Ends the session"
    date = formatDatetime(instant)
    data = '{"instant":"' + date + '"}'
    url = SessionsUrl + '/' + str(sessionId) + '/end'
    post(data, url)
    print("End the session " + str(sessionId) + " @ " + date)
    return
Beispiel #4
0
def addPilotToSession(sessionId, pilotId):
    "Associate Session and Chrono"
    url = SessionsUrl + '/' + str(sessionId) + '/addPilot?pilotId=' + str(
        pilotId)
    post('', url)
    print("Associate Session id " + str(sessionId) + " and pilot id " +
          str(pilotId))
    return
Beispiel #5
0
def addChronometerToSession(sessionId, chronoId, index=-1):
    "Associate Session and Chrono"
    url = SessionsUrl + '/' + str(
        sessionId) + '/addChronometer?chronoId=' + str(chronoId)
    if index >= 0:
        url = url + '&index=' + str(index)
    post('', url)
    print("Associate Session id " + str(sessionId) + " and chrono id " +
          str(chronoId))
    return