FAQ | This is a LIVE service | Changelog

Skip to content
Snippets Groups Projects
Commit a5132db9 authored by Dr Rich Wareham's avatar Dr Rich Wareham
Browse files

some finessing of the script

This commit finesses the packaging and UX of the script a little.

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 cerrect 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.
parent 11b397e2
No related branches found
No related tags found
1 merge request!2some finessing of the script
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment