shrinkray 25.12.27.2__py3-none-any.whl → 25.12.28.0__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: shrinkray
3
- Version: 25.12.27.2
3
+ Version: 25.12.28.0
4
4
  Summary: Shrink Ray
5
5
  Author-email: "David R. MacIver" <david@drmaciver.com>
6
6
  License: MIT
@@ -0,0 +1,33 @@
1
+ shrinkray/__init__.py,sha256=b5MvcvhsEGYya3GRXNbCJAlAL5IZHSsETLK_vtfmXRY,18
2
+ shrinkray/__main__.py,sha256=HuDZFXgD9LH3XPBK2QBvP4YkyTFJvduK9-PVtz9fKpk,11762
3
+ shrinkray/cli.py,sha256=1-qjaIchyCDd-YCdGWtK7q9j9qr6uX6AqtwW8m5QCQg,1697
4
+ shrinkray/formatting.py,sha256=tXCGnhJn-WJGpHMaLHRCAXK8aKJBbrOdiW9QGERrQEk,3121
5
+ shrinkray/problem.py,sha256=_edENYk8OC5o_2ng0WZrhIfilhlY5IuOrqt0qWBZAuM,25979
6
+ shrinkray/process.py,sha256=-eP8h5X0ESbkcTic8FFEzkd4-vwaZ0YI5tLxUR25L8U,1599
7
+ shrinkray/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
8
+ shrinkray/reducer.py,sha256=8CF_SxkfVMBxiikQKwv-rlrQawTLhQxy6QnVwIWWiws,18601
9
+ shrinkray/state.py,sha256=V5vUyBKXudLoMe3TvGJwWf6EDzdVr2TRrmdNyU13qio,29565
10
+ shrinkray/tui.py,sha256=Ovd6Kbk_cmOYJlwnjEyl6ka_2g1qJAtwxojh5CWEzNA,33001
11
+ shrinkray/ui.py,sha256=xuDUwU-MM3AetvwUB7bfzav0P_drUsBrKFPhON_Nr-k,2251
12
+ shrinkray/validation.py,sha256=piBCO-k9he_id6TWC4EHMK3GfuyPqRcNfkNJPVjxEaU,13366
13
+ shrinkray/work.py,sha256=GEZ14Kk3bvwUxAnACvY-wom2lVWaGrELMNxrDjv03dk,8110
14
+ shrinkray/passes/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
15
+ shrinkray/passes/bytes.py,sha256=2Xw6WI3d3MNJATQKpS77qywdxINlwiHt__dIdh8LCVE,20230
16
+ shrinkray/passes/clangdelta.py,sha256=0CYbBiGBpD2wlOpefe_uJnea1YU2-UMfLxKi1KPcxpY,7678
17
+ shrinkray/passes/definitions.py,sha256=TDDPimp7DE60xgidAE11npt2KicQAEi0UydIzjS9VHw,2469
18
+ shrinkray/passes/genericlanguages.py,sha256=QDUIDJbzFsAjHzTWH-sB-ioB2NhBPBtZOk8Q5ZwxA54,9859
19
+ shrinkray/passes/json.py,sha256=3EcM7bmseFZaIPUN2N8c9CZYQoKVHnYfhGG1RKrrItg,2458
20
+ shrinkray/passes/patching.py,sha256=Fo04O0hVMBLFuIP704LPCJrbjU1ITHr4lCt2HrvMsOc,7449
21
+ shrinkray/passes/python.py,sha256=3WN1lZTf5oVL8FCTGomhrCuE04wIX9ocKcmFV86NMZA,6875
22
+ shrinkray/passes/sat.py,sha256=OboY6jsKf6lph3pAFh535plvhNOVzEF8HJ66WEqsNm4,19483
23
+ shrinkray/passes/sequences.py,sha256=-5ajmMeHnS7onjjppbxLiP0F6mRSqiFI5DspBTj2x_M,2206
24
+ shrinkray/subprocess/__init__.py,sha256=qxZ19Nzizbm7H0MkKL38OqfP7U-VuOAvaqBVkmHFivY,375
25
+ shrinkray/subprocess/client.py,sha256=abBkrXaJcA6cd3l_avPuteO_kYnjU5IRG7VtlmiAJgE,9428
26
+ shrinkray/subprocess/protocol.py,sha256=di4vXIFcCSs2ej1E4Y3WeYXsNoo4VsBjEIeogf5AYQY,6336
27
+ shrinkray/subprocess/worker.py,sha256=0D719AHSF-oL5iifG6x4xYeUCMxEUZ_QXrDrogC901U,21238
28
+ shrinkray-25.12.28.0.dist-info/licenses/LICENSE,sha256=iMKX79AuokJfIZUnGUARdUp30vVAoIPOJ7ek8TY63kk,1072
29
+ shrinkray-25.12.28.0.dist-info/METADATA,sha256=pwliGh5xlyr_LLxhuqsoCnl_pl77NYLaB8EqCIt4iBU,7600
30
+ shrinkray-25.12.28.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
31
+ shrinkray-25.12.28.0.dist-info/entry_points.txt,sha256=wIZvnGyOdVeaLTiv2klnSyTe-EKkkwn4SwHh9bmJ7qk,104
32
+ shrinkray-25.12.28.0.dist-info/top_level.txt,sha256=fLif8-rFoFOnf5h8-vs3ECkKNWQopTQh3xvl1s7pchQ,10
33
+ shrinkray-25.12.28.0.dist-info/RECORD,,
shrinkray/display.py DELETED
@@ -1,75 +0,0 @@
1
- """Display utilities for shrink ray."""
2
-
3
- import shutil
4
- from collections.abc import Iterable
5
-
6
- from binaryornot.check import is_binary_string # type: ignore[import-not-found]
7
-
8
-
9
- def get_terminal_size() -> tuple[int, int]:
10
- """Get terminal size, with sensible fallbacks.
11
-
12
- Returns:
13
- (columns, lines) tuple. Defaults to (80, 24) if terminal size
14
- cannot be determined.
15
- """
16
- size = shutil.get_terminal_size(fallback=(80, 24))
17
- return (size.columns, size.lines)
18
-
19
-
20
- def to_lines(test_case: bytes) -> list[str]:
21
- """Convert a test case to displayable lines."""
22
- result = []
23
- for line in test_case.split(b"\n"):
24
- if is_binary_string(line):
25
- result.append(line.hex())
26
- else:
27
- try:
28
- result.append(line.decode("utf-8"))
29
- except UnicodeDecodeError:
30
- result.append(line.hex())
31
- return result
32
-
33
-
34
- def to_blocks(test_case: bytes, block_size: int | None = None) -> list[str]:
35
- """Convert a test case to hex blocks for display.
36
-
37
- Args:
38
- test_case: The bytes to convert
39
- block_size: Number of bytes per block. If None, automatically
40
- calculated from terminal width (each byte becomes 2 hex chars).
41
- """
42
- if block_size is None:
43
- columns, _ = get_terminal_size()
44
- # Each byte becomes 2 hex chars, leave some margin
45
- block_size = max(1, (columns - 4) // 2)
46
- return [
47
- test_case[i : i + block_size].hex()
48
- for i in range(0, len(test_case), block_size)
49
- ]
50
-
51
-
52
- def format_diff(diff: Iterable[str], max_lines: int | None = None) -> str:
53
- """Format a diff for display, truncating if too long.
54
-
55
- Args:
56
- diff: Iterable of diff lines
57
- max_lines: Maximum number of lines to include. If None, uses
58
- terminal height multiplied by a factor to allow scrolling
59
- through substantial context.
60
- """
61
- if max_lines is None:
62
- _, lines = get_terminal_size()
63
- # Allow multiple screenfuls of context for scrolling
64
- max_lines = max(lines * 20, 100)
65
- results = []
66
- start_writing = False
67
- for line in diff:
68
- if not start_writing and line.startswith("@@"):
69
- start_writing = True
70
- if start_writing:
71
- results.append(line)
72
- if len(results) > max_lines:
73
- results.append("...")
74
- break
75
- return "\n".join(results)
@@ -1,33 +0,0 @@
1
- shrinkray/__init__.py,sha256=b5MvcvhsEGYya3GRXNbCJAlAL5IZHSsETLK_vtfmXRY,18
2
- shrinkray/__main__.py,sha256=K3_s96Tyoi7SxNOyoZXkfiEoSxVBL__TJ3o2Cefadmg,11093
3
- shrinkray/cli.py,sha256=1-qjaIchyCDd-YCdGWtK7q9j9qr6uX6AqtwW8m5QCQg,1697
4
- shrinkray/display.py,sha256=WYN05uqmUVpZhwi2pxr1U-wLHWZ9KiL0RUlTCBJ1N3E,2430
5
- shrinkray/formatting.py,sha256=tXCGnhJn-WJGpHMaLHRCAXK8aKJBbrOdiW9QGERrQEk,3121
6
- shrinkray/problem.py,sha256=_edENYk8OC5o_2ng0WZrhIfilhlY5IuOrqt0qWBZAuM,25979
7
- shrinkray/process.py,sha256=-eP8h5X0ESbkcTic8FFEzkd4-vwaZ0YI5tLxUR25L8U,1599
8
- shrinkray/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
9
- shrinkray/reducer.py,sha256=t2BBjq-EZ0qBbsez4ep0tFYCkDT8RwKYnjJ2fRsXubg,20096
10
- shrinkray/state.py,sha256=owyDNiSeHKnCsgOQczSz796KEANem-4YWTmbmZBRE0w,24040
11
- shrinkray/tui.py,sha256=3RskLo6JvKdUQIHi40R5ka-F_1GkBXyA_d_SkYbLlCw,31601
12
- shrinkray/ui.py,sha256=xuDUwU-MM3AetvwUB7bfzav0P_drUsBrKFPhON_Nr-k,2251
13
- shrinkray/work.py,sha256=GEZ14Kk3bvwUxAnACvY-wom2lVWaGrELMNxrDjv03dk,8110
14
- shrinkray/passes/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
15
- shrinkray/passes/bytes.py,sha256=U1sNAuqUlsaLpRSJuS9X4H7S2jOiilTUIIE9-WjSd4k,23967
16
- shrinkray/passes/clangdelta.py,sha256=t9EQ_kc159HRs48JwB5JvlJCsiCscrZgf2nhHCZRZX0,8419
17
- shrinkray/passes/definitions.py,sha256=TDDPimp7DE60xgidAE11npt2KicQAEi0UydIzjS9VHw,2469
18
- shrinkray/passes/genericlanguages.py,sha256=ZqTfEHUTRbkm6PiTkBc_y3Q5Q0MJAnibNEiuKDOhiS0,10432
19
- shrinkray/passes/json.py,sha256=FydtjpVD3lMjp9OEwv5mu8CAz96ofGxIZOzt9o6eLUA,2586
20
- shrinkray/passes/patching.py,sha256=1uOTir3IbywKmsg6IIhSnxHFovZTdUCS-8PSwzgza00,8936
21
- shrinkray/passes/python.py,sha256=3WN1lZTf5oVL8FCTGomhrCuE04wIX9ocKcmFV86NMZA,6875
22
- shrinkray/passes/sat.py,sha256=OboY6jsKf6lph3pAFh535plvhNOVzEF8HJ66WEqsNm4,19483
23
- shrinkray/passes/sequences.py,sha256=jCK1fWBxCz79u7JWSps9wf7Yru7W_FAsJwdgg--CLxU,3040
24
- shrinkray/subprocess/__init__.py,sha256=FyV2y05uwQ1RTZGwREI0aAVaLX1jiwRcWsdsksFmdbM,451
25
- shrinkray/subprocess/client.py,sha256=erqnPglPO0YNdwEKlmhB3yDo6Mfc00Lxh4T85lZhsDo,9341
26
- shrinkray/subprocess/protocol.py,sha256=LuHl0IkKpDzYhAGZz_EiTHNqDNq_v1ozg5aUSl7UzE4,6203
27
- shrinkray/subprocess/worker.py,sha256=ke-9DYFH117EpJEntkucTrn7ep7pygzmV-VXkRe1o-E,19294
28
- shrinkray-25.12.27.2.dist-info/licenses/LICENSE,sha256=iMKX79AuokJfIZUnGUARdUp30vVAoIPOJ7ek8TY63kk,1072
29
- shrinkray-25.12.27.2.dist-info/METADATA,sha256=-rrEVZeXrERITn0adTTOOi6Ui7fK6Dz-GvyFEQcHvtw,7600
30
- shrinkray-25.12.27.2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
31
- shrinkray-25.12.27.2.dist-info/entry_points.txt,sha256=wIZvnGyOdVeaLTiv2klnSyTe-EKkkwn4SwHh9bmJ7qk,104
32
- shrinkray-25.12.27.2.dist-info/top_level.txt,sha256=fLif8-rFoFOnf5h8-vs3ECkKNWQopTQh3xvl1s7pchQ,10
33
- shrinkray-25.12.27.2.dist-info/RECORD,,