|
HWRF
trunk@4391
|
A utility class for delivering files. More...
A utility class for delivering files.
This implements most of the functionality of the exhwrf_output.
Definition at line 57 of file exhwrf_output.py.
Public Member Functions | |
| def | __init__ (self, logger, conf) |
| Creates a new Deliverer with the specified logging.Logger and HWRFConfig. More... | |
| def | log |
| Gets the logging.Logger for this Deliverer. More... | |
| def | __setitem__ (self, key, value) |
| Sets a key in an internal dict of values used for string formatting. More... | |
| def | __getitem__ (self, key) |
| Gets a key from the hash of internal values used for string formatting, or raises KeyError if no such key is found. More... | |
| def | failures (self) |
| The number of failed deliveries. More... | |
| def | reset (self) |
| Resets the number of failures to zero. More... | |
| def | conf (self) |
| The hwrf.config.HWRFConfig object for this Deliverer. More... | |
| def | deliver_file (self, workfile, comfile=None, from_com=False, optional=False, kwargs) |
| Delivers one file. More... | |
| def scripts.exhwrf_output.Deliverer.__init__ | ( | self, | |
| logger, | |||
| conf | |||
| ) |
Creates a new Deliverer with the specified logging.Logger and HWRFConfig.
| logger | a logging.Logger for log messages |
| conf | an hwrf.config.HWRFConfig for configuration info |
Definition at line 60 of file exhwrf_output.py.
| def scripts.exhwrf_output.Deliverer.__getitem__ | ( | self, | |
| key | |||
| ) |
Gets a key from the hash of internal values used for string formatting, or raises KeyError if no such key is found.
| key | the desired key |
Definition at line 82 of file exhwrf_output.py.
| def scripts.exhwrf_output.Deliverer.__setitem__ | ( | self, | |
| key, | |||
| value | |||
| ) |
Sets a key in an internal dict of values used for string formatting.
| key | the string formatting key |
| value | what to replace the key with in string replacement |
Definition at line 76 of file exhwrf_output.py.
| def scripts.exhwrf_output.Deliverer.conf | ( | self | ) |
The hwrf.config.HWRFConfig object for this Deliverer.
Definition at line 95 of file exhwrf_output.py.
Referenced by scripts.exhwrf_output.Deliverer.deliver_file().
| def scripts.exhwrf_output.Deliverer.deliver_file | ( | self, | |
| workfile, | |||
comfile = None, |
|||
from_com = False, |
|||
optional = False, |
|||
| kwargs | |||
| ) |
Delivers one file.
Delivers the specified work area file to the specified com location. OR, if from_com=True, it does the opposite: deliver from com to the workfile. If the com location is not specified, a suitable default will be chosen. If optional=True, deliver_file will ignore the file if it is missing. Otherwise, a missing file counts as a failure in the internal failure counter. Additional keyword arguments are sent to conf.strinterp. If the workfile is a relative path, it is relative to the WORKhwrf directory.
When delivering to COM (from_com=False, the default), the workfile can instead be a Product, in which case the Product.location and .available are checked for availability information. When delivering from COM (from_com=True), the workfile must be a string path.
| workfile | the file in the work area |
| comfile | the file in the COM directory |
| from_com | if True, deliver from com to work, if False, do the opposite |
| optional | if True, and the file is missing, return True |
| kwargs | additional keyword arguments passed on to produtil.fileop.deliver_file() |
Definition at line 99 of file exhwrf_output.py.
Referenced by scripts.exhwrf_output.Deliverer.conf().
| def scripts.exhwrf_output.Deliverer.failures | ( | self | ) |
The number of failed deliveries.
Definition at line 88 of file exhwrf_output.py.
| def scripts.exhwrf_output.Deliverer.log | ( | self, | |
sublog = None |
|||
| ) |
Gets the logging.Logger for this Deliverer.
| sublog | If "sublog" is provided, a new logging.Logger is created for that subdomain of this Deliverer's logging domain. |
Definition at line 69 of file exhwrf_output.py.
Referenced by scripts.exhwrf_output.Deliverer.deliver_file(), and hwrf.coupling.CouplingStatus.set().
| def scripts.exhwrf_output.Deliverer.reset | ( | self | ) |
Resets the number of failures to zero.
Definition at line 91 of file exhwrf_output.py.
1.8.10