sort
frequenz.repo.config.cli.version.mike.sort ¤
Sort mike
's version.json
file with a custom order.
Functions¤
frequenz.repo.config.cli.version.mike.sort._dump_versions_to ¤
Dump the versions to the given stream.
PARAMETER | DESCRIPTION |
---|---|
versions
|
The versions to dump. |
stream
|
The stream to write the versions to.
TYPE:
|
Source code in frequenz/repo/config/cli/version/mike/sort.py
frequenz.repo.config.cli.version.mike.sort._load_and_sort_versions_from ¤
Load the versions from the given stream and sort them.
PARAMETER | DESCRIPTION |
---|---|
stream
|
The stream to read the versions from.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
dict[str, dict[str, Any]]
|
The sorted loaded versions. |
Source code in frequenz/repo/config/cli/version/mike/sort.py
frequenz.repo.config.cli.version.mike.sort.main ¤
Sort mike
's version.json
file with a custom order.
The versions are sorted using sort_versions()
.
If no arguments are given, then the contents are read from stdin and the sorted versions are printed to stdout.
If one argument is given, then the contents of the file are replaced with the sorted versions.
If more than one argument is given, then an error is printed to stderr and the program exits with a non-zero exit code.