-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy path_common.py
More file actions
60 lines (20 loc) · 842 Bytes
/
Copy path_common.py
File metadata and controls
60 lines (20 loc) · 842 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
from jk_cmdoutputparsinghelper.TextData import TextData
from .TextDataProcessingPolicy import TextDataProcessingPolicy
from ._DebugValveToFile import _DebugValveToFile
DEFAULT_STDOUT_PROCESSING = TextDataProcessingPolicy(True, True, True)
DEFAULT_STDERR_PROCESSING = TextDataProcessingPolicy(True, True, True)
debugValve = None
def enableDebugging(debuggingFilePath:str):
global debugValve
debugValve = _DebugValveToFile(debuggingFilePath)
#
def processCmdOutput(textData:str, policy:TextDataProcessingPolicy) -> TextData:
textData = TextData(textData)
if policy.bRightTrimLines:
textData.lines.rightTrimAllLines()
if policy.bRemoveLeadingEmptyLines:
textData.lines.removeLeadingEmptyLines()
if policy.bRemoveTrailingEmptyLines:
textData.lines.removeTrailingEmptyLines()
return textData
#