コード例 #1
0
 def load_definitions(interfaces, force_tas_load):
     """Load file definitions."""
     # TODO: introduce flexibility re: test file location
     SchemaLoader.loadFields("appropriations",
                             "../dataactvalidator/config/appropFields.csv")
     SchemaLoader.loadFields(
         "program_activity",
         "../dataactvalidator/config/programActivityFields.csv")
     SchemaLoader.loadFields(
         "award_financial",
         "../dataactvalidator/config/awardFinancialFields.csv")
     SchemaLoader.loadFields("award",
                             "../dataactvalidator/config/awardFields.csv")
     SchemaLoader.loadRules("appropriations",
                            "../dataactvalidator/config/appropRules.csv")
     SchemaLoader.loadRules(
         "program_activity",
         "../dataactvalidator/config/programActivityRules.csv")
     SchemaLoader.loadRules(
         "award_financial",
         "../dataactvalidator/config/awardFinancialRules.csv")
     SchemaLoader.loadCrossRules(
         "../dataactvalidator/config/crossFileRules.csv")
     if (interfaces.validationDb.session.query(TASLookup).count() == 0
             or force_tas_load):
         # TAS table is empty, load it
         loadTas(tasFile="all_tas_betc.csv", dropIdx=False)
コード例 #2
0
def loadValidator():
    """Load validator fields and rules from config."""
    validator_config_path = os.path.join(
    os.path.dirname(dataactvalidator.__file__), "config")
    appropriationsFields = os.path.join(validator_config_path, "appropFields.csv")
    try:
        SchemaLoader.loadFields("appropriations", appropriationsFields)
    except IOError:
        print("Can't open file: {}".format(appropriationsFields))


    appropriationsRules = os.path.join(validator_config_path, "appropRules.csv")
    try:
        SchemaLoader.loadRules("appropriations", appropriationsRules)
    except IOError:
        print("Can't open file: {}".format(appropriationsRules))
コード例 #3
0
def loadValidator():
    """Load validator fields and rules from config."""
    validator_config_path = os.path.join(
        os.path.dirname(dataactvalidator.__file__), "config")
    appropriationsFields = os.path.join(validator_config_path,
                                        "appropFields.csv")
    try:
        SchemaLoader.loadFields("appropriations", appropriationsFields)
    except IOError:
        print("Can't open file: {}".format(appropriationsFields))

    appropriationsRules = os.path.join(validator_config_path,
                                       "appropRules.csv")
    try:
        SchemaLoader.loadRules("appropriations", appropriationsRules)
    except IOError:
        print("Can't open file: {}".format(appropriationsRules))
コード例 #4
0
 def load_definitions(interfaces, force_tas_load):
     """Load file definitions."""
     # TODO: introduce flexibility re: test file location
     SchemaLoader.loadFields("appropriations","../dataactvalidator/config/appropFields.csv")
     SchemaLoader.loadFields("program_activity","../dataactvalidator/config/programActivityFields.csv")
     SchemaLoader.loadFields("award_financial","../dataactvalidator/config/awardFinancialFields.csv")
     SchemaLoader.loadFields("award","../dataactvalidator/config/awardFields.csv")
     SchemaLoader.loadRules("appropriations","../dataactvalidator/config/appropRules.csv")
     SchemaLoader.loadRules("program_activity","../dataactvalidator/config/programActivityRules.csv")
     SchemaLoader.loadRules("award_financial","../dataactvalidator/config/awardFinancialRules.csv")
     SchemaLoader.loadCrossRules("../dataactvalidator/config/crossFileRules.csv")
     if (interfaces.validationDb.session.query(TASLookup).count() == 0
             or force_tas_load):
         # TAS table is empty, load it
         loadTas(tasFile="all_tas_betc.csv", dropIdx=False)
コード例 #5
0
""" This script loads fields and rules for the appropriations file type """
from dataactvalidator.filestreaming.schemaLoader import SchemaLoader

SchemaLoader.loadFields("appropriations", "../tests/appropriationsFields.csv")
SchemaLoader.loadRules("appropriations", "../tests/appropriationsRules.csv")
コード例 #6
0
""" This script loads fields and rules for the appropriations file type """
from dataactvalidator.filestreaming.schemaLoader import SchemaLoader

SchemaLoader.loadFields("appropriations","../tests/appropriationsFields.csv")
SchemaLoader.loadRules("appropriations","../tests/appropriationsRules.csv")