rdagger / Pi-ST7565

ST7565 Graphics LCD Display Python Library for Raspberry Pi
MIT License
17 stars 13 forks source link

AttributeError: 'NoneType' object has no attribute 'format': y-coordinate: {0} above maximum of {1}. #4

Closed synox closed 7 years ago

synox commented 7 years ago

st7565.Glcd#is_off_grid has an error in the error handling. it raises an error if it prints off screen.

the print function is implemented incorrectly (call format() on the string, not on the result of print).

error:

    y-coordinate: {0} above maximum of {1}.
    Traceback (most recent call last):
      File "/scratch.py", line 30, in <module>
        is_off_grid(100, 50, 10, 50)
      File "/scratch.py", line 26, in is_off_grid
        print('y-coordinate: {0} above maximum of {1}.').format(ymax, LCD_HEIGHT - 1)
    AttributeError: 'NoneType' object has no attribute 'format'
rdagger commented 7 years ago

Thanks.