2.15. log_change module

This is an interactive script that generates a changelog entry for any changes implemented to real time RRFS runs. It asks the user a variety of RRFS-specific questions, interrogates the UFS SRW App and its 1st-level Externals (submodules) to determine if they are consistent with the code on disk, and generates a log file with relevant tracking information.

Note: It is important to continue to use this logging script, even for changes that occur outside the clone, even though those changes will not be captured in the git information for the log file.

The log file will be appended to those in /misc/whome/rtrr/RRFS/

Requirements:

Python 3.6+

Conda Environment:

module use /contrib/miniconda3/modulefiles module load miniconda3 module load workflow_tools

Usage:

python log_change.py -h

class log_change.cd(newPath)[source]

Bases: object

Context manager for changing the current working directory

log_change.get_local_changes()[source]

Get differences that are not in the repo.

log_change.get_repo_info()[source]

Get the hashes that are currently checked out in each repository. Report on differences between hashes checked out and those in Externals.cfg, as well as differences that exist on disk.

log_change.get_summary()[source]

Return the results of a git summary, and the hash.

log_change.get_user_info()[source]

Return a dictionary of user-supplied information.

log_change.isbool(string)[source]

Returns a bool after checking whether the input string meets the requirements for a yes/no answer.

log_change.isdate(string)[source]

Returns a bool after checking whether the input string meets the requirements for a date string: YYYYMMDDHH.

log_change.isdomain(string)[source]

Returns a bool after checking whether the input string meets the requirements for a domain, or list of domains

log_change.load_externals(ext_path='Externals.cfg')[source]

Use configparser to load the Externals.cfg info. Return the dict

log_change.log_message()[source]

Recording a log message for printing or writing to file

log_change.logit(logfile, tmpfile)[source]

Cat the temporary file (filename) at the beginning of the main log file.

log_change.main(cla)[source]

Interact with user to get necessary information.

log_change.parse_args()[source]

Parse the command line arguments (cla)

log_change.print_dict(d, depth=0, sep=None)[source]

Recurse through dict entries to print them