mirror of
https://github.com/google/bumble.git
synced 2026-05-08 03:58:01 +00:00
overall: host a minimal copy of ainsicolors
This commit is contained in:
@@ -27,7 +27,6 @@ import re
|
|||||||
from collections import OrderedDict
|
from collections import OrderedDict
|
||||||
|
|
||||||
import click
|
import click
|
||||||
import colors
|
|
||||||
|
|
||||||
from prompt_toolkit import Application
|
from prompt_toolkit import Application
|
||||||
from prompt_toolkit.history import FileHistory
|
from prompt_toolkit.history import FileHistory
|
||||||
@@ -53,6 +52,7 @@ from prompt_toolkit.layout import (
|
|||||||
|
|
||||||
from bumble import __version__
|
from bumble import __version__
|
||||||
import bumble.core
|
import bumble.core
|
||||||
|
from bumble import colors
|
||||||
from bumble.core import UUID, AdvertisingData, BT_LE_TRANSPORT
|
from bumble.core import UUID, AdvertisingData, BT_LE_TRANSPORT
|
||||||
from bumble.device import ConnectionParametersPreferences, Device, Connection, Peer
|
from bumble.device import ConnectionParametersPreferences, Device, Connection, Peer
|
||||||
from bumble.utils import AsyncRunner
|
from bumble.utils import AsyncRunner
|
||||||
|
|||||||
@@ -19,9 +19,9 @@ import asyncio
|
|||||||
import os
|
import os
|
||||||
import logging
|
import logging
|
||||||
import click
|
import click
|
||||||
from colors import color
|
|
||||||
from bumble.company_ids import COMPANY_IDENTIFIERS
|
from bumble.company_ids import COMPANY_IDENTIFIERS
|
||||||
|
|
||||||
|
from bumble.colors import color
|
||||||
from bumble.core import name_or_number
|
from bumble.core import name_or_number
|
||||||
from bumble.hci import (
|
from bumble.hci import (
|
||||||
map_null_terminated_utf8_string,
|
map_null_terminated_utf8_string,
|
||||||
|
|||||||
@@ -19,9 +19,9 @@ import asyncio
|
|||||||
import os
|
import os
|
||||||
import logging
|
import logging
|
||||||
import click
|
import click
|
||||||
from colors import color
|
|
||||||
|
|
||||||
import bumble.core
|
import bumble.core
|
||||||
|
from bumble.colors import color
|
||||||
from bumble.device import Device, Peer
|
from bumble.device import Device, Peer
|
||||||
from bumble.gatt import show_services
|
from bumble.gatt import show_services
|
||||||
from bumble.transport import open_transport_or_link
|
from bumble.transport import open_transport_or_link
|
||||||
|
|||||||
@@ -20,8 +20,8 @@ import os
|
|||||||
import struct
|
import struct
|
||||||
import logging
|
import logging
|
||||||
import click
|
import click
|
||||||
from colors import color
|
|
||||||
|
|
||||||
|
from bumble.colors import color
|
||||||
from bumble.device import Device, Peer
|
from bumble.device import Device, Peer
|
||||||
from bumble.core import AdvertisingData
|
from bumble.core import AdvertisingData
|
||||||
from bumble.gatt import Service, Characteristic, CharacteristicValue
|
from bumble.gatt import Service, Characteristic, CharacteristicValue
|
||||||
|
|||||||
@@ -19,8 +19,8 @@ import asyncio
|
|||||||
import logging
|
import logging
|
||||||
import os
|
import os
|
||||||
import click
|
import click
|
||||||
from colors import color
|
|
||||||
|
|
||||||
|
from bumble.colors import color
|
||||||
from bumble.transport import open_transport_or_link
|
from bumble.transport import open_transport_or_link
|
||||||
from bumble.device import Device
|
from bumble.device import Device
|
||||||
from bumble.utils import FlowControlAsyncPipe
|
from bumble.utils import FlowControlAsyncPipe
|
||||||
|
|||||||
@@ -23,9 +23,10 @@ import argparse
|
|||||||
import uuid
|
import uuid
|
||||||
import os
|
import os
|
||||||
from urllib.parse import urlparse
|
from urllib.parse import urlparse
|
||||||
from colors import color
|
|
||||||
import websockets
|
import websockets
|
||||||
|
|
||||||
|
from bumble.colors import color
|
||||||
|
|
||||||
# -----------------------------------------------------------------------------
|
# -----------------------------------------------------------------------------
|
||||||
# Logging
|
# Logging
|
||||||
# -----------------------------------------------------------------------------
|
# -----------------------------------------------------------------------------
|
||||||
|
|||||||
@@ -19,9 +19,9 @@ import asyncio
|
|||||||
import os
|
import os
|
||||||
import logging
|
import logging
|
||||||
import click
|
import click
|
||||||
from colors import color
|
|
||||||
from prompt_toolkit.shortcuts import PromptSession
|
from prompt_toolkit.shortcuts import PromptSession
|
||||||
|
|
||||||
|
from bumble.colors import color
|
||||||
from bumble.device import Device, Peer
|
from bumble.device import Device, Peer
|
||||||
from bumble.transport import open_transport_or_link
|
from bumble.transport import open_transport_or_link
|
||||||
from bumble.smp import PairingDelegate, PairingConfig
|
from bumble.smp import PairingDelegate, PairingConfig
|
||||||
|
|||||||
@@ -19,8 +19,8 @@ import asyncio
|
|||||||
import os
|
import os
|
||||||
import logging
|
import logging
|
||||||
import click
|
import click
|
||||||
from colors import color
|
|
||||||
|
|
||||||
|
from bumble.colors import color
|
||||||
from bumble.device import Device
|
from bumble.device import Device
|
||||||
from bumble.transport import open_transport_or_link
|
from bumble.transport import open_transport_or_link
|
||||||
from bumble.keys import JsonKeyStore
|
from bumble.keys import JsonKeyStore
|
||||||
|
|||||||
@@ -17,8 +17,8 @@
|
|||||||
# -----------------------------------------------------------------------------
|
# -----------------------------------------------------------------------------
|
||||||
import struct
|
import struct
|
||||||
import click
|
import click
|
||||||
from colors import color
|
|
||||||
|
|
||||||
|
from bumble.colors import color
|
||||||
from bumble import hci
|
from bumble import hci
|
||||||
from bumble.transport.common import PacketReader
|
from bumble.transport.common import PacketReader
|
||||||
from bumble.helpers import PacketTracer
|
from bumble.helpers import PacketTracer
|
||||||
|
|||||||
@@ -30,8 +30,8 @@ import os
|
|||||||
import logging
|
import logging
|
||||||
import click
|
import click
|
||||||
import usb1
|
import usb1
|
||||||
from colors import color
|
|
||||||
|
|
||||||
|
from bumble.colors import color
|
||||||
from bumble.transport.usb import load_libusb
|
from bumble.transport.usb import load_libusb
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -24,12 +24,12 @@
|
|||||||
# -----------------------------------------------------------------------------
|
# -----------------------------------------------------------------------------
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
import struct
|
import struct
|
||||||
from colors import color
|
|
||||||
from pyee import EventEmitter
|
from pyee import EventEmitter
|
||||||
from typing import Dict, Type
|
from typing import Dict, Type
|
||||||
|
|
||||||
from bumble.core import UUID, name_or_number
|
from bumble.core import UUID, name_or_number
|
||||||
from bumble.hci import HCI_Object, key_with_value
|
from bumble.hci import HCI_Object, key_with_value
|
||||||
|
from bumble.colors import color
|
||||||
|
|
||||||
|
|
||||||
# -----------------------------------------------------------------------------
|
# -----------------------------------------------------------------------------
|
||||||
|
|||||||
@@ -20,7 +20,6 @@ import asyncio
|
|||||||
import struct
|
import struct
|
||||||
import time
|
import time
|
||||||
import logging
|
import logging
|
||||||
from colors import color
|
|
||||||
from pyee import EventEmitter
|
from pyee import EventEmitter
|
||||||
from typing import Dict, Type
|
from typing import Dict, Type
|
||||||
|
|
||||||
@@ -40,6 +39,7 @@ from .a2dp import (
|
|||||||
VendorSpecificMediaCodecInformation,
|
VendorSpecificMediaCodecInformation,
|
||||||
)
|
)
|
||||||
from . import sdp
|
from . import sdp
|
||||||
|
from .colors import color
|
||||||
|
|
||||||
# -----------------------------------------------------------------------------
|
# -----------------------------------------------------------------------------
|
||||||
# Logging
|
# Logging
|
||||||
|
|||||||
103
bumble/colors.py
Normal file
103
bumble/colors.py
Normal file
@@ -0,0 +1,103 @@
|
|||||||
|
# Copyright (c) 2012 Giorgos Verigakis <verigak@gmail.com>
|
||||||
|
#
|
||||||
|
# Permission to use, copy, modify, and distribute this software for any
|
||||||
|
# purpose with or without fee is hereby granted, provided that the above
|
||||||
|
# copyright notice and this permission notice appear in all copies.
|
||||||
|
#
|
||||||
|
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||||
|
# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||||
|
# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||||
|
# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||||
|
# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||||
|
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||||
|
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
|
|
||||||
|
from functools import partial
|
||||||
|
from typing import List, Optional, Union
|
||||||
|
|
||||||
|
|
||||||
|
# ANSI color names. There is also a "default"
|
||||||
|
COLORS = ('black', 'red', 'green', 'yellow', 'blue', 'magenta', 'cyan', 'white')
|
||||||
|
|
||||||
|
# ANSI style names
|
||||||
|
STYLES = (
|
||||||
|
'none',
|
||||||
|
'bold',
|
||||||
|
'faint',
|
||||||
|
'italic',
|
||||||
|
'underline',
|
||||||
|
'blink',
|
||||||
|
'blink2',
|
||||||
|
'negative',
|
||||||
|
'concealed',
|
||||||
|
'crossed',
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
ColorSpec = Union[str, int]
|
||||||
|
|
||||||
|
|
||||||
|
def _join(*values: ColorSpec) -> str:
|
||||||
|
return ';'.join(str(v) for v in values)
|
||||||
|
|
||||||
|
|
||||||
|
def _color_code(spec: ColorSpec, base: int) -> str:
|
||||||
|
if isinstance(spec, str):
|
||||||
|
spec = spec.strip().lower()
|
||||||
|
|
||||||
|
if spec == 'default':
|
||||||
|
return _join(base + 9)
|
||||||
|
elif spec in COLORS:
|
||||||
|
return _join(base + COLORS.index(spec))
|
||||||
|
elif isinstance(spec, int) and 0 <= spec <= 255:
|
||||||
|
return _join(base + 8, 5, spec)
|
||||||
|
else:
|
||||||
|
raise ValueError('Invalid color spec "%s"' % spec)
|
||||||
|
|
||||||
|
|
||||||
|
def color(
|
||||||
|
s: str,
|
||||||
|
fg: Optional[ColorSpec] = None,
|
||||||
|
bg: Optional[ColorSpec] = None,
|
||||||
|
style: Optional[str] = None,
|
||||||
|
) -> str:
|
||||||
|
codes: List[ColorSpec] = []
|
||||||
|
|
||||||
|
if fg:
|
||||||
|
codes.append(_color_code(fg, 30))
|
||||||
|
if bg:
|
||||||
|
codes.append(_color_code(bg, 40))
|
||||||
|
if style:
|
||||||
|
for style_part in style.split('+'):
|
||||||
|
if style_part in STYLES:
|
||||||
|
codes.append(STYLES.index(style_part))
|
||||||
|
else:
|
||||||
|
raise ValueError('Invalid style "%s"' % style_part)
|
||||||
|
|
||||||
|
if codes:
|
||||||
|
return '\x1b[{0}m{1}\x1b[0m'.format(_join(*codes), s)
|
||||||
|
else:
|
||||||
|
return s
|
||||||
|
|
||||||
|
|
||||||
|
# Foreground color shortcuts
|
||||||
|
black = partial(color, fg='black')
|
||||||
|
red = partial(color, fg='red')
|
||||||
|
green = partial(color, fg='green')
|
||||||
|
yellow = partial(color, fg='yellow')
|
||||||
|
blue = partial(color, fg='blue')
|
||||||
|
magenta = partial(color, fg='magenta')
|
||||||
|
cyan = partial(color, fg='cyan')
|
||||||
|
white = partial(color, fg='white')
|
||||||
|
|
||||||
|
# Style shortcuts
|
||||||
|
bold = partial(color, style='bold')
|
||||||
|
none = partial(color, style='none')
|
||||||
|
faint = partial(color, style='faint')
|
||||||
|
italic = partial(color, style='italic')
|
||||||
|
underline = partial(color, style='underline')
|
||||||
|
blink = partial(color, style='blink')
|
||||||
|
blink2 = partial(color, style='blink2')
|
||||||
|
negative = partial(color, style='negative')
|
||||||
|
concealed = partial(color, style='concealed')
|
||||||
|
crossed = partial(color, style='crossed')
|
||||||
@@ -20,7 +20,7 @@ import asyncio
|
|||||||
import itertools
|
import itertools
|
||||||
import random
|
import random
|
||||||
import struct
|
import struct
|
||||||
from colors import color
|
from bumble.colors import color
|
||||||
from bumble.core import BT_CENTRAL_ROLE, BT_PERIPHERAL_ROLE
|
from bumble.core import BT_CENTRAL_ROLE, BT_PERIPHERAL_ROLE
|
||||||
|
|
||||||
from bumble.hci import (
|
from bumble.hci import (
|
||||||
|
|||||||
@@ -25,8 +25,7 @@ from contextlib import asynccontextmanager, AsyncExitStack
|
|||||||
from dataclasses import dataclass
|
from dataclasses import dataclass
|
||||||
from typing import Any, ClassVar, Dict, List, Optional, Tuple, Union
|
from typing import Any, ClassVar, Dict, List, Optional, Tuple, Union
|
||||||
|
|
||||||
from colors import color
|
from .colors import color
|
||||||
|
|
||||||
from .att import ATT_CID, ATT_DEFAULT_MTU, ATT_PDU
|
from .att import ATT_CID, ATT_DEFAULT_MTU, ATT_PDU
|
||||||
from .gatt import Characteristic, Descriptor, Service
|
from .gatt import Characteristic, Descriptor, Service
|
||||||
from .hci import (
|
from .hci import (
|
||||||
|
|||||||
@@ -29,8 +29,8 @@ import functools
|
|||||||
import logging
|
import logging
|
||||||
import struct
|
import struct
|
||||||
from typing import Optional, Sequence
|
from typing import Optional, Sequence
|
||||||
from colors import color
|
|
||||||
|
|
||||||
|
from .colors import color
|
||||||
from .core import UUID, get_dict_key_by_value
|
from .core import UUID, get_dict_key_by_value
|
||||||
from .att import Attribute
|
from .att import Attribute
|
||||||
|
|
||||||
|
|||||||
@@ -27,9 +27,9 @@ import asyncio
|
|||||||
import logging
|
import logging
|
||||||
import struct
|
import struct
|
||||||
|
|
||||||
from colors import color
|
|
||||||
from pyee import EventEmitter
|
from pyee import EventEmitter
|
||||||
|
|
||||||
|
from .colors import color
|
||||||
from .hci import HCI_Constant
|
from .hci import HCI_Constant
|
||||||
from .att import (
|
from .att import (
|
||||||
ATT_ATTRIBUTE_NOT_FOUND_ERROR,
|
ATT_ATTRIBUTE_NOT_FOUND_ERROR,
|
||||||
|
|||||||
@@ -29,8 +29,8 @@ from collections import defaultdict
|
|||||||
import struct
|
import struct
|
||||||
from typing import List, Tuple, Optional
|
from typing import List, Tuple, Optional
|
||||||
from pyee import EventEmitter
|
from pyee import EventEmitter
|
||||||
from colors import color
|
|
||||||
|
|
||||||
|
from .colors import color
|
||||||
from .core import UUID
|
from .core import UUID
|
||||||
from .att import (
|
from .att import (
|
||||||
ATT_ATTRIBUTE_NOT_FOUND_ERROR,
|
ATT_ATTRIBUTE_NOT_FOUND_ERROR,
|
||||||
|
|||||||
@@ -20,9 +20,9 @@ import struct
|
|||||||
import collections
|
import collections
|
||||||
import logging
|
import logging
|
||||||
import functools
|
import functools
|
||||||
from colors import color
|
|
||||||
from typing import Dict, Type, Union
|
from typing import Dict, Type, Union
|
||||||
|
|
||||||
|
from .colors import color
|
||||||
from .core import (
|
from .core import (
|
||||||
BT_BR_EDR_TRANSPORT,
|
BT_BR_EDR_TRANSPORT,
|
||||||
AdvertisingData,
|
AdvertisingData,
|
||||||
|
|||||||
@@ -16,8 +16,8 @@
|
|||||||
# Imports
|
# Imports
|
||||||
# -----------------------------------------------------------------------------
|
# -----------------------------------------------------------------------------
|
||||||
import logging
|
import logging
|
||||||
from colors import color
|
|
||||||
|
|
||||||
|
from .colors import color
|
||||||
from .att import ATT_CID, ATT_PDU
|
from .att import ATT_CID, ATT_PDU
|
||||||
from .smp import SMP_CID, SMP_Command
|
from .smp import SMP_CID, SMP_Command
|
||||||
from .core import name_or_number
|
from .core import name_or_number
|
||||||
|
|||||||
@@ -18,7 +18,8 @@
|
|||||||
import logging
|
import logging
|
||||||
import asyncio
|
import asyncio
|
||||||
import collections
|
import collections
|
||||||
from colors import color
|
|
||||||
|
from .colors import color
|
||||||
|
|
||||||
|
|
||||||
# -----------------------------------------------------------------------------
|
# -----------------------------------------------------------------------------
|
||||||
|
|||||||
@@ -20,8 +20,7 @@ import collections
|
|||||||
import logging
|
import logging
|
||||||
import struct
|
import struct
|
||||||
|
|
||||||
from colors import color
|
from bumble.colors import color
|
||||||
|
|
||||||
from bumble.l2cap import L2CAP_PDU
|
from bumble.l2cap import L2CAP_PDU
|
||||||
|
|
||||||
from .hci import (
|
from .hci import (
|
||||||
|
|||||||
@@ -25,8 +25,8 @@ import logging
|
|||||||
import os
|
import os
|
||||||
import json
|
import json
|
||||||
from typing import Optional
|
from typing import Optional
|
||||||
from colors import color
|
|
||||||
|
|
||||||
|
from .colors import color
|
||||||
from .hci import Address
|
from .hci import Address
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -21,10 +21,10 @@ import logging
|
|||||||
import struct
|
import struct
|
||||||
|
|
||||||
from collections import deque
|
from collections import deque
|
||||||
from colors import color
|
|
||||||
from pyee import EventEmitter
|
from pyee import EventEmitter
|
||||||
from typing import Dict, Type
|
from typing import Dict, Type
|
||||||
|
|
||||||
|
from .colors import color
|
||||||
from .core import BT_CENTRAL_ROLE, InvalidStateError, ProtocolError
|
from .core import BT_CENTRAL_ROLE, InvalidStateError, ProtocolError
|
||||||
from .hci import (
|
from .hci import (
|
||||||
HCI_LE_Connection_Update_Command,
|
HCI_LE_Connection_Update_Command,
|
||||||
|
|||||||
@@ -19,9 +19,9 @@ import logging
|
|||||||
import asyncio
|
import asyncio
|
||||||
from functools import partial
|
from functools import partial
|
||||||
|
|
||||||
from colors import color
|
|
||||||
import websockets
|
import websockets
|
||||||
|
|
||||||
|
from bumble.colors import color
|
||||||
from bumble.hci import (
|
from bumble.hci import (
|
||||||
Address,
|
Address,
|
||||||
HCI_SUCCESS,
|
HCI_SUCCESS,
|
||||||
|
|||||||
@@ -18,10 +18,10 @@
|
|||||||
import logging
|
import logging
|
||||||
import asyncio
|
import asyncio
|
||||||
|
|
||||||
from colors import color
|
|
||||||
from pyee import EventEmitter
|
from pyee import EventEmitter
|
||||||
|
|
||||||
from . import core
|
from . import core
|
||||||
|
from .colors import color
|
||||||
from .core import BT_BR_EDR_TRANSPORT, InvalidStateError, ProtocolError
|
from .core import BT_BR_EDR_TRANSPORT, InvalidStateError, ProtocolError
|
||||||
|
|
||||||
# -----------------------------------------------------------------------------
|
# -----------------------------------------------------------------------------
|
||||||
|
|||||||
@@ -18,11 +18,10 @@
|
|||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
import logging
|
import logging
|
||||||
import struct
|
import struct
|
||||||
from colors import color
|
|
||||||
import colors
|
|
||||||
from typing import Dict, List, Type
|
from typing import Dict, List, Type
|
||||||
|
|
||||||
from . import core
|
from . import core
|
||||||
|
from .colors import color
|
||||||
from .core import InvalidStateError
|
from .core import InvalidStateError
|
||||||
from .hci import HCI_Object, name_or_number, key_with_value
|
from .hci import HCI_Object, name_or_number, key_with_value
|
||||||
|
|
||||||
@@ -506,7 +505,7 @@ class ServiceAttribute:
|
|||||||
def to_string(self, with_colors=False):
|
def to_string(self, with_colors=False):
|
||||||
if with_colors:
|
if with_colors:
|
||||||
return (
|
return (
|
||||||
f'Attribute(id={colors.color(self.id_name(self.id),"magenta")},'
|
f'Attribute(id={color(self.id_name(self.id),"magenta")},'
|
||||||
f'value={self.value})'
|
f'value={self.value})'
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -29,8 +29,8 @@ import secrets
|
|||||||
from typing import Dict, Optional, Type
|
from typing import Dict, Optional, Type
|
||||||
|
|
||||||
from pyee import EventEmitter
|
from pyee import EventEmitter
|
||||||
from colors import color
|
|
||||||
|
|
||||||
|
from .colors import color
|
||||||
from .hci import Address, HCI_LE_Enable_Encryption_Command, HCI_Object, key_with_value
|
from .hci import Address, HCI_LE_Enable_Encryption_Command, HCI_Object, key_with_value
|
||||||
from .core import (
|
from .core import (
|
||||||
BT_BR_EDR_TRANSPORT,
|
BT_BR_EDR_TRANSPORT,
|
||||||
|
|||||||
@@ -18,9 +18,9 @@
|
|||||||
import struct
|
import struct
|
||||||
import asyncio
|
import asyncio
|
||||||
import logging
|
import logging
|
||||||
from colors import color
|
|
||||||
|
|
||||||
from .. import hci
|
from .. import hci
|
||||||
|
from ..colors import color
|
||||||
|
|
||||||
|
|
||||||
# -----------------------------------------------------------------------------
|
# -----------------------------------------------------------------------------
|
||||||
|
|||||||
@@ -22,10 +22,10 @@ import time
|
|||||||
|
|
||||||
import usb.core
|
import usb.core
|
||||||
import usb.util
|
import usb.util
|
||||||
from colors import color
|
|
||||||
|
|
||||||
from .common import Transport, ParserSource
|
from .common import Transport, ParserSource
|
||||||
from .. import hci
|
from .. import hci
|
||||||
|
from ..colors import color
|
||||||
|
|
||||||
|
|
||||||
# -----------------------------------------------------------------------------
|
# -----------------------------------------------------------------------------
|
||||||
|
|||||||
@@ -23,10 +23,10 @@ import ctypes
|
|||||||
import platform
|
import platform
|
||||||
|
|
||||||
import usb1
|
import usb1
|
||||||
from colors import color
|
|
||||||
|
|
||||||
from .common import Transport, ParserSource
|
from .common import Transport, ParserSource
|
||||||
from .. import hci
|
from .. import hci
|
||||||
|
from ..colors import color
|
||||||
|
|
||||||
|
|
||||||
# -----------------------------------------------------------------------------
|
# -----------------------------------------------------------------------------
|
||||||
|
|||||||
@@ -22,9 +22,9 @@ import collections
|
|||||||
import sys
|
import sys
|
||||||
from typing import Awaitable, TypeVar
|
from typing import Awaitable, TypeVar
|
||||||
from functools import wraps
|
from functools import wraps
|
||||||
from colors import color
|
|
||||||
from pyee import EventEmitter
|
from pyee import EventEmitter
|
||||||
|
|
||||||
|
from .colors import color
|
||||||
|
|
||||||
# -----------------------------------------------------------------------------
|
# -----------------------------------------------------------------------------
|
||||||
# Logging
|
# Logging
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ import asyncio
|
|||||||
import sys
|
import sys
|
||||||
import os
|
import os
|
||||||
import logging
|
import logging
|
||||||
from colors import color
|
from bumble.colors import color
|
||||||
from bumble.device import Device
|
from bumble.device import Device
|
||||||
from bumble.transport import open_transport
|
from bumble.transport import open_transport
|
||||||
from bumble.profiles.battery_service import BatteryServiceProxy
|
from bumble.profiles.battery_service import BatteryServiceProxy
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ import asyncio
|
|||||||
import sys
|
import sys
|
||||||
import os
|
import os
|
||||||
import logging
|
import logging
|
||||||
from colors import color
|
from bumble.colors import color
|
||||||
from bumble.device import Device, Peer
|
from bumble.device import Device, Peer
|
||||||
from bumble.profiles.device_information_service import DeviceInformationServiceProxy
|
from bumble.profiles.device_information_service import DeviceInformationServiceProxy
|
||||||
from bumble.transport import open_transport
|
from bumble.transport import open_transport
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ import asyncio
|
|||||||
import sys
|
import sys
|
||||||
import os
|
import os
|
||||||
import logging
|
import logging
|
||||||
from colors import color
|
from bumble.colors import color
|
||||||
from bumble.device import Device
|
from bumble.device import Device
|
||||||
from bumble.transport import open_transport
|
from bumble.transport import open_transport
|
||||||
from bumble.profiles.heart_rate_service import HeartRateServiceProxy
|
from bumble.profiles.heart_rate_service import HeartRateServiceProxy
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ import logging
|
|||||||
import struct
|
import struct
|
||||||
import json
|
import json
|
||||||
import websockets
|
import websockets
|
||||||
from colors import color
|
from bumble.colors import color
|
||||||
|
|
||||||
from bumble.core import AdvertisingData
|
from bumble.core import AdvertisingData
|
||||||
from bumble.device import Device, Connection, Peer
|
from bumble.device import Device, Connection, Peer
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ import sys
|
|||||||
import os
|
import os
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
from colors import color
|
from bumble.colors import color
|
||||||
from bumble.device import Device
|
from bumble.device import Device
|
||||||
from bumble.transport import open_transport_or_link
|
from bumble.transport import open_transport_or_link
|
||||||
from bumble.core import (
|
from bumble.core import (
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ import sys
|
|||||||
import os
|
import os
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
from colors import color
|
from bumble.colors import color
|
||||||
from bumble.device import Device
|
from bumble.device import Device
|
||||||
from bumble.transport import open_transport_or_link
|
from bumble.transport import open_transport_or_link
|
||||||
from bumble.core import BT_BR_EDR_TRANSPORT
|
from bumble.core import BT_BR_EDR_TRANSPORT
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ import asyncio
|
|||||||
import sys
|
import sys
|
||||||
import os
|
import os
|
||||||
import logging
|
import logging
|
||||||
from colors import color
|
from bumble.colors import color
|
||||||
|
|
||||||
from bumble.device import Device
|
from bumble.device import Device
|
||||||
from bumble.transport import open_transport_or_link
|
from bumble.transport import open_transport_or_link
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ import asyncio
|
|||||||
import sys
|
import sys
|
||||||
import os
|
import os
|
||||||
import logging
|
import logging
|
||||||
from colors import color
|
from bumble.colors import color
|
||||||
|
|
||||||
from bumble.device import Device
|
from bumble.device import Device
|
||||||
from bumble.transport import open_transport_or_link
|
from bumble.transport import open_transport_or_link
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ import logging
|
|||||||
import asyncio
|
import asyncio
|
||||||
import sys
|
import sys
|
||||||
import os
|
import os
|
||||||
from colors import color
|
from bumble.colors import color
|
||||||
|
|
||||||
from bumble.device import Device
|
from bumble.device import Device
|
||||||
from bumble.controller import Controller
|
from bumble.controller import Controller
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ import asyncio
|
|||||||
import sys
|
import sys
|
||||||
import os
|
import os
|
||||||
import logging
|
import logging
|
||||||
from colors import color
|
from bumble.colors import color
|
||||||
|
|
||||||
from bumble.core import ProtocolError
|
from bumble.core import ProtocolError
|
||||||
from bumble.device import Device, Peer
|
from bumble.device import Device, Peer
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
import asyncio
|
import asyncio
|
||||||
import os
|
import os
|
||||||
import logging
|
import logging
|
||||||
from colors import color
|
from bumble.colors import color
|
||||||
|
|
||||||
from bumble.core import ProtocolError
|
from bumble.core import ProtocolError
|
||||||
from bumble.controller import Controller
|
from bumble.controller import Controller
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ import sys
|
|||||||
import os
|
import os
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
from colors import color
|
from bumble.colors import color
|
||||||
|
|
||||||
import bumble.core
|
import bumble.core
|
||||||
from bumble.device import Device
|
from bumble.device import Device
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ import sys
|
|||||||
import os
|
import os
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
from colors import color
|
from bumble.colors import color
|
||||||
|
|
||||||
import bumble.core
|
import bumble.core
|
||||||
from bumble.device import Device
|
from bumble.device import Device
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ import asyncio
|
|||||||
import sys
|
import sys
|
||||||
import os
|
import os
|
||||||
import logging
|
import logging
|
||||||
from colors import color
|
from bumble.colors import color
|
||||||
|
|
||||||
from bumble.device import Device
|
from bumble.device import Device
|
||||||
from bumble.transport import open_transport_or_link
|
from bumble.transport import open_transport_or_link
|
||||||
|
|||||||
@@ -30,7 +30,6 @@ package_dir =
|
|||||||
bumble.apps = apps
|
bumble.apps = apps
|
||||||
include-package-data = True
|
include-package-data = True
|
||||||
install_requires =
|
install_requires =
|
||||||
ansicolors >= 1.1
|
|
||||||
appdirs >= 1.4
|
appdirs >= 1.4
|
||||||
click >= 7.1.2; platform_system!='Emscripten'
|
click >= 7.1.2; platform_system!='Emscripten'
|
||||||
construct >= 2.10
|
construct >= 2.10
|
||||||
|
|||||||
Reference in New Issue
Block a user