Skip to content

Commit

Permalink
Convert rocoto_viewer for python3
Browse files Browse the repository at this point in the history
The rocoto_viewer script is updated to python3. In addition to making
the necessary syntax updates like converting print statements into
print functions (adding parentheses), this requried removing the
dependency on produtils scripts (which are still in python2). This
change will also make the script more portable.

The largest chunk of changes to remove produtils revolves around
making system calls to run rocoto. These are replaced with a simple
wrapper function that calls subprocess, captures the output, and
returns it as a string. This also allows for the streamlining of
these portions of code.

A fallback is added in case lxml is not available. This will only
cause problems if lxml is not available and the user tries to read
a workflow that uses external entities, in which case a message
will be displayed notifying the user of the issue and providing
instructions on how to install lxml with pip. A similar existing
message for dateutil (used for UGCS's monthly increment) was
updated similarly.

Some incidental syntax updating and unused variable removal was
done as they were encountered, but a more complete cleaning of these
is still needed.

Refs: #13, #14
  • Loading branch information
WalterKolczynski-NOAA committed Jul 12, 2021
1 parent 36b4874 commit 57748d5
Showing 1 changed file with 232 additions and 254 deletions.
Loading

0 comments on commit 57748d5

Please sign in to comment.