Skip to content
Snippets Groups Projects

Python-based configuration system (closes #43)

Merged André Anjos requested to merge config into master

This push provides a basic configuration system for Bob, python-based.

Edited by André Anjos

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • @andre.anjos two things:

    1- the tests are failing.

    2- After a lot of work with these configurations, I have always wanted to merge several configs into one bigger config. Let me explain: I would like to have a couple of configurations like this:

    $ cat config_replay.py
    database = 'replay'
    $ cat config_replaymobile.py
    database = 'replay-mobile'
    $ cat config_databases.py
    database.original_extension = '.hdf5'

    And then the following commands:

    $ command_line config_replay.py config_databases.py
    $ command_line config_replaymobile.py config_databases.py

    I know with jgen I can make the database variable a template and generate two configurations but I think having the ability to share variables between config files is far more powerful and allows for more modular creation of config files.

    Here is another example:

    # config_algorithm.py
    algorithm = 'isv'
    sub_directory = 'isv'
    # config_database1.py
    database = 'atnt'
    # config_database2.py
    database = 'mobio'
    sub_directory += '-male'

    Then I would have:

    $ verify.py config_algorithm.py config_database1.py
    $ verify.py config_algorithm.py config_database2.py

    Is this possible/implemented?

  • André Anjos added 1 commit

    added 1 commit

    • d663af81 - Simplifies configuration system

    Compare with previous version

  • @amohammadi: with the latest commits, the way you want to use the config system will work out of the box. Read the docs for explanations.

  • Builds are now green. There are 25 lines of code implementing the whole functionality.

  • André Anjos unmarked as a Work In Progress

    unmarked as a Work In Progress

  • André Anjos
  • André Anjos marked as a Work In Progress

    marked as a Work In Progress

  • Amir MOHAMMADI
  • I wonder this model of configrc can be used for environment variables as well. Like BOB_DOCUMENTATION_SERVER.

  • André Anjos added 1 commit

    added 1 commit

    • 14e40137 - Multiple fixes as per discussions on git st

    Compare with previous version

  • Yes. If BOBRC environment is set, it should point to a path where to load the file from.

  • André Anjos added 1 commit

    added 1 commit

    • b03f7421 - Add test unit; Remove six dep

    Compare with previous version

  • @amohammadi: I just added test units.

  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Please register or sign in to reply
    Loading