Commit b44a00b3b5fc6606134105c58d06f80bb4a55415
1 parent
22f22175
Exists in
master
Testing python build using windows + MSVC.
Showing
4 changed files
with
30 additions
and
19 deletions
Show diff stats
.gitignore
setup.py
| ... | ... | @@ -3,11 +3,19 @@ import platform |
| 3 | 3 | |
| 4 | 4 | include_dirs = ['src/include'] |
| 5 | 5 | library_dirs = [] |
| 6 | +extra_link_args = [] | |
| 6 | 7 | |
| 7 | 8 | if platform.system() == 'Windows': |
| 8 | 9 | include_dirs.append(os.getenv('PW3270_SDK_PATH') + '/include') |
| 9 | 10 | library_dirs.append(os.getenv('PW3270_SDK_PATH') + '/lib') |
| 10 | 11 | |
| 12 | + with open(os.getenv('PW3270_SDK_PATH') + "\\lib3270.mak") as file: | |
| 13 | + text = file.readlines() | |
| 14 | + | |
| 15 | + for line in text: | |
| 16 | + if line.startswith("LIB3270_NAME="): | |
| 17 | + extra_link_args.append("/delayload:" + line.split("=")[1].rstrip("\r").rstrip("\n") + ".dll") | |
| 18 | + | |
| 11 | 19 | tn3270 = Extension( |
| 12 | 20 | 'tn3270', |
| 13 | 21 | define_macros = [ |
| ... | ... | @@ -17,6 +25,7 @@ tn3270 = Extension( |
| 17 | 25 | include_dirs = include_dirs, |
| 18 | 26 | libraries = ['ipc3270'], |
| 19 | 27 | library_dirs=library_dirs, |
| 28 | + extra_link_args=extra_link_args, | |
| 20 | 29 | sources = [ |
| 21 | 30 | 'src/action/type.c', |
| 22 | 31 | 'src/module/init.c', | ... | ... |
testprograms/sample.py
| ... | ... | @@ -4,27 +4,25 @@ |
| 4 | 4 | #import inspect |
| 5 | 5 | import tn3270 |
| 6 | 6 | |
| 7 | -class Host(tn3270.Session): | |
| 8 | - | |
| 9 | - def __init__(self): | |
| 10 | - | |
| 11 | - super().__init__(":a") | |
| 12 | - print("Using tn3270 version " + self.version + " revision " + self.revision) | |
| 13 | - | |
| 14 | - def reconnect(self): | |
| 15 | - if super().reconnect.activatable: | |
| 16 | - print("Reconnecting...") | |
| 17 | - super().reconnect().wait(10) | |
| 18 | - | |
| 19 | - | |
| 20 | -host = Host() | |
| 21 | - | |
| 22 | -host.reconnect() | |
| 23 | - | |
| 7 | +#class Host(tn3270.Session): | |
| 8 | +# | |
| 9 | +# def __init__(self): | |
| 10 | +# | |
| 11 | +# super().__init__(":a") | |
| 12 | +# print("Using tn3270 version " + self.version + " revision " + self.revision) | |
| 13 | +# | |
| 14 | +# def reconnect(self): | |
| 15 | +# if super().reconnect.activatable: | |
| 16 | +# print("Reconnecting...") | |
| 17 | +# super().reconnect().wait(10) | |
| 18 | +# | |
| 19 | +#host = Host() | |
| 20 | +#host.reconnect() | |
| 24 | 21 | |
| 22 | +print("Testing python module") | |
| 25 | 23 | |
| 26 | -#print("Using TN3270 Version " + tn3270.version()) | |
| 27 | -#print(tn3270.revision()) | |
| 24 | +print("Using TN3270 Version " + tn3270.version()) | |
| 25 | +print(tn3270.revision()) | |
| 28 | 26 | |
| 29 | 27 | #session = tn3270.Session("") |
| 30 | 28 | #session.timeout = 10 | ... | ... |