1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-11-04 08:17:17 -05:00
elinks/doc/tools/elinks_dos.py
Witold Filipczyk 7b2932354e [doc] Wrapper for elinks binary under dosemu
It filters out startup messages of dosemu.
2023-07-08 18:21:50 +02:00

17 lines
451 B
Python
Executable File

#!/usr/bin/python3
import os
import sys
if __name__ == '__main__':
was_elinks = False
d = os.path.dirname(os.getenv('ELINKS_BINARY'))
with os.popen('dosemu -dumb -K {0} -E "elinks {1}"'.format(d, sys.argv[1]), 'r') as fi:
for line in fi:
if not was_elinks:
if not line.startswith('ELinks'):
continue
was_elinks = True
print(line, end='')
sys.exit(0)