Skip to content

Commit 65541e5

Browse files
committed
reference docs
1 parent 906ca87 commit 65541e5

File tree

6 files changed

+143
-4
lines changed

6 files changed

+143
-4
lines changed

documentation/reference/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,8 @@ A full list of `Nxtheme-creator` project modules.
66

77
- [Nxtheme Creator](nxtheme_creator/index.md#nxtheme-creator)
88
- [Module](nxtheme_creator/module.md#module)
9+
- [Backends](nxtheme_creator/backends/index.md#backends)
10+
- [Nxtheme](nxtheme_creator/backends/nxtheme.md#nxtheme)
11+
- [Sarc Tool](nxtheme_creator/backends/sarc_tool.md#sarc-tool)
912
- [Img Info](nxtheme_creator/img_info.md#img-info)
1013
- [Process Themes](nxtheme_creator/process_themes.md#process-themes)
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Backends
2+
3+
[Nxtheme-creator Index](../../README.md#nxtheme-creator-index) / [Nxtheme Creator](../index.md#nxtheme-creator) / Backends
4+
5+
> Auto-generated documentation for [nxtheme_creator.backends](../../../../nxtheme_creator/backends/__init__.py) module.
6+
7+
- [Backends](#backends)
8+
- [Modules](#modules)
9+
10+
## Modules
11+
12+
- [Nxtheme](./nxtheme.md)
13+
- [Sarc Tool](./sarc_tool.md)
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Nxtheme
2+
3+
[Nxtheme-creator Index](../../README.md#nxtheme-creator-index) / [Nxtheme Creator](../index.md#nxtheme-creator) / [Backends](./index.md#backends) / Nxtheme
4+
5+
> Auto-generated documentation for [nxtheme_creator.backends.nxtheme](../../../../nxtheme_creator/backends/nxtheme.py) module.
6+
7+
- [Nxtheme](#nxtheme)
8+
- [execute](#execute)
9+
10+
## execute
11+
12+
[Show source in nxtheme.py:7](../../../../nxtheme_creator/backends/nxtheme.py#L7)
13+
14+
Use python subprocess to drive the user defined SwitchTheme.exe.
15+
16+
#### Arguments
17+
18+
- `nxthemebin` *str* - path to SwitchTheme.exe
19+
- `component_name` *str* - component to build. eg. home, apps etc
20+
- `image_path` *str* - path to the source image
21+
- `layout_path` *dict* - path to the layout file
22+
- `name` *str* - theme name
23+
- `author_name` *str* - author name
24+
- `out` *str* - destination file name
25+
26+
#### Signature
27+
28+
```python
29+
def execute(
30+
nxthemebin: str,
31+
component_name: str,
32+
image_path: str,
33+
layout_path: str,
34+
theme_name: str,
35+
author_name: str,
36+
out: str,
37+
) -> None: ...
38+
```
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
# Sarc Tool
2+
3+
[Nxtheme-creator Index](../../README.md#nxtheme-creator-index) / [Nxtheme Creator](../index.md#nxtheme-creator) / [Backends](./index.md#backends) / Sarc Tool
4+
5+
> Auto-generated documentation for [nxtheme_creator.backends.sarc_tool](../../../../nxtheme_creator/backends/sarc_tool.py) module.
6+
7+
- [Sarc Tool](#sarc-tool)
8+
- [clean_dict](#clean_dict)
9+
- [dump_dict](#dump_dict)
10+
- [execute](#execute)
11+
- [sarc_create](#sarc_create)
12+
13+
## clean_dict
14+
15+
[Show source in sarc_tool.py:115](../../../../nxtheme_creator/backends/sarc_tool.py#L115)
16+
17+
Recursively removes entries with None or 0 values from a dictionary, including
18+
nested dictionaries and lists.
19+
20+
#### Signature
21+
22+
```python
23+
def clean_dict(d: dict | list | typing.Any) -> dict | list | typing.Any: ...
24+
```
25+
26+
27+
28+
## dump_dict
29+
30+
[Show source in sarc_tool.py:104](../../../../nxtheme_creator/backends/sarc_tool.py#L104)
31+
32+
Format the json files as similar to exelix11/SwitchThemeInjector as possible.
33+
34+
known issues: elements like "X": 1E-05, are encoded as "X": 1e-05, this is
35+
reasonable per the json spec https://www.json.org/json-en.html. And has been
36+
confirmed as working with version 15
37+
38+
#### Signature
39+
40+
```python
41+
def dump_dict(json_data: dict) -> bytes: ...
42+
```
43+
44+
45+
46+
## execute
47+
48+
[Show source in sarc_tool.py:40](../../../../nxtheme_creator/backends/sarc_tool.py#L40)
49+
50+
Python implementation of SwitchTheme.exe using the sarc lib to do a lot of the heavy lifting.
51+
52+
#### Arguments
53+
54+
- `component_name` *str* - component to build. eg. home, apps etc
55+
- `image_path` *str* - path to the source image
56+
- `layout_path` *dict* - path to the layout file
57+
- `name` *str* - theme name
58+
- `author_name` *str* - author name
59+
- `out` *str* - destination file name
60+
61+
#### Signature
62+
63+
```python
64+
def execute(
65+
component_name: str,
66+
image_path: str,
67+
layout_path: str | None,
68+
theme_name: str,
69+
author_name: str,
70+
out: str,
71+
) -> None: ...
72+
```
73+
74+
75+
76+
## sarc_create
77+
78+
[Show source in sarc_tool.py:27](../../../../nxtheme_creator/backends/sarc_tool.py#L27)
79+
80+
#### Signature
81+
82+
```python
83+
def sarc_create(files: dict[str, bytes], dest_file: str) -> None: ...
84+
```

documentation/reference/nxtheme_creator/img_info.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,22 +10,22 @@
1010

1111
## get_dds_info
1212

13-
[Show source in img_info.py:30](../../../nxtheme_creator/img_info.py#L30)
13+
[Show source in img_info.py:32](../../../nxtheme_creator/img_info.py#L32)
1414

1515
#### Signature
1616

1717
```python
18-
def get_dds_info(dds: bytes): ...
18+
def get_dds_info(dds: bytes) -> tuple[int, int, bool]: ...
1919
```
2020

2121

2222

2323
## get_jpeg_info
2424

25-
[Show source in img_info.py:6](../../../nxtheme_creator/img_info.py#L6)
25+
[Show source in img_info.py:8](../../../nxtheme_creator/img_info.py#L8)
2626

2727
#### Signature
2828

2929
```python
30-
def get_jpeg_info(jpeg: bytes): ...
30+
def get_jpeg_info(jpeg: bytes) -> tuple[int, int, bool]: ...
3131
```

documentation/reference/nxtheme_creator/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,6 @@ def cli() -> None: ...
2525
## Modules
2626

2727
- [Module](./module.md)
28+
- [Backends](backends/index.md)
2829
- [Img Info](./img_info.md)
2930
- [Process Themes](./process_themes.md)

0 commit comments

Comments
 (0)