schedr._model.version¶
The schedr version that produced stored data, as major.minor.
Mirrors schedr-model (version.rs).
- class schedr._model.version.SchedrVersion(major, minor)¶
Bases:
objectA schedr version as
major.minor; the patch level never changes compatibility.- Parameters:
major (int)
minor (int)
- major¶
Data of another major version is never read.
- Type:
int
- minor¶
A reader reads data of an equal or lower minor version.
- Type:
int
- classmethod parse(text)¶
Parses
major.minorormajor.minor.patch(the patch is ignored).- Parameters:
text (str) – The version string, e.g.
"0.1"or"0.1.0".- Returns:
The version.
- Raises:
ValueError – If the text isn’t such a version.
- Return type:
Self
- classmethod current()¶
The version of the installed
schedrpackage.- Returns:
The installed version, without its patch level.
- Return type:
Self
- can_read(produced)¶
Whether this version can read data produced by
produced.- Parameters:
produced (SchedrVersion) – The version that produced the data.
- Returns:
True for the same major and an equal or lower minor version.
- Return type:
bool