Refactor config loading

Issue #211 resolved
Benjamin Cordes created an issue

in preparation for webUI some refactoring for OptionsJSON.

Comments (7)

  1. Desrever Nu
    • I added some Unit-Tests to load a configuration file. there are a few test cases to add. But basically the Jsonconfig returns a NuBotConfig object. I think we can use that when starting NuBot.

    • some work towards refactoring settings.properties. It's used for several purposes at once, and I'd like to break that down a bit. One is the use of relative paths. If we store the relative path variables as static strings this should work at all times. I think it's better to avoid loadResources.

    • one change I made: system.exit(0) occurs not in utilities, but in NuBot. if criticial errors occur it's better to have that in the control flow of the bot. i.e. parsing files is not critical itself, but it throws an error, which NuBot then exits on. Benjamin Cordes 09:36

    • OptionsJSON is now NuBotOptions. options package has changed: introduction of OptionParse for static arguments more modular functions for parsing JSON into NuBotOptions new class: StandardOptions
  2. Log in to comment