ocf / ocflib

Python libraries for account and server management
https://pypi.python.org/pypi/ocflib
Other
15 stars 32 forks source link

Add new hours2 api #155

Closed dkess closed 5 years ago

dkess commented 5 years ago

This adds a new API for getting lab hours. The plan is to deprecate the old API and replace it with this one. In the meantime there will have to be an "hours" and "hour2".

This API is a bit nicer because it stores the entire hours listing in a single object, and methods on that object work on the entire calendar. This is better than our current system since it makes it easier to cache hours for ocfweb.

This also reads hours from a yaml file (in etc) instead of being part of the library itself. I also used the attrs library for nice validation and conversion from YAML to object types.