Example #1
0
                                                  into the db""")
    parser.add_argument("--get", dest="get", help="""This option is used to
    obtain data of the db, you have to pass the filename""")
    parser.add_argument("--get-lineal-r", dest="get_lineal", help="""This
    option is used to obtain the values of lineal regression of the db,
    you have to pass the filename""")
    parser.add_argument("--put", dest="put", help="""This is for dump values
    into the db, you have to pass the filename or a path""")
    args = parser.parse_args()

    myDB = Repositorio(MYDB)
    if args.get:
        if path.isfile(args.get):
            #its a file not just a part of the name
            values = myDB.get_original_data(args.get)
            x_processed_values, y_processed_values = myDB.get_processed_data(args.get)
            print x_values, y_values
        else:
            #its a RE
            descriptions = myDB.get_filenames_with_re(args.get)
            x_values = []; y_values = []
            x_total_proc_values = []; y_total_proc_values = []

            for d in descriptions:
                values = myDB.get_original_data(d)
                x_values += values[0]
                y_values += values[1]

                xps, yps = myDB.get_processed_data(d)
                x_total_proc_values += xps
                y_total_proc_values += yps