Skip to content

Update to x3270 3.6ga8 #9

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 19 additions & 6 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,26 @@ Pre-requisites:
---------------

* Python libraries: py3270 (v0.3.4), colorama, IPython
These can be installed with pip or easy_install.
Until py3270 accepts this pull request (https://github.com/py3270/py3270/pull/13) use my py3270 library (https://github.com/singe/py3270).
* Sources of x3270 client (v3.6ga8)

* Hacked x3270 client (v3.6)
The patches are included. You can download the source at http://x3270.bgp.nu/download.html then cd to the suite3270 directory once extracted, and patch -p1 < suite3270-full.patch
You can use an unmodified client, but then you will not be able to edit protected fields.
The patch makes two changes, the first is to allow protected fields to be edited, the other is to make hidden fields visible (shown in reverse text highlighting). This functionality is split into two other patched if you would only like one or the other for some reason.
How-to:
---------------

```
# Check the requirements
apt update
apt install libssl-dev libxmu-dev libxaw7-dev tcl-dev python-pip
pip install py3270 colorama IPython

# Install BIRP and x3270 (patched)
# You can download x3270 sources here: https://sourceforge.net/projects/x3270/files/x3270/3.6ga8/suite3270-3.6ga8-src.tgz/download
git clone git@github.com:psmet/birp.git
cd suite3270/
patch -p1 < ../birp/suite3270-full.patch
./configure
make
make install
```

Design Choices
--------------
Expand Down
16 changes: 8 additions & 8 deletions py3270wrapper.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env python

from py3270 import Emulator,CommandError,FieldTruncateError,TerminatedError,WaitError,KeyboardStateError,FieldTruncateError,x3270App,s3270App
from py3270 import Emulator,CommandError,FieldTruncateError,TerminatedError,WaitError,KeyboardStateError,FieldTruncateError,X3270App,S3270App
import platform
from time import sleep
from sys import exit
Expand Down Expand Up @@ -79,19 +79,19 @@ def get_hostinfo(self):
# Set the emulator intelligently based on your platform
if platform.system() == 'Darwin':
class WrappedEmulator(EmulatorIntermediate):
x3270App.executable = './x3270'
s3270App.executable = 's3270'
X3270App.executable = 'x3270'
S3270App.executable = 's3270'
elif platform.system() == 'Linux':
class WrappedEmulator(EmulatorIntermediate):
x3270App.executable = './x3270'
s3270App.executable = 's3270'
X3270App.executable = 'x3270'
S3270App.executable = 's3270'
elif platform.system() == 'Windows':
class WrappedEmulator(EmulatorIntermediate):
#x3270_executable = 'Windows_Binaries/wc3270.exe'
x3270App.executable = 'wc3270.exe'
X3270App.executable = 'wc3270.exe'
else:
logger('Your Platform:', platform.system(), 'is not supported at this time.',kind='err')
sys.exit(1)
if not path.isfile(x3270App.executable):
print("Can't find the x3270 executable at "+x3270App.executable+" You can configure the location at the bottom of py3270wrapper.py")
if not path.isfile(X3270App.executable):
print("Can't find the x3270 executable at "+X3270App.executable+" You can configure the location at the bottom of py3270wrapper.py")
exit(1)
Loading