-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
145 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
|
||
# set config opencv compile from source to avoid opencv lib not found error or version not match error | ||
CONFIG_OPENCV_COMPILE_FROM_SOURCE=y | ||
# CONFIG_OPENCV_COMPILE_FROM_SOURCE=y | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,33 @@ | ||
from .version import __version__ | ||
|
||
# import all _maix module's members to maix, e.g. maix._maix.err -> maix.err | ||
from ._maix import * | ||
from ._maix.peripheral import * | ||
from ._maix.peripheral.key import add_default_listener | ||
from . import _maix | ||
|
||
add_default_listener() | ||
|
||
del add_default_listener | ||
|
||
import inspect | ||
|
||
new_members = {} | ||
members = inspect.getmembers(_maix) | ||
for m in members: | ||
if m[0].startswith("__"): | ||
continue | ||
new_members["maix." + m[0]] = m[1] | ||
|
||
members = inspect.getmembers(_maix.peripheral) | ||
for m in members: | ||
if m[0].startswith("__"): | ||
continue | ||
new_members["maix." + m[0]] = m[1] | ||
|
||
# clear all temp vars | ||
del m, members, inspect | ||
|
||
import sys | ||
new_members = [] | ||
# find all maix._maix members | ||
for k in sys.modules: | ||
if k.startswith('maix._maix.'): | ||
# add all maix._maix members to maix, then we can use `from maix import err` | ||
new_members.append(("maix" + k[10:], sys.modules[k])) | ||
# add all maix._maix.peripheral members to maix, then we can use `from maix import adc` | ||
if k.startswith('maix._maix.peripheral.'): | ||
v = ('maix' + k[21:], sys.modules[k]) | ||
new_members.append(v) | ||
|
||
# add all new members to maix | ||
for k, v in new_members: | ||
for k, v in new_members.items(): | ||
sys.modules[k] = v | ||
|
||
# clear all temp vars | ||
del k, v, new_members |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters