#!/usr/bin/env python
from __future__ import print_function
import sys

from  eTraveler.clientAPI.connection import Connection
from  eTraveler.clientAPI.connection import ETClientAPINoDataException

myConn = Connection('jrb', 'Dev', 
                    debug=True, prodServer=True)
#                    debug=True, prodServer=False, appSuffix='-jrb')
#myConn = Connection('jrb', 'Dev', localServer=True, debug=True)
#myConn = Connection('jrb', 'Raw', prodServer=True)
rsp = {}
try:
    run = '6345D'    #   run = 4248 also works
    print("Calling getRunSummary with run ", run)

    rsp = myConn.getRunSummary(run=run)
    print("Returned dict for run ", run)
    for k in rsp:
        print('Value for key ', k, ' is ', rsp[k])

    sys.exit(0)
except ETClientAPINoDataException as msg:
    print('No data exception: ',msg)
    sys.exit(1)
except Exception as msg:
    print('Operation failed with exception: ')
    print(msg)
    sys.exit(1)

