omlish 0.0.0.dev457__py3-none-any.whl → 0.0.0.dev458__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.
- omlish/__about__.py +2 -2
- omlish/diag/pydevd.py +22 -38
- omlish/term/confirm.py +8 -8
- {omlish-0.0.0.dev457.dist-info → omlish-0.0.0.dev458.dist-info}/METADATA +1 -1
- {omlish-0.0.0.dev457.dist-info → omlish-0.0.0.dev458.dist-info}/RECORD +9 -9
- {omlish-0.0.0.dev457.dist-info → omlish-0.0.0.dev458.dist-info}/WHEEL +0 -0
- {omlish-0.0.0.dev457.dist-info → omlish-0.0.0.dev458.dist-info}/entry_points.txt +0 -0
- {omlish-0.0.0.dev457.dist-info → omlish-0.0.0.dev458.dist-info}/licenses/LICENSE +0 -0
- {omlish-0.0.0.dev457.dist-info → omlish-0.0.0.dev458.dist-info}/top_level.txt +0 -0
omlish/__about__.py
CHANGED
omlish/diag/pydevd.py
CHANGED
@@ -31,7 +31,6 @@ import os
|
|
31
31
|
import sys
|
32
32
|
import tempfile
|
33
33
|
import textwrap
|
34
|
-
import threading
|
35
34
|
import types
|
36
35
|
import typing as ta
|
37
36
|
|
@@ -255,23 +254,23 @@ def maybe_reexec(
|
|
255
254
|
bootstrap_path = os.path.join(tmpdir, 'bootstrap.py')
|
256
255
|
with open(bootstrap_path, 'w') as f:
|
257
256
|
f.write(textwrap.dedent(f"""
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
257
|
+
import sys
|
258
|
+
old_paths = set(sys.path)
|
259
|
+
for new_path in {sys.path!r}:
|
260
|
+
if new_path not in old_paths:
|
261
|
+
sys.path.insert(0, new_path)
|
262
|
+
|
263
|
+
_stderr_write = sys.stderr.write
|
264
|
+
def stderr_write(*args, **kwargs):
|
265
|
+
code = sys._getframe(1).f_code
|
266
|
+
if code is not None and code.co_filename and code.co_filename.endswith('/pydev_log.py'):
|
267
|
+
return
|
268
|
+
_stderr_write(*args, **kwargs)
|
269
|
+
sys.stderr.write = stderr_write
|
270
|
+
|
271
|
+
sys.argv = {args[1:]!r}
|
272
|
+
import runpy
|
273
|
+
runpy.run_path({args[1]!r}, run_name='__main__')
|
275
274
|
"""))
|
276
275
|
args = [args[0], bootstrap_path]
|
277
276
|
|
@@ -284,29 +283,14 @@ def debug_unhandled_exception(exc_info: ta.Any = None) -> None:
|
|
284
283
|
|
285
284
|
try:
|
286
285
|
import pydevd
|
287
|
-
from pydevd import pydevd_tracing
|
288
286
|
|
289
287
|
except ImportError:
|
290
288
|
return
|
291
289
|
|
292
|
-
|
293
|
-
frames = []
|
294
|
-
while traceback:
|
295
|
-
frames.append(traceback.tb_frame)
|
296
|
-
traceback = traceback.tb_next
|
297
|
-
|
298
|
-
thread = threading.current_thread()
|
299
|
-
frames_by_id = {id(frame): frame for frame in frames}
|
300
|
-
frame = frames[-1]
|
301
|
-
exception = (exctype, value, traceback)
|
302
|
-
|
303
|
-
if hasattr(thread, 'additional_info'):
|
304
|
-
thread.additional_info.pydev_message = 'server exception'
|
305
|
-
try:
|
306
|
-
debugger = pydevd.debugger # noqa
|
307
|
-
except AttributeError:
|
308
|
-
debugger = pydevd.get_global_debugger() # noqa
|
290
|
+
et, e, tb = exc_info
|
309
291
|
|
310
|
-
|
292
|
+
while tb.tb_next is not None:
|
293
|
+
tb = tb.tb_next
|
294
|
+
original_frame = tb.tb_frame
|
311
295
|
|
312
|
-
|
296
|
+
pydevd.settrace(stop_at_frame=original_frame, suspend=True)
|
omlish/term/confirm.py
CHANGED
@@ -15,7 +15,7 @@ def confirm_action(
|
|
15
15
|
stdin = sys.stdin
|
16
16
|
if not stdin.isatty():
|
17
17
|
raise OSError(f'stdin {stdin!r} is not a tty')
|
18
|
-
# FIXME: we want to make sure we only run on a tty, but we
|
18
|
+
# FIXME: we want to make sure we only run on a tty, but we also want input()'s readline goodies..
|
19
19
|
if stdin is not sys.stdin:
|
20
20
|
raise RuntimeError('Unsupported stdin')
|
21
21
|
|
@@ -24,15 +24,15 @@ def confirm_action(
|
|
24
24
|
if not stdout.isatty():
|
25
25
|
raise OSError(f'stdout {stdout!r} is not a tty')
|
26
26
|
|
27
|
-
|
28
|
-
if
|
29
|
-
|
30
|
-
prefix = message + '\n\n'
|
31
|
-
else:
|
32
|
-
prefix = message + ' '
|
27
|
+
if message:
|
28
|
+
if '\n' in message:
|
29
|
+
prefix = message + '\n\n'
|
33
30
|
else:
|
34
|
-
prefix = ''
|
31
|
+
prefix = message + ' '
|
32
|
+
else:
|
33
|
+
prefix = ''
|
35
34
|
|
35
|
+
while True:
|
36
36
|
c = input(f'{prefix}(y/n): ').lower().strip()
|
37
37
|
|
38
38
|
if c == 'y':
|
@@ -1,5 +1,5 @@
|
|
1
1
|
omlish/.omlish-manifests.json,sha256=FLw7xkPiSXuImZgqSP8BwrEib2R1doSzUPLUkc-QUIA,8410
|
2
|
-
omlish/__about__.py,sha256=
|
2
|
+
omlish/__about__.py,sha256=JFsg8-NJ-oUZhhnc3zS3hNbni2_vxB5zayG1vEx5f2c,3613
|
3
3
|
omlish/__init__.py,sha256=SsyiITTuK0v74XpKV8dqNaCmjOlan1JZKrHQv5rWKPA,253
|
4
4
|
omlish/c3.py,sha256=ZNIMl1kwg3qdei4DiUrJPQe5M81S1e76N-GuNSwLBAE,8683
|
5
5
|
omlish/cached.py,sha256=MLap_p0rdGoDIMVhXVHm1tsbcWobJF0OanoodV03Ju8,542
|
@@ -205,7 +205,7 @@ omlish/diag/procfs.py,sha256=eeB3L9UpNBpAfsax3U6OczayYboPlFzOGplqlQ4gBNY,9700
|
|
205
205
|
omlish/diag/procstats.py,sha256=EJEe2Zc58ykBoTfqMXro7H52aQa_pd6uC2hsIPFceso,825
|
206
206
|
omlish/diag/ps.py,sha256=MEpMU6fbkh0bSWrOHh_okOa0JDTUSUQUVSYBdh1TGvE,1672
|
207
207
|
omlish/diag/pycharm.py,sha256=_WVmPm1E66cBtR4ukgUAaApe_3rX9Cv3sQRP5PL37P8,5013
|
208
|
-
omlish/diag/pydevd.py,sha256=
|
208
|
+
omlish/diag/pydevd.py,sha256=QfpOrVAHV7-PT3X8kLquXM7gpC-41oxIM4NtKhTdywE,7700
|
209
209
|
omlish/diag/threads.py,sha256=sjtlTl41wxssoVCDkBB6xeLF-9kJEK3eA6hmSFWJSQA,3643
|
210
210
|
omlish/diag/timers.py,sha256=cxX3GgjTIjBx9DI4pzCCO5Hfqb1TM3uo22yim7kjfRU,3831
|
211
211
|
omlish/diag/_pycharm/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
@@ -758,7 +758,7 @@ omlish/subprocesses/wrap.py,sha256=AhGV8rsnaVUMQCFYKkrjj35fs3O-VJLZC1hZ14dz3C8,7
|
|
758
758
|
omlish/term/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
759
759
|
omlish/term/codes.py,sha256=6_g4wwXP4z9koC9oEW3jSEuw27mQRf43ngD5RA-Qu2s,6390
|
760
760
|
omlish/term/coloring.py,sha256=5lV7E2fyFDixAfm4tM5MFV9vreW5RM94AgUHB9hKaVE,2598
|
761
|
-
omlish/term/confirm.py,sha256=
|
761
|
+
omlish/term/confirm.py,sha256=0Qoo-MFBWw26khMMHv92tFXFHNB9GOubfdPLi48KkkY,1054
|
762
762
|
omlish/term/progressbar.py,sha256=nCnTX1dUNCGle9FzzeTBuoxQaellErOQkyBsKVrGG1I,3679
|
763
763
|
omlish/term/vt100/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
764
764
|
omlish/term/vt100/c.py,sha256=93HARU6Dd1rVF-n8cAyXqkEqleYLcofuLgSUNd6-GbU,3537
|
@@ -826,9 +826,9 @@ omlish/typedvalues/marshal.py,sha256=2xqX6JllhtGpmeYkU7C-qzgU__0x-vd6CzYbAsocQlc
|
|
826
826
|
omlish/typedvalues/of_.py,sha256=UXkxSj504WI2UrFlqdZJbu2hyDwBhL7XVrc2qdR02GQ,1309
|
827
827
|
omlish/typedvalues/reflect.py,sha256=PAvKW6T4cW7u--iX80w3HWwZUS3SmIZ2_lQjT65uAyk,1026
|
828
828
|
omlish/typedvalues/values.py,sha256=ym46I-q2QJ_6l4UlERqv3yj87R-kp8nCKMRph0xQ3UA,1307
|
829
|
-
omlish-0.0.0.
|
830
|
-
omlish-0.0.0.
|
831
|
-
omlish-0.0.0.
|
832
|
-
omlish-0.0.0.
|
833
|
-
omlish-0.0.0.
|
834
|
-
omlish-0.0.0.
|
829
|
+
omlish-0.0.0.dev458.dist-info/licenses/LICENSE,sha256=B_hVtavaA8zCYDW99DYdcpDLKz1n3BBRjZrcbv8uG8c,1451
|
830
|
+
omlish-0.0.0.dev458.dist-info/METADATA,sha256=1ECWQXj_iU52Kb0BHM0TatXwVbcHx5q-eFY8mHzDYbU,19003
|
831
|
+
omlish-0.0.0.dev458.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
832
|
+
omlish-0.0.0.dev458.dist-info/entry_points.txt,sha256=Lt84WvRZJskWCAS7xnQGZIeVWksprtUHj0llrvVmod8,35
|
833
|
+
omlish-0.0.0.dev458.dist-info/top_level.txt,sha256=pePsKdLu7DvtUiecdYXJ78iO80uDNmBlqe-8hOzOmfs,7
|
834
|
+
omlish-0.0.0.dev458.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|