Skip to content

Better internal handling of calls to ls and better ERROR CODES

Choose a tag to compare

@jrowellfx jrowellfx released this 26 Sep 02:09
· 173 commits to master since this release

Release notes for v3.0.0

--help

Improvements to the --help messages.

Better internal handling of /bin/ls.

In the prior v2.7.1 release of lsseq, the internal call to ls was using subprocess.call() but not intercepting stderr output, nor any error codes generated.

Now in v3.0.0, the internal call to ls is via a newer set of features in the subprocess module. Namely using subprocess.run(), with some handy new parameters that are only available in python3.7 and above.

This new requirement of (at least) python3.7 is the reason that the version number of lsseq was bumped up to v3.0.0, and not v2.8.0 even though technically lsseq v3.0.0 is backward compatible with v2.7.1.

v3.0.0 changes from v2.7.1 only include new features which according to Semantic Versioning 2.0.0 would allow us to only update the MINOR version number. (vMAJOR.MINOR.PATCH)

Anyway, upping to v3.0.0 make it more obvious that there are some details (when installing) that need to be paid attention to. For example, possibly rebuilding /usr/local/venv with a version of python3>=3.7, and reinstalling lsseq, renumseq, etc. again.

Now lsseq is able to trap stderr output from running ls, and supressing the message if --silent was invoked on the command line.

Also, we grab the error codes from the call to ls bringing us to the next point...

Better ERROR codes and warning messages overall.

Better error handling is now provided and lsseq returns different error codes, as such:

EXIT_NO_ERROR               = 0 # Clean exit.
EXIT_LS_ERROR               = 1 # A call to 'ls' returned an error code.
EXIT_ARGPARSE_ERROR         = 2 # A bad option was passed to lsseq. Exit lsseq.
EXIT_LSSEQ_SOFTLINK_WARNING = 4 # warning - broken softlink found
EXIT_LSSEQ_PADDING_WARNING  = 8 # warning - two images with same name, same frame-num, but diff padding

Even better, those error codes above are combined bitwise to return as much information as possible.

For example, an error code of 12 means we got a warning of a broken softlink AND we found more than one file in a sequence, with the same frame-number, but different frame-number-padding. These codes are returned regardless of whether or not --silent or --quiet were invoked.

Also, we now have improved warning messages in both information and clarity.