mirror of
https://github.com/meshcore-dev/meshcore_py.git
synced 2026-11-01 10:12:03 +00:00
Merge pull request #115 from agessaman/fix/python-310-311-messaging-import
Fix Python 3.10/3.11 import failure in messaging commands
This commit is contained in:
@@ -0,0 +1,24 @@
|
|||||||
|
name: Python package import
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: ["main"]
|
||||||
|
pull_request:
|
||||||
|
branches: ["main"]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
import:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
python-version: ["3.10", "3.11"]
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- uses: actions/setup-python@v5
|
||||||
|
with:
|
||||||
|
python-version: ${{ matrix.python-version }}
|
||||||
|
- name: Install package
|
||||||
|
run: python -m pip install .
|
||||||
|
- name: Import installed package
|
||||||
|
run: python -c "import meshcore"
|
||||||
@@ -404,7 +404,7 @@ class MessagingCommands(CommandHandlerBase):
|
|||||||
raise ValueError("path must be shorter than 255 bytes")
|
raise ValueError("path must be shorter than 255 bytes")
|
||||||
path_len = int(len(path) / (path_hash_mode + 1))
|
path_len = int(len(path) / (path_hash_mode + 1))
|
||||||
path_bytes = bytes([path_len | (path_hash_mode << 6)]) + path
|
path_bytes = bytes([path_len | (path_hash_mode << 6)]) + path
|
||||||
logger.debug(f"Sending raw data {payload.hex()} through path {"Flood" if path is None else path.hex()} of len {"-1" if path is None else path_len} with mode {path_hash_mode} (raw path: {path_bytes.hex()})")
|
logger.debug(f"Sending raw data {payload.hex()} through path {'Flood' if path is None else path.hex()} of len {'-1' if path is None else path_len} with mode {path_hash_mode} (raw path: {path_bytes.hex()})")
|
||||||
data = bytes([CommandType.SEND_CHANNEL_DATA.value, chan]) + path_bytes + data_type.to_bytes(2, "little") + bytes(payload)
|
data = bytes([CommandType.SEND_CHANNEL_DATA.value, chan]) + path_bytes + data_type.to_bytes(2, "little") + bytes(payload)
|
||||||
return await self.send(data, [EventType.OK, EventType.ERROR])
|
return await self.send(data, [EventType.OK, EventType.ERROR])
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user