|
SELKIELogger
1.0.0
|
Represent a logger state file, caching information as necessary. More...
Public Member Functions | |
| def | __init__ (self, filename) |
| Create new object. More... | |
| def | parse (self) |
| Read file and extract data. More... | |
| def | sources (self) |
| Retrieve list of sources referenced in this state file, parsing file if necessary. More... | |
| def | channels (self, source) |
| Extract all channels referenced in this state file for a specific source ID. More... | |
| def | last_source_message (self, source) |
| Find most recent message received from a given source and convert to a clocktime value. More... | |
| def | last_channel_message (self, source, channel) |
| Find most recent message received from a channel (specified by source and channel IDs) and convert to a clocktime value. More... | |
| def | timestamp (self) |
| Return latest timestamp from state file, parsing file if required. More... | |
| def | to_clocktime (self, timestamp) |
| Convert logger timestamp to real date/time. More... | |
Private Attributes | |
| _fn | |
| File name (and path, if required) for this instance. | |
| _sm | |
| SourceMap. | |
| _ts | |
| Last known timestamp. | |
| _vf | |
| Channel mapping file / VarFile associated with this state file. | |
| _stats | |
| Source/Channel statistics. | |
| _mtime | |
Represent a logger state file, caching information as necessary.
Definition at line 548 of file SLFiles.py.
| def SELKIELogger.SLFiles.StateFile.__init__ | ( | self, | |
| filename | |||
| ) |
Create new object.
File is not opened or parsed until requested.
| filename | Path to state file to be read |
Definition at line 551 of file SLFiles.py.
| def SELKIELogger.SLFiles.StateFile.channels | ( | self, | |
| source | |||
| ) |
Extract all channels referenced in this state file for a specific source ID.
Will parse the state file if required.
| source | Source ID to extract |
Definition at line 612 of file SLFiles.py.
| def SELKIELogger.SLFiles.StateFile.last_channel_message | ( | self, | |
| source, | |||
| channel | |||
| ) |
Find most recent message received from a channel (specified by source and channel IDs) and convert to a clocktime value.
Will parse the state file if required.
| source | Source ID to be checked |
| channel | Channel ID to be checked |
Definition at line 648 of file SLFiles.py.
| def SELKIELogger.SLFiles.StateFile.last_source_message | ( | self, | |
| source | |||
| ) |
Find most recent message received from a given source and convert to a clocktime value.
Will parse the state file if required.
| source | Source ID to check |
Definition at line 628 of file SLFiles.py.
| def SELKIELogger.SLFiles.StateFile.parse | ( | self | ) |
Read file and extract data.
Definition at line 568 of file SLFiles.py.
| def SELKIELogger.SLFiles.StateFile.sources | ( | self | ) |
Retrieve list of sources referenced in this state file, parsing file if necessary.
Definition at line 601 of file SLFiles.py.
| def SELKIELogger.SLFiles.StateFile.timestamp | ( | self | ) |
Return latest timestamp from state file, parsing file if required.
Definition at line 666 of file SLFiles.py.
| def SELKIELogger.SLFiles.StateFile.to_clocktime | ( | self, | |
| timestamp | |||
| ) |
Convert logger timestamp to real date/time.
Assumes that the most recent message was received at the file's modification time and uses this as an offset.
| timestamp | Value to be converted |
Definition at line 675 of file SLFiles.py.