From 478bcd92c1b6c31d5c3800a47800a4e3cc987bdf Mon Sep 17 00:00:00 2001 From: Alex Wolden Date: Sat, 12 Apr 2025 14:00:51 -0700 Subject: [PATCH] remove some dead code --- src/meshcore/ble_cx.py | 1 - src/meshcore/commands.py | 22 +--------------------- src/meshcore/meshcore.py | 14 -------------- src/meshcore/serial_cx.py | 1 - src/meshcore/tcp_cx.py | 1 - 5 files changed, 1 insertion(+), 38 deletions(-) diff --git a/src/meshcore/ble_cx.py b/src/meshcore/ble_cx.py index d8f4875..fbdca89 100644 --- a/src/meshcore/ble_cx.py +++ b/src/meshcore/ble_cx.py @@ -2,7 +2,6 @@ mccli.py : CLI interface to MeschCore BLE companion app """ import asyncio -import sys import logging # Get logger diff --git a/src/meshcore/commands.py b/src/meshcore/commands.py index 293c0e6..018cdbf 100644 --- a/src/meshcore/commands.py +++ b/src/meshcore/commands.py @@ -1,30 +1,10 @@ -import functools import asyncio import logging -import warnings -import time -from typing import Any, Callable, Awaitable, Optional, Union +from typing import Any from .events import EventType logger = logging.getLogger("meshcore") -class CommandError(Exception): - def __init__(self, details=None): - self.details = details - super().__init__(f"Command error: {details}") - -def deprecated(func): - @functools.wraps(func) - async def wrapper(*args, **kwargs): - warnings.warn( - f"Method {func.__name__} is deprecated. Use commands.{func.__name__} instead.", - DeprecationWarning, - stacklevel=2 - ) - return await func(*args, **kwargs) - return wrapper - - class CommandHandler: DEFAULT_TIMEOUT = 5.0 diff --git a/src/meshcore/meshcore.py b/src/meshcore/meshcore.py index eedcb12..bd26b53 100644 --- a/src/meshcore/meshcore.py +++ b/src/meshcore/meshcore.py @@ -1,6 +1,4 @@ import asyncio -import functools -import warnings import logging from typing import Optional, Dict, Any @@ -12,18 +10,6 @@ from .commands import CommandHandler # Setup default logger logger = logging.getLogger("meshcore") - -def deprecated(func): - @functools.wraps(func) - async def wrapper(*args, **kwargs): - warnings.warn( - f"Method {func.__name__} is deprecated. Use commands.{func.__name__} instead.", - DeprecationWarning, - stacklevel=2 - ) - return await func(*args, **kwargs) - return wrapper - class MeshCore: """ Interface to a MeshCore device diff --git a/src/meshcore/serial_cx.py b/src/meshcore/serial_cx.py index 93c469a..b7b07c6 100644 --- a/src/meshcore/serial_cx.py +++ b/src/meshcore/serial_cx.py @@ -2,7 +2,6 @@ mccli.py : CLI interface to MeschCore BLE companion app """ import asyncio -import sys import logging import serial_asyncio diff --git a/src/meshcore/tcp_cx.py b/src/meshcore/tcp_cx.py index c14d4a5..25c38c8 100644 --- a/src/meshcore/tcp_cx.py +++ b/src/meshcore/tcp_cx.py @@ -2,7 +2,6 @@ mccli.py : CLI interface to MeschCore BLE companion app """ import asyncio -import sys import logging # Get logger