
'''
Update EVLA pipeline variables to the current system.
'''


def update_paths(pipe_dict, ms_path, pipepath):

    pipe_dict['ms_active'] = ms_path
    pipe_dict['SDM_name'] = ms_path[:-3] # Cutoff '.ms'
    pipe_dict['pipepath'] = pipepath

    return pipe_dict


if __name__ == '__main__':

    import sys

    pipe_var_file = str(sys.argv[5])

    ms_path = str(sys.argv[6])

    pipepath = str(sys.argv[7])

    import shelve

    pipe_dict = shelve.open(pipe_var_file, writeback=True)

    pipe_dict = update_paths(pipe_dict, ms_path, pipepath)

    pipe_dict.sync()

    pipe_dict.close()


'''
Update EVLA pipeline variables to the current system.
'''


def update_paths(pipe_dict, ms_path, pipepath):

    pipe_dict['ms_active'] = ms_path
    pipe_dict['SDM_name'] = ms_path[:-3] # Cutoff '.ms'
    pipe_dict['pipepath'] = pipepath

    return pipe_dict


if __name__ == '__main__':

    import sys

    pipe_var_file = str(sys.argv[5])

    ms_path = str(sys.argv[6])

    pipepath = str(sys.argv[7])

    import shelve

    pipe_dict = shelve.open(pipe_var_file, writeback=True)

    pipe_dict = update_paths(pipe_dict, ms_path, pipepath)

    pipe_dict.sync()

    print "Checking!"
    print pipe_dict['ms_active']
    print pipe_dict['SDM_name']
    print pipe_dict['pipepath']

    pipe_dict.close()

Print out changed paths in pipeline file