zhmiscellany 6.2.0__py3-none-any.whl → 6.2.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.
- zhmiscellany/processing.py +4 -1
- {zhmiscellany-6.2.0.dist-info → zhmiscellany-6.2.1.dist-info}/METADATA +1 -1
- {zhmiscellany-6.2.0.dist-info → zhmiscellany-6.2.1.dist-info}/RECORD +5 -5
- {zhmiscellany-6.2.0.dist-info → zhmiscellany-6.2.1.dist-info}/WHEEL +0 -0
- {zhmiscellany-6.2.0.dist-info → zhmiscellany-6.2.1.dist-info}/top_level.txt +0 -0
zhmiscellany/processing.py
CHANGED
|
@@ -4,6 +4,7 @@ import traceback
|
|
|
4
4
|
import zhmiscellany.string
|
|
5
5
|
import concurrent.futures
|
|
6
6
|
import subprocess, zlib, pickle, dill, tempfile, os, base64
|
|
7
|
+
from itertools import chain
|
|
7
8
|
|
|
8
9
|
|
|
9
10
|
def start_daemon(**kwargs):
|
|
@@ -13,7 +14,7 @@ def start_daemon(**kwargs):
|
|
|
13
14
|
return thread
|
|
14
15
|
|
|
15
16
|
|
|
16
|
-
def batch_threading(targets, max_threads=None, show_errors=True):
|
|
17
|
+
def batch_threading(targets, max_threads=None, show_errors=True, flatten=False):
|
|
17
18
|
def execute_target(target):
|
|
18
19
|
try: return target[0](*target[1])
|
|
19
20
|
except Exception:
|
|
@@ -27,6 +28,8 @@ def batch_threading(targets, max_threads=None, show_errors=True):
|
|
|
27
28
|
for f in concurrent.futures.as_completed(futures):
|
|
28
29
|
try: results[futures[f]] = f.result()
|
|
29
30
|
except Exception: results[futures[f]] = None
|
|
31
|
+
if flatten:
|
|
32
|
+
results = list(chain.from_iterable(results))
|
|
30
33
|
return results
|
|
31
34
|
|
|
32
35
|
|
|
@@ -18,10 +18,10 @@ zhmiscellany/misc.py,sha256=llL3ZHD5pxS4RDKLj3gX0k3NpE2mM5g3JVd0k_RvIUg,31979
|
|
|
18
18
|
zhmiscellany/netio.py,sha256=VCqlo3ev_iOTTu5sXTZQwsYU0WMbAlOTDRsJ5Dj5-fc,2519
|
|
19
19
|
zhmiscellany/pastebin.py,sha256=TbZ3DqFYXo5qt5d95ugrofYoptlzKkjXUr7VnEqa6ks,6357
|
|
20
20
|
zhmiscellany/pipes.py,sha256=zETvWP4PF-PuSzYwR1UCodY4ftNAgmCChb9DUMofXok,4657
|
|
21
|
-
zhmiscellany/processing.py,sha256=
|
|
21
|
+
zhmiscellany/processing.py,sha256=CUHgbNp8RetXDpc6DuojThi3T2iu_DX09P_WD8iUZ7s,11014
|
|
22
22
|
zhmiscellany/rust.py,sha256=znN6DYNoa_p-braTuDZKvUnXX8reWLFu_dG4fv2vLR0,442
|
|
23
23
|
zhmiscellany/string.py,sha256=xyqE6V5YF2nieZDcg5ZrXTIrH2D9oDRbZ5vQGz8rPys,4787
|
|
24
|
-
zhmiscellany-6.2.
|
|
25
|
-
zhmiscellany-6.2.
|
|
26
|
-
zhmiscellany-6.2.
|
|
27
|
-
zhmiscellany-6.2.
|
|
24
|
+
zhmiscellany-6.2.1.dist-info/METADATA,sha256=b-dPVNxL1Ap9p8Q4wRa4AzuzfUW8hCP-8XyJZIFKjd8,43897
|
|
25
|
+
zhmiscellany-6.2.1.dist-info/WHEEL,sha256=hPN0AlP2dZM_3ZJZWP4WooepkmU9wzjGgCLCeFjkHLA,92
|
|
26
|
+
zhmiscellany-6.2.1.dist-info/top_level.txt,sha256=ioDtsrevCI52rTxZntMPljRIBsZs73tD0hI00HektiE,13
|
|
27
|
+
zhmiscellany-6.2.1.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|