utils
sleap.gui.utils
¶
Generic module containing utilities used for the GUI.
Functions:
| Name | Description |
|---|---|
find_free_port |
Find free port to bind to. |
is_port_free |
Checks if a port is free. |
select_zmq_port |
Select a port that is free to connect within the given context. |
find_free_port(port, zmq_context)
¶
Find free port to bind to.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
port
|
int
|
The port to start searching from. |
required |
zmq_context
|
Context
|
The ZMQ context to use. |
required |
Returns:
| Type | Description |
|---|---|
|
The free port. |
Source code in sleap/gui/utils.py
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 | |
is_port_free(port, zmq_context=None)
¶
Checks if a port is free.
Source code in sleap/gui/utils.py
8 9 10 11 12 13 14 15 16 17 18 19 20 21 | |
select_zmq_port(zmq_context=None)
¶
Select a port that is free to connect within the given context.
Source code in sleap/gui/utils.py
24 25 26 27 28 29 30 | |