zhmiscellany 6.1.9__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/fileio.py CHANGED
@@ -237,7 +237,7 @@ def cache(function, *args, **kwargs):
237
237
  # CUSTOM OBJECTS: Try to return their __dict__ or string rep
238
238
  if hasattr(obj, '__dict__'):
239
239
  return obj.__dict__
240
-
240
+
241
241
  # Fallback: String representation (risky if str() format changes)
242
242
  return str(obj)
243
243
  json_bytes = orjson.dumps(
@@ -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
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: zhmiscellany
3
- Version: 6.1.9
3
+ Version: 6.2.1
4
4
  Summary: A collection of useful/interesting python libraries made by zh.
5
5
  Home-page: https://discord.gg/ThBBAuueVJ
6
6
  Author: zh
@@ -8,7 +8,7 @@ zhmiscellany/_resource_files_lookup.py,sha256=hsgPW0dngokgqWrAVAv5rUo-eobzJPjvWH
8
8
  zhmiscellany/cpp.py,sha256=XEUEoIKCDCdY5VgwNWE5oXrGjtsmGdz_MnaVwQmi2dk,179
9
9
  zhmiscellany/dict.py,sha256=0BZJ5eK-MurAHYV1OPa0jdGTr-QEWos7ZM0npb-tN9I,81
10
10
  zhmiscellany/discord.py,sha256=nzXjRnJbuYbuH4hScqqdsF61VeXx8xiYrwp_AKTWt9o,19774
11
- zhmiscellany/fileio.py,sha256=QpF4j2XzJd3naIQXQJL-pdNWnj4cOT1BF-qhMNZUFdo,19520
11
+ zhmiscellany/fileio.py,sha256=YqIfdit0TQr4VYmpCftoqwtddqo1OZz6duI7BKg7Dy4,19532
12
12
  zhmiscellany/gui.py,sha256=BDmM7e5ITKQuzxSzaYvPapQuPbQjCMTOq-GyMcLCIgg,10198
13
13
  zhmiscellany/image.py,sha256=qUjxiYpc2VVZp2vwr1vN36O2PVQ7YlMKzhegQ1u4c0M,8198
14
14
  zhmiscellany/list.py,sha256=S8Z85bLJEP9lk2JkGpzUcG6kpRB7a-NWDIHMPiF5bKo,1473
@@ -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=sDKIbzG9TNFyT6yJ4TJL59taG-59_v3CBLekVSLrwgE,10899
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.1.9.dist-info/METADATA,sha256=gA3JaF8Ci0hQk4stp_Mjapd39GslDf99mqgfGZ9-EeQ,43897
25
- zhmiscellany-6.1.9.dist-info/WHEEL,sha256=hPN0AlP2dZM_3ZJZWP4WooepkmU9wzjGgCLCeFjkHLA,92
26
- zhmiscellany-6.1.9.dist-info/top_level.txt,sha256=ioDtsrevCI52rTxZntMPljRIBsZs73tD0hI00HektiE,13
27
- zhmiscellany-6.1.9.dist-info/RECORD,,
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,,