#! /usr/bin/env python

'''
@author: Soizic Laguitton

@organization: I2BM, Neurospin, Gif-sur-Yvette, France
@organization: CATI, France
@organization: U{IFR 49<http://www.ifr49.org>}

@license: U{CeCILL version 2<http://www.cecill.info/licences/Licence_CeCILL_V2-en.html>}
'''


import sys

from soma_workflow.client import WorkflowController, Helper

if __name__ == '__main__':

    if len(sys.argv) != 3:
       raise Exception("The program takes exactly 2 parameter: \n"
                       "    * the workflow file \n"
                       "    * the computing resource id \n")

    workflow = Helper.unserialize(sys.argv[1])

    wfc = WorkflowController(sys.argv[2])

    wfc.submit_workflow(workflow)



