MCPcopy
hub / github.com/USArmyResearchLab/Dshell / set_format

Method set_format

dshell/output/output.py:107–114  ·  view source on GitHub ↗

Set the output format to a new format string

(self, fmt)

Source from the content-addressed store, hash-verified

105 self.set_format(format)
106
107 def set_format(self, fmt):
108 """Set the output format to a new format string"""
109 # Use a regular expression to identify all fields that the format will
110 # populate, based on limited printf-style formatting.
111 # https://docs.python.org/3/library/stdtypes.html#old-string-formatting
112 regexmatch = "%\((?P<field>.*?)\)[diouxXeEfFgGcrs]"
113 self.format_fields = re.findall(regexmatch, fmt)
114 self.format = fmt
115
116 def _increment_filename(self, filename):
117 """

Callers 5

__init__Method · 0.95
set_oargsMethod · 0.95
mainFunction · 0.45
writeMethod · 0.45
writeMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected