Set the output format to a new format string
(self, fmt)
| 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 | """ |