For pytmc template, always use a colon delimiter, regardless of the platform.
That means that the input file should be of the form: input_filename:output_filename on Windows, Mac, Linux.
(Previously this could have been input_filename;output_filename on Windows)
Some special handling is then required to parse these appropriately, since Windows paths can have colons in them. Two absolute paths could then look like C:\a\b.c.txt:C:\d\e\f.txt - confusingly enough. The algorithm here checks to see if the first file exists in the case where the delimiter itself is ambiguous.
A quicker hack/fix is already out on plcprog-console: (filename.rsplit(":", 1)) - because we only use one absolute filename, the output is relative to the IOC directory.
I don't think this is the cleanest solution, but it is a solution...
Closes https://github.com/pcdshub/pytmc/issues/299
For
pytmc template
, always use a colon delimiter, regardless of the platform. That means that the input file should be of the form:input_filename:output_filename
on Windows, Mac, Linux. (Previously this could have beeninput_filename;output_filename
on Windows)Some special handling is then required to parse these appropriately, since Windows paths can have colons in them. Two absolute paths could then look like
C:\a\b.c.txt:C:\d\e\f.txt
- confusingly enough. The algorithm here checks to see if the first file exists in the case where the delimiter itself is ambiguous.A quicker hack/fix is already out on plcprog-console: (
filename.rsplit(":", 1)
) - because we only use one absolute filename, the output is relative to the IOC directory.I don't think this is the cleanest solution, but it is a solution...