ibm5250 0.1.0.dev13__tar.gz → 0.1.0.dev14__tar.gz
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.
- {ibm5250-0.1.0.dev13 → ibm5250-0.1.0.dev14}/PKG-INFO +1 -1
- {ibm5250-0.1.0.dev13 → ibm5250-0.1.0.dev14}/pyproject.toml +1 -1
- {ibm5250-0.1.0.dev13 → ibm5250-0.1.0.dev14}/src/ibm5250/connection.py +1 -11
- {ibm5250-0.1.0.dev13 → ibm5250-0.1.0.dev14}/src/ibm5250/datastream.py +0 -8
- {ibm5250-0.1.0.dev13 → ibm5250-0.1.0.dev14}/src/ibm5250/screen.py +0 -7
- {ibm5250-0.1.0.dev13 → ibm5250-0.1.0.dev14}/src/ibm5250/terminal.py +4 -5
- {ibm5250-0.1.0.dev13 → ibm5250-0.1.0.dev14}/uv.lock +1 -1
- {ibm5250-0.1.0.dev13 → ibm5250-0.1.0.dev14}/.github/copilot-instructions.md +0 -0
- {ibm5250-0.1.0.dev13 → ibm5250-0.1.0.dev14}/.github/workflows/README.md +0 -0
- {ibm5250-0.1.0.dev13 → ibm5250-0.1.0.dev14}/.github/workflows/publish.yml +0 -0
- {ibm5250-0.1.0.dev13 → ibm5250-0.1.0.dev14}/.gitignore +0 -0
- {ibm5250-0.1.0.dev13 → ibm5250-0.1.0.dev14}/LICENSE +0 -0
- {ibm5250-0.1.0.dev13 → ibm5250-0.1.0.dev14}/README.md +0 -0
- {ibm5250-0.1.0.dev13 → ibm5250-0.1.0.dev14}/scripts/compute_version.py +0 -0
- {ibm5250-0.1.0.dev13 → ibm5250-0.1.0.dev14}/src/ibm5250/__init__.py +0 -0
- {ibm5250-0.1.0.dev13 → ibm5250-0.1.0.dev14}/src/ibm5250/constants.py +0 -0
- {ibm5250-0.1.0.dev13 → ibm5250-0.1.0.dev14}/src/ibm5250/data-stream-logic.md +0 -0
- {ibm5250-0.1.0.dev13 → ibm5250-0.1.0.dev14}/src/ibm5250/exceptions.py +0 -0
|
@@ -180,10 +180,6 @@ class TN5250Connection:
|
|
|
180
180
|
Attempt TN5250E enhanced negotiation before falling back to basic.
|
|
181
181
|
timeout:
|
|
182
182
|
Socket timeout in seconds.
|
|
183
|
-
terminal_type:
|
|
184
|
-
Telnet terminal type reported to IBM i, which selects the display
|
|
185
|
-
device model. The default ``IBM-3477-FC`` is a 27×132 colour display;
|
|
186
|
-
monochrome types such as ``IBM-3477-FG`` make the host drop colours.
|
|
187
183
|
"""
|
|
188
184
|
|
|
189
185
|
def __init__(
|
|
@@ -196,7 +192,6 @@ class TN5250Connection:
|
|
|
196
192
|
device_name: str = "PYTERM01",
|
|
197
193
|
use_tn5250e: bool = True,
|
|
198
194
|
timeout: float = 30.0,
|
|
199
|
-
terminal_type: str = "IBM-3477-FC",
|
|
200
195
|
) -> None:
|
|
201
196
|
self.host = host
|
|
202
197
|
self.port = port
|
|
@@ -216,7 +211,7 @@ class TN5250Connection:
|
|
|
216
211
|
self._eor_sent = False
|
|
217
212
|
self._eor_rcvd = False
|
|
218
213
|
self._ttype_will_sent = False
|
|
219
|
-
self._negotiated_ttype =
|
|
214
|
+
self._negotiated_ttype = "IBM-3477-FG" # screen model reported to IBM i
|
|
220
215
|
|
|
221
216
|
# Byte 9 (opcode/var-header length) of the last received TN5250E record.
|
|
222
217
|
# Used to detect header-only Cancel-Invite records (opcode 0x0A).
|
|
@@ -462,11 +457,6 @@ class TN5250Connection:
|
|
|
462
457
|
def connected(self) -> bool:
|
|
463
458
|
return self._sock is not None
|
|
464
459
|
|
|
465
|
-
@property
|
|
466
|
-
def terminal_type(self) -> str:
|
|
467
|
-
"""Telnet terminal type reported to the host (e.g. ``IBM-3477-FC``)."""
|
|
468
|
-
return self._negotiated_ttype
|
|
469
|
-
|
|
470
460
|
@property
|
|
471
461
|
def tn5250e_active(self) -> bool:
|
|
472
462
|
"""True if TN5250E enhanced mode was successfully negotiated."""
|
|
@@ -217,11 +217,6 @@ class DataStreamParser:
|
|
|
217
217
|
yield from self._clear_unit(sub_command)
|
|
218
218
|
# A clear is usually followed by further commands (typically
|
|
219
219
|
# ESC + WTD) in the same record, so keep parsing.
|
|
220
|
-
elif sub_command == Command.CLEAR_FORMAT_TABLE:
|
|
221
|
-
# ESC 0x50 has no operands; a WTD usually follows in the
|
|
222
|
-
# same record, so keep parsing.
|
|
223
|
-
byte_offset += 1
|
|
224
|
-
yield DSEvent(type=DSEventType.COMMAND, command=sub_command)
|
|
225
220
|
elif sub_command == Command.WRITE_STRUCTURED_FIELD:
|
|
226
221
|
# ESC 0xF3 — Write Structured Field
|
|
227
222
|
byte_offset += 1
|
|
@@ -512,9 +507,6 @@ class DataStreamParser:
|
|
|
512
507
|
yield DSEvent(type=DSEventType.COMMAND, command=next_byte)
|
|
513
508
|
yield from self._clear_unit(next_byte)
|
|
514
509
|
current_buffer_position = 0
|
|
515
|
-
elif next_byte == Command.CLEAR_FORMAT_TABLE:
|
|
516
|
-
byte_offset += 2 # ESC + command; no operands
|
|
517
|
-
yield DSEvent(type=DSEventType.COMMAND, command=next_byte)
|
|
518
510
|
# ESC + WTD (0x04 0x11): embedded Write to Display sub-command
|
|
519
511
|
elif next_byte == Command.WRITE_TO_DISPLAY:
|
|
520
512
|
if byte_offset + 4 > total_bytes:
|
|
@@ -722,13 +722,6 @@ class Screen:
|
|
|
722
722
|
if 0 <= event.position < self._size:
|
|
723
723
|
self._chars[event.position] = event.attribute_value or EBCDIC_NULL
|
|
724
724
|
self._attrs[event.position] = event.attribute_value
|
|
725
|
-
# Like a real workstation, end an input field with a normal attribute so
|
|
726
|
-
# its display attribute (e.g. underline) stops at the end of the field
|
|
727
|
-
# instead of running on to the next attribute byte on the screen.
|
|
728
|
-
if event.field_format_word and event.field_length:
|
|
729
|
-
end_pos = (event.position + 1 + event.field_length) % self._size
|
|
730
|
-
self._chars[end_pos] = Attr.NORMAL
|
|
731
|
-
self._attrs[end_pos] = Attr.NORMAL
|
|
732
725
|
|
|
733
726
|
def _recalc_field_lengths(self) -> None:
|
|
734
727
|
"""Compute each field's length based on its successor's start_pos."""
|
|
@@ -676,10 +676,8 @@ class Terminal:
|
|
|
676
676
|
|
|
677
677
|
def _send_query_reply(self) -> None:
|
|
678
678
|
"""Respond to a server WSF Query with our terminal capabilities."""
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
log.debug("Sending Query Reply (%s-%s)", device_type, device_model)
|
|
682
|
-
payload = build_query_reply(device_type=device_type, device_model=device_model)
|
|
679
|
+
log.debug("Sending Query Reply (IBM-3179-2, 24x80 colour)")
|
|
680
|
+
payload = build_query_reply(device_type="3477", device_model="FG")
|
|
683
681
|
self._conn.send_record(payload, data_type=TN5250EDataType.INPUT, aid=0x88)
|
|
684
682
|
|
|
685
683
|
def _wait_for(
|
|
@@ -699,7 +697,8 @@ class Terminal:
|
|
|
699
697
|
if time.monotonic() >= deadline:
|
|
700
698
|
if fail_on_timeout:
|
|
701
699
|
raise ScreenWaitTimeout(
|
|
702
|
-
f"Timed out waiting for {desc} after {timeout or self._timeout}s"
|
|
700
|
+
f"Timed out waiting for {desc} after {timeout or self._timeout}s\n"
|
|
701
|
+
f"Current screen:\n{self._screen.get_screen_text()}"
|
|
703
702
|
)
|
|
704
703
|
else:
|
|
705
704
|
log.debug(f"Timeout reached while waiting for {desc} after {timeout or self._timeout}s, continuing anyway")
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|