mirror of
https://github.com/google/bumble.git
synced 2026-04-16 00:25:31 +00:00
Add bumble's version to show device
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -6,3 +6,5 @@ dist/
|
|||||||
docs/mkdocs/site
|
docs/mkdocs/site
|
||||||
test-results.xml
|
test-results.xml
|
||||||
__pycache__
|
__pycache__
|
||||||
|
# generated by setuptools_scm
|
||||||
|
bumble/_version.py
|
||||||
|
|||||||
@@ -29,6 +29,7 @@ from collections import OrderedDict
|
|||||||
import click
|
import click
|
||||||
import colors
|
import colors
|
||||||
|
|
||||||
|
from bumble import __version__
|
||||||
from bumble.core import UUID, AdvertisingData, TimeoutError, BT_LE_TRANSPORT
|
from bumble.core import UUID, AdvertisingData, TimeoutError, 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
|
||||||
@@ -380,6 +381,8 @@ class ConsoleApp:
|
|||||||
def show_device(self, device):
|
def show_device(self, device):
|
||||||
lines = []
|
lines = []
|
||||||
|
|
||||||
|
lines.append(('ansicyan', 'Bumble Version: '))
|
||||||
|
lines.append(('', f'{__version__}\n'))
|
||||||
lines.append(('ansicyan', 'Name: '))
|
lines.append(('ansicyan', 'Name: '))
|
||||||
lines.append(('', f'{device.name}\n'))
|
lines.append(('', f'{device.name}\n'))
|
||||||
lines.append(('ansicyan', 'Public Address: '))
|
lines.append(('ansicyan', 'Public Address: '))
|
||||||
|
|||||||
@@ -0,0 +1,4 @@
|
|||||||
|
try:
|
||||||
|
from ._version import version as __version__
|
||||||
|
except ImportError:
|
||||||
|
__version__ = "unknown version"
|
||||||
|
|||||||
@@ -3,3 +3,4 @@ requires = ["setuptools>=52", "wheel", "setuptools_scm>=6.2"]
|
|||||||
build-backend = "setuptools.build_meta"
|
build-backend = "setuptools.build_meta"
|
||||||
|
|
||||||
[tool.setuptools_scm]
|
[tool.setuptools_scm]
|
||||||
|
write_to = "bumble/_version.py"
|
||||||
|
|||||||
Reference in New Issue
Block a user