uphy 1.0.0.dev3269__tar.gz → 1.0.1.dev3359__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: uphy
3
- Version: 1.0.0.dev3269
3
+ Version: 1.0.1.dev3359
4
4
  Author-email: RT-Labs <support@rt-labs.com>
5
5
  License: Copyright rt-labs AB, Sweden.
6
6
  All rights reserved.
@@ -11,12 +11,14 @@ License: Copyright rt-labs AB, Sweden.
11
11
  Project-URL: RT-Labs, https://rt-labs.com
12
12
  Project-URL: U-Phy, https://rt-labs.com/u-phy
13
13
  Project-URL: Documentation, https://docs.rt-labs.com/u-phy
14
+ Requires-Python: >=3.10
14
15
  Description-Content-Type: text/markdown
15
16
  License-File: LICENSE.txt
16
17
  Requires-Dist: typer>=0.12.5
17
- Requires-Dist: uphy-device>=1.0.0
18
- Requires-Dist: uphy-controller>=1.0.0
18
+ Requires-Dist: uphy-device>=1.0.1
19
+ Requires-Dist: uphy-controller>=1.0.1
19
20
  Requires-Dist: rich>=13.9.4
21
+ Requires-Dist: pyserial>=3.5
20
22
 
21
23
  # U-Phy
22
24
 
@@ -1,16 +1,18 @@
1
1
  [project]
2
2
  name="uphy"
3
- version="1.0.0.dev3269"
3
+ version="1.0.1.dev3359"
4
4
  authors = [
5
5
  {name="RT-Labs", email="support@rt-labs.com"}
6
6
  ]
7
+ requires-python = ">= 3.10"
7
8
  readme = "README.md"
8
9
  license = { file = "LICENSE.txt" }
9
10
  dependencies = [
10
11
  "typer>=0.12.5",
11
- "uphy-device>=1.0.0",
12
- "uphy-controller>=1.0.0",
12
+ "uphy-device>=1.0.1",
13
+ "uphy-controller>=1.0.1",
13
14
  "rich>=13.9.4",
15
+ "pyserial>=3.5",
14
16
  ]
15
17
 
16
18
  [project.scripts]
@@ -3,6 +3,8 @@ import logging
3
3
  from importlib.metadata import entry_points
4
4
  from importlib import import_module, metadata
5
5
  from typing import Annotated, Optional
6
+ from rich.table import Table
7
+ from rich import print
6
8
 
7
9
  app = typer.Typer(pretty_exceptions_enable=False, no_args_is_help=True, name="uphy", help="U-Phy command line tools")
8
10
  LOG = logging.getLogger(__name__)
@@ -39,9 +41,37 @@ def build():
39
41
  """Start device builder to generate configuration files."""
40
42
  typer.launch("https://devicebuilder.rt-labs.com/")
41
43
 
42
- @app.command(name="help")
43
- def help(ctx: typer.Context):
44
- typer.echo(ctx.get_help())
44
+ @app.command(rich_help_panel="Extra")
45
+ def readme():
46
+ """Open browser at main documentation site"""
47
+
48
+ print("The main documentation site for U-Phy is located at https://docs.rt-labs.com/u-phy.")
49
+ if typer.confirm(
50
+ "Start a web browser navigating to site?"
51
+ ):
52
+ typer.launch("https://docs.rt-labs.com/u-phy")
53
+
54
+
55
+ @app.command(rich_help_panel="Extra")
56
+ def discover():
57
+ """Tries to discovery locally attached u-phy servers"""
58
+ import serial.tools.list_ports
59
+
60
+ table = Table("ID", "Serial Number", "Subsystem", title="Serial ports")
61
+ for port in serial.tools.list_ports.comports():
62
+ LOG.debug(port.usb_info())
63
+ if port.vid != 0x04D8 or port.pid != 0x1301:
64
+ continue
65
+ index = port.location.split(".")[-1]
66
+ if index == "0":
67
+ system = "server"
68
+ elif index == "2":
69
+ system = "console"
70
+ else:
71
+ system = "unkown"
72
+ table.add_row(port.name, port.serial_number, system)
73
+
74
+ print(table)
45
75
 
46
76
  if __name__ == "__main__":
47
77
  app()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: uphy
3
- Version: 1.0.0.dev3269
3
+ Version: 1.0.1.dev3359
4
4
  Author-email: RT-Labs <support@rt-labs.com>
5
5
  License: Copyright rt-labs AB, Sweden.
6
6
  All rights reserved.
@@ -11,12 +11,14 @@ License: Copyright rt-labs AB, Sweden.
11
11
  Project-URL: RT-Labs, https://rt-labs.com
12
12
  Project-URL: U-Phy, https://rt-labs.com/u-phy
13
13
  Project-URL: Documentation, https://docs.rt-labs.com/u-phy
14
+ Requires-Python: >=3.10
14
15
  Description-Content-Type: text/markdown
15
16
  License-File: LICENSE.txt
16
17
  Requires-Dist: typer>=0.12.5
17
- Requires-Dist: uphy-device>=1.0.0
18
- Requires-Dist: uphy-controller>=1.0.0
18
+ Requires-Dist: uphy-device>=1.0.1
19
+ Requires-Dist: uphy-controller>=1.0.1
19
20
  Requires-Dist: rich>=13.9.4
21
+ Requires-Dist: pyserial>=3.5
20
22
 
21
23
  # U-Phy
22
24
 
@@ -0,0 +1,5 @@
1
+ typer>=0.12.5
2
+ uphy-device>=1.0.1
3
+ uphy-controller>=1.0.1
4
+ rich>=13.9.4
5
+ pyserial>=3.5
@@ -1,4 +0,0 @@
1
- typer>=0.12.5
2
- uphy-device>=1.0.0
3
- uphy-controller>=1.0.0
4
- rich>=13.9.4
File without changes
File without changes
File without changes