1
0
Fork 0

tools: themer: Fix the online help

Correct the indentation and the quoting of the theme strings.

Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
This commit is contained in:
Daniel Thompson 2020-12-13 16:50:11 +00:00
parent 4468285c34
commit 8824646939

View file

@ -43,30 +43,38 @@ class DefaultTheme():
if __name__ == '__main__': if __name__ == '__main__':
parser = ArgumentParser( parser = ArgumentParser(
description='''Compiles themes into a format understood by wasp-os. description='''Compiles themes into a format understood by wasp-os.
The resulting string should be put in main.py like this:
For the theme to take effect, the resulting string should be put in main.py
like this:
theme_string = THEME_STRING_GOES_HERE theme_string = THEME_STRING_GOES_HERE
for the theme to take effect.
''', ''',
epilog=''' To create a theme, epilog=''' To create a theme, import this file and extend the
import this file and extend the DefaultTheme class, only changing the variables. DefaultTheme class, only changing the variables.
Export the resulting class as 'Theme'. Export the resulting class as 'Theme'.
Example: Example:
-------- --------
theme.py: theme.py:
from themer import DefaultTheme from themer import DefaultTheme
class Theme(DefaultTheme): class Theme(DefaultTheme):
BLE_ICON_COLOR = 0x041F BLE_ICON_COLOR = 0x041F
shell: shell:
$ ./themer.py theme # NOTE: do not include .py at end of file!
> b'\xef{\xef{\xef{<\xe7\xef{\xb6\xb5\xb6\xbd\xff\xff\xff9' # NOTE: do not include .py at end of file!
$ ./themer.py theme
> b'\\xef{\\xef{\\xef{<\\xe7\\xef{\\xb6\\xb5\\xb6\\xbd\\xff\\xff\\xff9'
main.py: main.py:
... ...
wasp.system.set_theme(b'\xef{\xef{\xef{<\xe7\xef{\xb6\xb5\xb6\xbd\xff\xff\xff9') wasp.system.set_theme(
b'\\xef{\\xef{\\xef{<\\xe7\\xef{\\xb6\\xb5\\xb6\\xbd\\xff\\xff\\xff9')
... ...
''', ''',
formatter_class=RawTextHelpFormatter formatter_class=RawTextHelpFormatter