Skip to content
GitLab
  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • yori yori
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 9
    • Issues 9
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 3
    • Merge requests 3
  • Deployments
    • Deployments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • Repository
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • Paolo Veglio
  • yoriyori
  • Merge requests
  • !11

Expand configuration options

  • Review changes

  • Download
  • Email patches
  • Plain diff
Open Ethan Nelson requested to merge yaml-to-dict-option into master Sep 27, 2019
  • Overview 0
  • Commits 1
  • Changes 3

For your consideration....

I am presently importing yori's functions into a script as opposed to calling it from the command line. Though it is possible to write a config file when running the script, I thought defining a dictionary and passing it to the function would be easier--especially if I want to recursively test different configurations.

This MR expands the ConfigReader capability by allowing either a filename, dictionary, or YAML string to be passed as input. Depending on the input, the function either reads the file and parses the YAML, takes the dictionary as-is, or parses the YAML string. In any case, it then passes the resulting objects to the validation as before. Scripts that call the ConfigReader have been modified to accommodate these changes as well.

I'm not sure if this is desired in the codebase, and if it is, whether this strategy is preferred.

Regarding testing, I ran py.test locally and it worked. I also ran the scripts I was using Yori in and they continued to reproduce the same results both a) when reading a YAML file and b) when using a supplied dictionary.

Assignee
Assign to
Reviewer
Request review from
Time tracking
Source branch: yaml-to-dict-option