kopia lustrzana https://github.com/peterhinch/micropython-font-to-py
writer.py: fast_mode optional relative import.
rodzic
1159205dcc
commit
4e998ad2bd
|
@ -19,17 +19,22 @@
|
||||||
# Slow method 2700μs typical, up to 11ms on larger fonts
|
# Slow method 2700μs typical, up to 11ms on larger fonts
|
||||||
|
|
||||||
import framebuf
|
import framebuf
|
||||||
fast_mode = False
|
|
||||||
try:
|
|
||||||
from framebuf_utils import render
|
|
||||||
fast_mode = True
|
|
||||||
except ImportError:
|
|
||||||
pass
|
|
||||||
except ValueError:
|
|
||||||
print('Ignoring framebuf_utils.mpy: it was compiled for an incorrect architecture.')
|
|
||||||
|
|
||||||
from uctypes import bytearray_at, addressof
|
from uctypes import bytearray_at, addressof
|
||||||
|
|
||||||
|
fast_mode = True
|
||||||
|
try:
|
||||||
|
try:
|
||||||
|
from framebuf_utils import render
|
||||||
|
except ImportError: # May be running in GUI. Try relative import.
|
||||||
|
try:
|
||||||
|
from .framebuf_utils import render
|
||||||
|
except ImportError:
|
||||||
|
fast_mode = False
|
||||||
|
except ValueError:
|
||||||
|
fast_mode = False
|
||||||
|
print('Ignoring framebuf_utils.mpy: compiled for incorrect architecture.')
|
||||||
|
|
||||||
|
|
||||||
class DisplayState():
|
class DisplayState():
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.text_row = 0
|
self.text_row = 0
|
||||||
|
|
Ładowanie…
Reference in New Issue