예제 #1
0
def loadTas(tasFile=None, dropIdx=True):
    """ Load all valid TAS combinations into database and index the TASLookup table """

    validatorDb = ValidatorValidationInterface()
    connection = validatorDb.engine.connect()

    # drop indexes
    table = TASLookup.__table__
    indexes = table.indexes
    if dropIdx:
        for i in indexes:
            try:
                i.drop(bind=connection)
            except:
                pass

    # load TAS
    if tasFile:
        filename = tasFile
    else:
        filename = "../config/all_tas_betc.csv"
    try:
       TASLoader.loadFields(filename)
    except IOError:
       print("Can't open file: {}".format(filename))
       raise

    # re-create indexes
    if dropIdx:
        for i in indexes:
            i.create(bind=connection)
예제 #2
0
def loadTas(tasFile=None, dropIdx=True):
    """ Load all valid TAS combinations into database and index the TASLookup table """

    validatorDb = ValidatorValidationInterface()
    connection = validatorDb.engine.connect()

    # drop indexes
    table = TASLookup.__table__
    indexes = table.indexes
    if dropIdx:
        for i in indexes:
            try:
                i.drop(bind=connection)
            except:
                pass

    # load TAS
    if tasFile:
        filename = tasFile
    else:
        filename = "../config/all_tas_betc.csv"
    try:
        TASLoader.loadFields(filename)
    except IOError:
        print("Can't open file: {}".format(filename))
        raise

    # re-create indexes
    if dropIdx:
        for i in indexes:
            i.create(bind=connection)
예제 #3
0
def loadTAS(filename):
    """ Load TAS combinations from specified file """
    TASLoader.loadFields(filename)
    setupTASIndexs()