nzsilverman / climbing_carpools

University of Michigan Climbing Club Carpool Scheduling Software
GNU General Public License v3.0
2 stars 1 forks source link

Configuration by file and CLI rewrite #25

Closed rkalnins closed 4 years ago

rkalnins commented 4 years ago

Update CLI, provide options for deleting (-d) sheet created by service account, listing (-l) sheets, providing a configuration file (-c), or running the ride generation/matching (-m).

Configuration can now be set in .defaults.toml. Short term changes can be set in user-config.toml to override any default setting. If a user provides a configuration file, the provided file is used instead of user-config.toml.

.defaults.toml

foo = 5

[test.path.ex]
bar = 6

user-config.toml

foo = 2

example.py

from Configuration import Configuration

root_config = Configuration.config()
print(root_config["foo"]) # prints 2, default is overridden

nested_config = Configuration.config("test.path.ex")
print(nested_config["bar"]) # prints 6

Might be worth exploring configuration verification for user overridden settings.

Also slowly expanding the configuration options and settings for sheet output.

Worst case is ~8 API calls per day when writing to the output sheet with all formatting options enabled. Adding more cars won't change the number of API calls because of batch updates to format and content. Probably could do everything in 1 but formatting cells and sheets gets a bit hairy and hacky. Area of opportunity here. Our usage is insignificant relative to our quotas. At peak usage, we used 34 of 500 requests allowed per second in the last 7 days.