forked from clan/clan-core
Merge pull request 'api: clan Modules add readme content' (#1684) from hsjobeki/clan-core:hsjobeki-main into main
This commit is contained in:
commit
4bdcc4dd5e
@ -2,3 +2,12 @@
|
|||||||
description = "Efficient, deduplicating backup program with optional compression and secure encryption."
|
description = "Efficient, deduplicating backup program with optional compression and secure encryption."
|
||||||
categories = ["backup"]
|
categories = ["backup"]
|
||||||
---
|
---
|
||||||
|
BorgBackup (short: Borg) gives you:
|
||||||
|
|
||||||
|
- Space efficient storage of backups.
|
||||||
|
- Secure, authenticated encryption.
|
||||||
|
- Compression: lz4, zstd, zlib, lzma or none.
|
||||||
|
- Mountable backups with FUSE.
|
||||||
|
- Easy installation on multiple platforms: Linux, macOS, BSD, ...
|
||||||
|
- Free software (BSD license).
|
||||||
|
- Backed by a large and active open source community.
|
@ -1,4 +1,3 @@
|
|||||||
import argparse
|
|
||||||
import json
|
import json
|
||||||
import re
|
import re
|
||||||
import tomllib
|
import tomllib
|
||||||
@ -81,6 +80,7 @@ class ModuleInfo:
|
|||||||
description: str
|
description: str
|
||||||
categories: list[str] | None
|
categories: list[str] | None
|
||||||
roles: list[str] | None
|
roles: list[str] | None
|
||||||
|
readme: str | None = None
|
||||||
|
|
||||||
|
|
||||||
def get_modules(base_path: str) -> dict[str, str]:
|
def get_modules(base_path: str) -> dict[str, str]:
|
||||||
@ -142,9 +142,5 @@ def show_module_info(base_path: str, module_name: str) -> ModuleInfo:
|
|||||||
description=frontmatter.description,
|
description=frontmatter.description,
|
||||||
categories=frontmatter.categories,
|
categories=frontmatter.categories,
|
||||||
roles=get_roles(module_path),
|
roles=get_roles(module_path),
|
||||||
|
readme=readme_content,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
def command(args: argparse.Namespace) -> None:
|
|
||||||
res = show_module_info(args.flake, args.module_name)
|
|
||||||
print(res)
|
|
||||||
|
@ -24,3 +24,4 @@ def test_modules_details(test_flake_with_core: FlakeForTest) -> None:
|
|||||||
assert module_info.categories and "backup" in module_info.categories
|
assert module_info.categories and "backup" in module_info.categories
|
||||||
assert module_info.roles
|
assert module_info.roles
|
||||||
assert set(module_info.roles) == {"server", "client"}
|
assert set(module_info.roles) == {"server", "client"}
|
||||||
|
assert module_info.readme is not None and module_info.readme != ""
|
||||||
|
Loading…
Reference in New Issue
Block a user