Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion micropython/lora/lora-sx126x/manifest.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
metadata(version="0.1.5")
metadata(version="0.1.6")
require("lora")
require("lora-sync")
require("lora-async")
package("lora")
4 changes: 3 additions & 1 deletion micropython/lora/lora-sx127x/manifest.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
metadata(version="0.1.2")
metadata(version="0.1.3")
require("lora")
require("lora-sync")
require("lora-async")
package("lora")
13 changes: 10 additions & 3 deletions micropython/lora/lora/lora/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,30 +5,34 @@

ok = False # Flag if at least one modem driver package is installed

def _can_ignore_error(e):
"""Check if ImportError can be ignored due to missing module."""
return all(x in str(e) for x in ["no module named", "lora"])

# Various lora "sub-packages"

try:
from .sx126x import * # noqa: F401

ok = True
except ImportError as e:
if "no module named 'lora." not in str(e):
if not _can_ignore_error(e):
raise

try:
from .sx127x import * # noqa: F401

ok = True
except ImportError as e:
if "no module named 'lora." not in str(e):
if not _can_ignore_error(e):
raise

try:
from .stm32wl5 import * # noqa: F401

ok = True
except ImportError as e:
if "no module named 'lora." not in str(e):
if not _can_ignore_error(e):
raise


Expand All @@ -38,3 +42,6 @@
)

del ok


__version__ = '0.2.1'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line is automatically added by mip when the package is installed.

Loading