mirror of
https://github.com/BOSWatch/BW3-Core.git
synced 2025-12-06 07:12:04 +01:00
added skipLinesUntil() to processManager
This commit is contained in:
parent
bbe02b7459
commit
1295984aff
|
|
@ -91,11 +91,24 @@ class ProcessManager:
|
||||||
return line
|
return line
|
||||||
return None
|
return None
|
||||||
|
|
||||||
def skipLines(self, line_cnt=1):
|
def skipLines(self, lineCount=1):
|
||||||
logging.debug("skip %d lines from output", line_cnt)
|
"""!Skip given number of lines from the output
|
||||||
while line_cnt:
|
|
||||||
|
@param lineCount: number of lines to skip
|
||||||
|
"""
|
||||||
|
logging.debug("skip %d lines from output", lineCount)
|
||||||
|
while lineCount:
|
||||||
self.readline()
|
self.readline()
|
||||||
line_cnt -= 1
|
lineCount -= 1
|
||||||
|
|
||||||
|
def skipLinesUntil(self, matchText):
|
||||||
|
"""!Skip lines from the output until the given string is in it
|
||||||
|
|
||||||
|
@param matchText: string to search for in output
|
||||||
|
"""
|
||||||
|
logging.debug("skip lines till %s from output", matchText)
|
||||||
|
while not matchText in self.readline():
|
||||||
|
pass
|
||||||
|
|
||||||
def setStdin(self, stdin):
|
def setStdin(self, stdin):
|
||||||
"""!Set the stdin stream instance"""
|
"""!Set the stdin stream instance"""
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue