Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
Please login to access the resource
openSUSE:Leap:15.0:Update
retext.2332
retext-6.0.0-disable-reading-from-stdin-by-defa...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File retext-6.0.0-disable-reading-from-stdin-by-default.patch of Package retext.2332
Index: retext-6.0.0/retext.py =================================================================== --- retext-6.0.0.orig/retext.py +++ retext-6.0.0/retext.py @@ -32,7 +32,7 @@ from PyQt5.QtWidgets import QApplication from PyQt5.QtNetwork import QNetworkProxyFactory def canonicalize(option): - if option == '--preview': + if option in ('--preview', '-'): return option return QFileInfo(option).canonicalFilePath() @@ -77,6 +77,7 @@ def main(): # need to have a list of canonical names before loading fileNames = list(map(canonicalize, sys.argv[1:])) previewMode = False + readStdIn = False for fileName in fileNames: if QFile.exists(fileName): window.openFileWrapper(fileName) @@ -85,7 +86,13 @@ def main(): window.preview(True) elif fileName == '--preview': previewMode = True - inputData = '' if (sys.stdin is None or sys.stdin.isatty()) else sys.stdin.read() + elif fileName == '-': + readStdIn = True + inputData = '' + if readStdIn and sys.stdin is not None: + if sys.stdin.isatty(): + print('Reading stdin, press ^D to end...') + inputData = sys.stdin.read() if inputData or not window.tabWidget.count(): window.createNew(inputData) signal.signal(signal.SIGINT, lambda sig, frame: window.close())
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor