mirror of
https://github.com/meshcore-dev/meshcore_py.git
synced 2026-04-20 22:13:49 +00:00
remove some dead code
This commit is contained in:
parent
cbfc940de6
commit
478bcd92c1
5 changed files with 1 additions and 38 deletions
|
|
@ -2,7 +2,6 @@
|
||||||
mccli.py : CLI interface to MeschCore BLE companion app
|
mccli.py : CLI interface to MeschCore BLE companion app
|
||||||
"""
|
"""
|
||||||
import asyncio
|
import asyncio
|
||||||
import sys
|
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
# Get logger
|
# Get logger
|
||||||
|
|
|
||||||
|
|
@ -1,30 +1,10 @@
|
||||||
import functools
|
|
||||||
import asyncio
|
import asyncio
|
||||||
import logging
|
import logging
|
||||||
import warnings
|
from typing import Any
|
||||||
import time
|
|
||||||
from typing import Any, Callable, Awaitable, Optional, Union
|
|
||||||
from .events import EventType
|
from .events import EventType
|
||||||
|
|
||||||
logger = logging.getLogger("meshcore")
|
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:
|
class CommandHandler:
|
||||||
DEFAULT_TIMEOUT = 5.0
|
DEFAULT_TIMEOUT = 5.0
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,4 @@
|
||||||
import asyncio
|
import asyncio
|
||||||
import functools
|
|
||||||
import warnings
|
|
||||||
import logging
|
import logging
|
||||||
from typing import Optional, Dict, Any
|
from typing import Optional, Dict, Any
|
||||||
|
|
||||||
|
|
@ -12,18 +10,6 @@ from .commands import CommandHandler
|
||||||
# Setup default logger
|
# Setup default logger
|
||||||
logger = logging.getLogger("meshcore")
|
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:
|
class MeshCore:
|
||||||
"""
|
"""
|
||||||
Interface to a MeshCore device
|
Interface to a MeshCore device
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,6 @@
|
||||||
mccli.py : CLI interface to MeschCore BLE companion app
|
mccli.py : CLI interface to MeschCore BLE companion app
|
||||||
"""
|
"""
|
||||||
import asyncio
|
import asyncio
|
||||||
import sys
|
|
||||||
import logging
|
import logging
|
||||||
import serial_asyncio
|
import serial_asyncio
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,6 @@
|
||||||
mccli.py : CLI interface to MeschCore BLE companion app
|
mccli.py : CLI interface to MeschCore BLE companion app
|
||||||
"""
|
"""
|
||||||
import asyncio
|
import asyncio
|
||||||
import sys
|
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
# Get logger
|
# Get logger
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue