git.s-ol.nu hw/0x33.board/firmware / a497b3b
move profile JSON files into subdirectory s-ol 10 months ago
2 changed file(s) with 9 addition(s) and 3 deletion(s). Raw diff Collapse all Expand all
00 boot_out.txt
1 profile*.hex.json
1 profiles
22 config.py
33 .rw-test
44
44 from colorsys import hsv_to_rgb
55 import displayio
66 import json
7 import os
78
89 from .util import FONT_10, led_map
910 from .core import Mode, Key
220221 order.append(id)
221222
222223 try:
223 with open(f'profile{i}.hex.json', 'r') as f:
224 with open(f'profiles/hex33board_{i}.json', 'r') as f:
224225 print(f"loading profile{i}")
225226 data = json.load(f)
226227 for id in order:
251252 data[id] = self.settings[id].value
252253
253254 try:
254 with open(f'profile{i}.hex.json', 'w') as f:
255 try:
256 os.mkdir('profiles')
257 except OSError:
258 pass
259
260 with open(f'profiles/hex33board_{i}.json', 'w') as f:
255261 print(f"storing profile{i}")
256262 json.dump(data, f)
257263 except OSError as e: