コード例 #1
0
ファイル: setup.py プロジェクト: shreyabasu/IATI-Data-Quality
def setup_common():
    print "Creating DB"
    db.create_all()
    print "Adding hardcoded tests"
    dqimporttests.hardcodedTests()
    print "Importing indicators"
    dqindicators.importIndicatorsFromFile(default_indicator_group_name, default_indicator_filename)
    print "Importing indicator descriptions"
    dqindicators.importIndicatorDescriptionsFromFile(app.config["INDICATOR_GROUP"], "tests/indicators.csv")
    print "Importing tests"
    dqimporttests.importTestsFromFile(default_tests_filename, test_level.ACTIVITY)
    print "Importing codelists"
    dqcodelists.importCodelists()
コード例 #2
0
ファイル: setup.py プロジェクト: andylolz/IATI-Data-Quality
def setup(options):
    setup_common()

    if options.minimal:
        setup_packages_minimal()
    else:
        setup_packages()

    create_aggregation_types(options)
    create_inforesult_types(options)

    # associate with inforesults
    dqindicators.importIndicatorsFromFile(
        default_indicator_group_name,
        default_infotypes_filename, True)

    if options.minimal:
        setup_organisations_minimal()
    else:
        setup_organisations()

    print "Getting organisation frequency"
    dqorganisations.downloadOrganisationFrequency()
    print "Setting up survey"
    iatidq.survey.setup.setupSurvey()
    user = dqusers.addUser({'username': "******",
                            'password': "******"
                          })
    permission = dqusers.addUserPermission({
                            'user_id': user.id,
                            'permission_name': 'admin',
                            'permission_method': 'role'
                          })
    if (user and permission):
        print "Created a default user (admin) and password (CHANGEME). Please remember to change them!"
    else:
        print "Couldn't create a default user and password. Did you supply one in config.py?"
    
    print "Importing all users and creating permissions"
    
    #dqusers.importUserDataFromFile(default_userdata_filename)
    print "Finished importing users"

    print "Setup complete."
コード例 #3
0
ファイル: setup.py プロジェクト: andylolz/IATI-Data-Quality
def setup_common():
    print "Creating DB"
    db.create_all()
    print "Adding hardcoded tests"
    dqimporttests.hardcodedTests()
    print "Importing indicators"
    dqindicators.importIndicatorsFromFile(
        default_indicator_group_name,
        default_indicator_filename)
    print "Importing indicator descriptions"
    dqindicators.importIndicatorDescriptionsFromFile(
        app.config["INDICATOR_GROUP"], 
        "tests/indicators.csv")
    print "Importing tests"
    dqimporttests.importTestsFromFile(
        default_tests_filename,
        test_level.ACTIVITY)
    print "Importing codelists"
    dqcodelists.importCodelists()
    print "Importing basic countries"
    codelist_name='countriesbasic'
    codelist_description='Basic list of countries for running tests against'
    iatidq.dqcodelists.add_manual_codelist(default_basic_countries_filename, codelist_name, codelist_description)