#!/usr/bin/env python

"""
Here we'll be creating a central script to accomplish our main goal:
(uploading QC'd fastq data to a library) and we'll add functionality in steps.

Each step will have its own script that includes the number of the step
it accomplishes.

----

Step 1
======
In this case, step_1.py will complete the first step:
    checking if your key works and you can connect.
"""
import os
import sys
import pprint

# you'll see this list of imports grow as we add more functionality in later steps
import users_1

# ----------------------------------------------------------------------------- main
if __name__ == '__main__':
    # exception (or error) handling allows us to try something...
    try:
        #...like getting a list of users...
        users = users_1.get_users()
        
    # ...and, if that causes an exception (an error)...
    except Exception, exc:
        # ...do something (instead of crash the program)
        # We'll change this message later on
        print 'Failed to connect:', str( exc )
        sys.exit( 1 )

    # we successfully got some data about (a) user(s)
    pprint.pprint( users, indent=2 )
