-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #35 from brainelectronics/bugfix/prepare-ned-reduc…
…ed-memory-usage Prepare ned reduced memory usage PR
- Loading branch information
Showing
6 changed files
with
50 additions
and
5 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
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 |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import uio | ||
|
||
c = {} | ||
|
||
|
||
def resource_stream(package, resource): | ||
if package not in c: | ||
try: | ||
if package: | ||
p = __import__(package + ".R", None, None, True) | ||
else: | ||
p = __import__("R") | ||
c[package] = p.R | ||
except ImportError: | ||
if package: | ||
p = __import__(package) | ||
d = p.__path__ | ||
else: | ||
d = "." | ||
# if d[0] != "/": | ||
# import uos | ||
# d = uos.getcwd() + "/" + d | ||
c[package] = d + "/" | ||
|
||
p = c[package] | ||
if isinstance(p, dict): | ||
return uio.BytesIO(p[resource]) | ||
return open(p + resource, "rb") |
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 |
---|---|---|
|
@@ -5,3 +5,4 @@ jinja2>=3.0.2,<4 | |
PyYAML>=5.4.1,<6 | ||
netifaces>=0.11.0,<1 | ||
pycrypto>=2.6.1,<3 | ||
microdot>=1.2.4,<2 |