:py:mod:`gnome.scripting.utilities` =================================== .. py:module:: gnome.scripting.utilities .. autoapi-nested-parse:: utilities for scripting gnome assorted utilities that make it easier to write scripts to automate gnome designed to be imported into the package __init__.py remember to add anyting new you want imported to "__all__" Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: gnome.scripting.utilities.PrintFinder Functions ~~~~~~~~~ .. autoapisummary:: gnome.scripting.utilities.make_images_dir gnome.scripting.utilities.remove_netcdf gnome.scripting.utilities.set_verbose .. py:function:: make_images_dir(images_dir=None) Create output directory for rendered images. If it already exists, delete all old output files .. py:function:: remove_netcdf(netcdf_file) remove netcdf_file and associated uncertain netcdf file Give scripts control over deleting the netcdf file before instantiating a new NetCDFOutput object. .. py:function:: set_verbose(log_level='info') Set the logging system to dump to the console -- you can see much more what's going on with the model as it runs :param log_level='info': the level you want your log to show. options are, in order of importance: "debug", "info", "warning", "error", "critical". You will only get the logging messages at or above the level you set. Set to "debug" for everything. .. py:class:: PrintFinder Bases: :py:obj:`object` class to capture stdout so that you can find print statements This will print the file, line number, and line after a print statement To use, simply create an instance in your script PrintFinder() IF you want to be able to put it back, save it and call: pf = PrintFinder() pf.restore() initialize a PrintFinder object This captures stdout when it is initialized .. py:method:: write(content) The stream write method -- intercepts the write to stdout, writes to original stdout, then adds some traceback info. .. py:method:: restore() sets stdout back to the original .. py:method:: flush() forwards a flush call on to the original stdout