| Age | Commit message (Collapse) | Author |
|
|
|
When no extension items were matched by the input regex, we previously
ran into a runtime error that wasn't obvious. Instead print an error
message explaining what the problem is.
|
|
|
|
In some cases, `item_statuses` can be shorter than
`item_names_versions`. I didn't look into why, just decided to add a
quick fix for the bounds error so the program could keep working again
without crashing. This seems to fix the problem I had, but it may need
to be revisited further down the line.
|
|
Sometimes I was getting the following exception which caused the program
to fail:
$ cws-status 'AODocs - Universal'
Traceback (most recent call last):
File ".../cws-status/cws-status", line 117, in <module>
matched_extensions.append((name, item_statuses[i]))
IndexError: list index out of range
Add a couple of print statements to see what's going on.
|
|
|
|
There's another instance when the user can be logged out and the "Sign
in to continue" string doesn't appear on the page. Also report this as a
logged out error.
|
|
I tried catching the `argparse.ArgumentError` as described here, but
that didn't seem to work:
https://docs.python.org/3.9/library/argparse.html#exit-on-error
When I wrapped `args = argparser.parse_args()` in a `try` block, it
raised a `SystemExit` exception instead of `argparse.ArgumentError`.
Take inspiration from some of the suggestions in this Stack Overflow
answer:
https://stackoverflow.com/questions/5943249/python-argparse-and-controlling-overriding-the-exit-status-code
Since we just want to change the exit code, call
`argparse.ArgumentParser`'s `error()` method and exit with the error
code we want.
|
|
|
|
Rather than output a single tab to separate the extension name and
version, use `ljust` to create two visual columns.
|
|
|
|
|
|
|
|
I didn't realise that `re.match()` only matches starting at the
beginning of the string rather than matching anywhere inside it:
https://docs.python.org/3/library/re.html#re.match
Switch to `re.search()` to get the desired behaviour.
|
|
|
|
|
|
Split up the different actions into logical sections.
|
|
Get the CWS dashboard URL and Chrome cookie path from command line
arguments.
|
|
|
|
The script now accepts a command line argument that filters the list of
extension names and prints the matches as output.
|
|
|
|
|
|
|
|
|