nano-dev-utils 0.3.4__py3-none-any.whl → 0.3.5__py3-none-any.whl
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.
Potentially problematic release.
This version of nano-dev-utils might be problematic. Click here for more details.
- {nano_dev_utils-0.3.4.dist-info → nano_dev_utils-0.3.5.dist-info}/METADATA +8 -8
- {nano_dev_utils-0.3.4.dist-info → nano_dev_utils-0.3.5.dist-info}/RECORD +4 -4
- {nano_dev_utils-0.3.4.dist-info → nano_dev_utils-0.3.5.dist-info}/WHEEL +0 -0
- {nano_dev_utils-0.3.4.dist-info → nano_dev_utils-0.3.5.dist-info}/licenses/LICENSE.md +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: nano_dev_utils
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.5
|
|
4
4
|
Summary: A collection of small Python utilities for developers.
|
|
5
5
|
Project-URL: Homepage, https://github.com/yaronday/nano_utils
|
|
6
6
|
Project-URL: Issues, https://github.com/yaronday/nano_utils/issues
|
|
@@ -26,13 +26,13 @@ This module provides a `Timer` class for measuring the execution time of code bl
|
|
|
26
26
|
|
|
27
27
|
* **`__init__(self, precision=4, verbose=False)`**: Initializes a `Timer` instance.
|
|
28
28
|
* `precision` (int, optional): The number of decimal places to record and
|
|
29
|
-
|
|
30
|
-
* `verbose` (bool, optional): If `True`, the function's arguments and keyword
|
|
31
|
-
|
|
29
|
+
display time durations. Defaults to 4.
|
|
30
|
+
* `verbose` (bool, optional): If `True`, the function's arguments (args) and keyword arguments (kwargs)
|
|
31
|
+
will be included in the printed timing output. Defaults to `False`.
|
|
32
32
|
|
|
33
33
|
* **`timeit(self, func)`**: A decorator that measures the execution time of the decorated function.
|
|
34
34
|
* When the decorated function is called, this decorator records the start and end times,
|
|
35
|
-
* calculates the total execution time, prints the function name and execution time
|
|
35
|
+
* calculates the total execution time, prints the function name and execution time.
|
|
36
36
|
* (optionally including arguments if `verbose` is `True`), and returns the result of the original function.
|
|
37
37
|
|
|
38
38
|
#### Example Usage:
|
|
@@ -101,16 +101,16 @@ listening on specified TCP ports. It supports Windows, Linux, and macOS.
|
|
|
101
101
|
|
|
102
102
|
* **`get_pid_by_port(port: int) -> Optional[int]`**: A static method that attempts to
|
|
103
103
|
* find the process ID (PID) listening on the given `port`. It uses platform-specific
|
|
104
|
-
|
|
104
|
+
commands (`netstat`, `ss`, `lsof`). Returns the PID if found, otherwise `None`.
|
|
105
105
|
|
|
106
106
|
* **`kill_process(pid: int) -> bool`**: A static method that attempts to kill the process
|
|
107
|
-
|
|
107
|
+
with the given `pid`. It uses platform-specific commands (`taskkill`, `kill -9`).
|
|
108
108
|
* Returns `True` if the process was successfully killed, `False` otherwise.
|
|
109
109
|
|
|
110
110
|
* **`release_all(self, ports: Optional[list[int]] = None) -> None`**: Releases all processes
|
|
111
111
|
* listening on the specified `ports`.
|
|
112
112
|
* `ports` (`list[int]`, *optional*): A list of ports to release. If `None`, it uses the
|
|
113
|
-
|
|
113
|
+
`default_ports` defined during initialization.
|
|
114
114
|
* For each port, it first tries to get the PID and then attempts to kill the process.
|
|
115
115
|
* It logs the actions and any errors encountered. Invalid port numbers in the provided list are skipped.
|
|
116
116
|
|
|
@@ -2,7 +2,7 @@ nano_dev_utils/__init__.py,sha256=NFw7FWw1oJnOmRLe8btPbLJX7e5O78Keaw5fow29tOQ,37
|
|
|
2
2
|
nano_dev_utils/dynamic_importer.py,sha256=ufMEQKhtlDIYorjWVv58CKm-GWCwwgzp2pSSMznzlkc,917
|
|
3
3
|
nano_dev_utils/release_ports.py,sha256=lw4pNCvkVG36UIMlibpPzKUlNPlvwuYQ3klAd7XLSug,6042
|
|
4
4
|
nano_dev_utils/timers.py,sha256=niQhXzMuwUh7cdOPi8trKySbv8pFkP4XO5cLBqOxlng,1142
|
|
5
|
-
nano_dev_utils-0.3.
|
|
6
|
-
nano_dev_utils-0.3.
|
|
7
|
-
nano_dev_utils-0.3.
|
|
8
|
-
nano_dev_utils-0.3.
|
|
5
|
+
nano_dev_utils-0.3.5.dist-info/METADATA,sha256=AZDVeHhP4MN7Gn7I-LBvz51R7uuBcMky4YOyZTy0B6Q,5069
|
|
6
|
+
nano_dev_utils-0.3.5.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
7
|
+
nano_dev_utils-0.3.5.dist-info/licenses/LICENSE.md,sha256=Muenl7Bw_LdtHZtlOMAP7Kt97gDCq8WWp2605eDWhHU,1089
|
|
8
|
+
nano_dev_utils-0.3.5.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|