Create and manipulate WPS tags from Python
Project description
python-rockbox
Create and manipulate WPS tags from Python
Currently supported:
- All tags from Rockbox 4.0 (via
Tagsclass) - Tags (
Tagclass) - Rockbox formatted hex color (
Colorclass) - Conditionals (
Matchclass) - If statements (
Ifclass)
Examples
This conditional that displays an appropriate battery bitmap:
wps = Match(
Tags.IS_CHARGING,
[
Tag(Tags.DISPLAY_IMAGE, "A"),
Match(
Tags.BATTERY_PERCENTAGE,
[
Tag(Tags.DISPLAY_IMAGE, "B"),
Tag(Tags.DISPLAY_IMAGE, "C"),
Tag(Tags.DISPLAY_IMAGE, "D"),
Tag(Tags.DISPLAY_IMAGE, "E"),
Tag(Tags.DISPLAY_IMAGE, "F"),
],
),
],
)
Would __repr__ to:
%?bp<%xd(A)|%?bl<%xd(B)|%xd(C)|%xd(D)|%xd(E)|%xd(F)>>
This if statement:
wps = If(Tags.VOLUME, ">=", 0, [
"Clipping possible",
"Volume OK"
])
Would __repr__ to:
%?if(%pv, >=, 0)<Clipping possible|Volume OK>
Install
To install locally, make sure you have the following installed:
- A modern version of Python 3 (I target 3.14)
- git
- pip
First, clone the repository:
git clone https://git.0stormy.xyz/stormy/python-rockbox.git
Next, change directories into the folder you just cloned:
cd python-rockbox
Finally, install it locally with:
pip install -e .
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file python_rockbox-0.2.1.tar.gz.
File metadata
- Download URL: python_rockbox-0.2.1.tar.gz
- Upload date:
- Size: 4.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ecc67b05e2b2b0464058fde1585bc81838de94a97f58f4e3f021e483b3b4413b
|
|
| MD5 |
f8af5f3eb28819d8d1554555a0a683ef
|
|
| BLAKE2b-256 |
8ab783d1c417567dcfe56d7927ec031da0d6087e277b52648206bbf4823d890c
|
File details
Details for the file python_rockbox-0.2.1-py3-none-any.whl.
File metadata
- Download URL: python_rockbox-0.2.1-py3-none-any.whl
- Upload date:
- Size: 5.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
67e0a832c72d7701ab2358e5bdcb64251ac40781164d51c2f00cf883f5f76625
|
|
| MD5 |
86539a05492911c651373e5a6575c63b
|
|
| BLAKE2b-256 |
b794e9cafc76b0663652339bfbcd10ecb0096e766e329a1a7fddb1dfcde8fd68
|