Describe the bug
While trying to run the scripts/preview.py script to locally test some template modifications I was making for myself I discovered it was erroring out due to an AttributeError: NoneType in pwnagotchi/ui/fonts.py on line 27
To Reproduce
Steps to reproduce the behavior:
- Navigate to the scripts folder in your terminal
- run
./preview.py --displays waveshare_v2
Expected behavior
A clear and concise description of what you expected to happen.
A preview.png image should be generated
Screenshots
If applicable, add screenshots to help explain your problem.
Traceback (most recent call last):
File "preview.py", line 214, in <module>
SystemExit(main())
File "preview.py", line 144, in main
display = CustomDisplay(config=config, state={'name': f"{display_type}>"})
File "preview.py", line 21, in __init__
super(CustomDisplay, self).__init__(config, state)
File "/home/rocco/dev/pwnagotchi/scripts/../pwnagotchi/ui/display.py", line 12, in __init__
super(Display, self).__init__(config, hw.display_for(config), state)
File "/home/rocco/dev/pwnagotchi/scripts/../pwnagotchi/ui/hw/__init__.py", line 44, in display_for
return WaveshareV2(config)
File "/home/rocco/dev/pwnagotchi/scripts/../pwnagotchi/ui/hw/waveshare2.py", line 9, in __init__
super(WaveshareV2, self).__init__(config, 'waveshare_2')
File "/home/rocco/dev/pwnagotchi/scripts/../pwnagotchi/ui/hw/base.py", line 25, in __init__
'font': fonts.status_font(fonts.Medium),
File "/home/rocco/dev/pwnagotchi/scripts/../pwnagotchi/ui/fonts.py", line 27, in status_font
return ImageFont.truetype(STATUS_FONT_NAME, size=old_font.size + SIZE_OFFSET)
AttributeError: 'NoneType' object has no attribute 'size'
Environment (please complete the following information):
- Pwnagotchi version: 1.5.5
- OS version: Raspbian and Ubuntu 22.04
- Type of hardware: Laptop, desktop, and Raspberry Pi Zero W
Describe the bug
While trying to run the
scripts/preview.pyscript to locally test some template modifications I was making for myself I discovered it was erroring out due to anAttributeError: NoneTypeinpwnagotchi/ui/fonts.pyon line 27To Reproduce
Steps to reproduce the behavior:
./preview.py --displays waveshare_v2Expected behavior
A clear and concise description of what you expected to happen.
A
preview.pngimage should be generatedScreenshots
If applicable, add screenshots to help explain your problem.
Environment (please complete the following information):