Skip to content

Commit

Permalink
less: Disable pipe mode on Windows
Browse files Browse the repository at this point in the history
Signed-off-by: iipeace <[email protected]>
  • Loading branch information
iipeace committed Oct 13, 2023
1 parent d0608a4 commit 4d9b53e
Showing 1 changed file with 28 additions and 1 deletion.
29 changes: 28 additions & 1 deletion guider/guider.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
__credits__ = "Peace Lee"
__license__ = "GPLv2"
__version__ = "3.9.8"
__revision__ = "231012"
__revision__ = "231013"
__maintainer__ = "Peace Lee"
__email__ = "[email protected]"
__repository__ = "https://github.com/iipeace/guider"
Expand Down Expand Up @@ -28116,6 +28116,10 @@ def doLess(inputArg=None):
elif SysMgr.inputParam:
inputArg = str(SysMgr.inputParam).split(",")
inputArg = UtilMgr.cleanItem(inputArg, True)
elif SysMgr.isWindows:
# no support pipe for windows #
SysMgr.printErr("no input for PATH")
return -1
else:
# check stdin pipe #
SysMgr.setBlock(sys.stdin, False)
Expand Down Expand Up @@ -50127,6 +50131,29 @@ def checkCmdMode():
if SysMgr.waitEnable:
SysMgr.waitUserInput(SysMgr.waitEnable, msg="DEFAULT", force=True)

# CMDTEST MODE #
if SysMgr.checkMode("cmdtest"):
SysMgr.loggingEnable = False
SysMgr.streamEnable = True
SysMgr.logoEnable = False
for i in SysMgr.getCmdSet():
print("[%s]" % i)
ret = SysMgr.launchGuider(
[i],
pipe=False,
stderr=True,
log=False,
wait=False,
logo=False,
)
time.sleep(1)
try:
os.kill(ret, signal.SIGKILL)
except SystemExit:
sys.exit(0)
except:
pass

# LIST MODE #
if SysMgr.checkMode("list"):
SysMgr.setStream(not SysMgr.streamEnable)
Expand Down

0 comments on commit 4d9b53e

Please sign in to comment.