portune 1.0.0__py3-none-any.whl → 1.0.1__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 portune might be problematic. Click here for more details.

portune/portune.py CHANGED
@@ -821,21 +821,13 @@ def ping_hosts(hosts: List[Tuple[str, List[int], str]],
821
821
 
822
822
  # Use a lock for thread-safe progress updates
823
823
  lock = threading.Lock()
824
-
825
- def _update_progress(_):
826
- with lock:
827
- progress_bar.update(1)
828
-
824
+
829
825
  with ThreadPoolExecutor(max_workers=parallelism) as executor:
830
826
  future_to_host = {
831
827
  executor.submit(resolve_and_ping_host, hostname, timeout, noping): hostname
832
828
  for hostname, _, _ in hosts
833
829
  }
834
830
 
835
- # Add callback to update progress bar when each future completes
836
- for future in future_to_host:
837
- future.add_done_callback(_update_progress)
838
-
839
831
  for future in as_completed(future_to_host):
840
832
  orig_hostname = future_to_host[future]
841
833
  resolved_hostname, info = future.result()
@@ -844,6 +836,9 @@ def ping_hosts(hosts: List[Tuple[str, List[int], str]],
844
836
  if resolved_hostname != orig_hostname:
845
837
  # Keep resolved hostname in the info dict
846
838
  results[orig_hostname]['hostname'] = resolved_hostname
839
+ with lock:
840
+ # Update progress bar in a thread-safe manner
841
+ progress_bar.update(1)
847
842
 
848
843
  print(file=sys.stderr) # New line after progress bar
849
844
  return results
portune/version.py CHANGED
@@ -17,5 +17,5 @@ __version__: str
17
17
  __version_tuple__: VERSION_TUPLE
18
18
  version_tuple: VERSION_TUPLE
19
19
 
20
- __version__ = version = '1.0.0'
21
- __version_tuple__ = version_tuple = (1, 0, 0)
20
+ __version__ = version = '1.0.1'
21
+ __version_tuple__ = version_tuple = (1, 0, 1)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: portune
3
- Version: 1.0.0
3
+ Version: 1.0.1
4
4
  Summary: Simple Python HTTP Exec Server
5
5
  Author: Franck Jouvanceau
6
6
  Maintainer: Franck Jouvanceau
@@ -0,0 +1,9 @@
1
+ portune/__init__.py,sha256=RfXuNfHBqfRt_z4IukwN1a0oeCXahuMOO8_eBt4T8NM,58
2
+ portune/portune.py,sha256=JLpRM5ag8FgM0xxflob95lLbsBi7lW-Hxem5UAuGyA8,67736
3
+ portune/version.py,sha256=2Cl9kcQGg7NiH_eHRcv8wDYSW0X4uS5J0mGdZFO9-h0,511
4
+ portune-1.0.1.dist-info/licenses/LICENSE,sha256=gRJf0JPT_wsZJsUGlWPTS8Vypfl9vQ1qjp6sNbKykuA,1064
5
+ portune-1.0.1.dist-info/METADATA,sha256=tIxYl0yT_Fooci1JTLhz_eGu-UIVoTcpqFbWpSK2Qso,2377
6
+ portune-1.0.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
7
+ portune-1.0.1.dist-info/entry_points.txt,sha256=6j7jAf5fOZrLPbVIs3z92R1tT891WyY9YxQ6OVnPKG0,80
8
+ portune-1.0.1.dist-info/top_level.txt,sha256=CITDikHhRKAsSOGmNJzD-xSp6D5iBhSr9ZS1qy8-SL0,8
9
+ portune-1.0.1.dist-info/RECORD,,
@@ -1,9 +0,0 @@
1
- portune/__init__.py,sha256=RfXuNfHBqfRt_z4IukwN1a0oeCXahuMOO8_eBt4T8NM,58
2
- portune/portune.py,sha256=o4d9DX9mGbz7SEiUQMHLVGio_PAOTaoZ4WkCxHd4eOk,67871
3
- portune/version.py,sha256=fo5PXsZuloQZu3LdpIFTUAXvJmY2L9N5sNGe2tvdU98,511
4
- portune-1.0.0.dist-info/licenses/LICENSE,sha256=gRJf0JPT_wsZJsUGlWPTS8Vypfl9vQ1qjp6sNbKykuA,1064
5
- portune-1.0.0.dist-info/METADATA,sha256=aexgNHkPJhCErrbLOIOoIipJfhP0F2pf2BKGcBgKe-s,2377
6
- portune-1.0.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
7
- portune-1.0.0.dist-info/entry_points.txt,sha256=6j7jAf5fOZrLPbVIs3z92R1tT891WyY9YxQ6OVnPKG0,80
8
- portune-1.0.0.dist-info/top_level.txt,sha256=CITDikHhRKAsSOGmNJzD-xSp6D5iBhSr9ZS1qy8-SL0,8
9
- portune-1.0.0.dist-info/RECORD,,