FAQ | This is a LIVE service | Changelog

Skip to content

some finessing of the script

Dr Rich Wareham requested to merge finessing into master

This PR finesses the packaging and UX of the script a little and adds an MIT license.

Add a README which indicates the purpose of the script, how to install it and a usage example.

Add a basic packaging so that the script may be installed via pip.

Add .editorconfig files so that people which appropriately configured editors get the correct indentation/line length settings.

Add .gitignore to avoid accidentally committing files we don't want.

Modify the script itself:

  1. Logging is now to standard error by default. Redirection and/or tee can be used to log to a file.

  2. Logging verbosity can be reduced via a --quiet flag.

  3. Be explicit in what Opencast server and credentials we use rather than loading them from the environment. With multiple Opencast instances running it would be all to easy to accidentally schedule events in the wrong one.

  4. Use urljoin() to form the API URL rather than string concatenation. This behaves correctly in the case where the API URL is specified with a trailing slash.

  5. Default to standard input for CSV if no path is specified rather than having a "magic" filename.

  6. Global constants converted to use SHOUTING_CASE which is the convention we adopt in our projects.

  7. Use slightly more descriptive variable names and increase logging in places to show troublesome data in the log.

  8. Requests returns a "response" and not a "request" so re-name the variable appropriately.

  9. Rather than load passwords from the environment which is leaky since all program run see that variable, load passwords from a file. This is also a bit more compatible with, e.g., Docker secrets.

Merge request reports