PyFixate / Fixate

Framework for hardware test fixtures and automatic test environments
MIT License
22 stars 16 forks source link

Add logging of ftdi instruments #170

Closed John2202W closed 1 year ago

John2202W commented 1 year ago

Add logging of FTDI instruments. Allow substring matching to the ftdi description. (more details - CPE2543)

clint-lawrence commented 1 year ago

I don't anticipate this being a problem, but I occurred to me that you can't prevent a substring matching. For example if we had two devices, "abc" and "abcd", and you really wanted to only open "abc", not "abcd" there is no way to specify that. I can't imagine a realistic scenario where that would come up.

Could use fnmatch to add wildcard matching or a regex if we need to.

John2202W commented 1 year ago

Have changed to regex to give more flexibility if/when needed. Still up to the test-script author to prevent unwanted substrings e.g ftdi.open(r"abc\-?\d? Some Description$")

clint-lawrence commented 1 year ago

What about using re.fullmatch instead of re.match? With that the existing behavior of strict matching will be maintained, but allows more flexible matching going forward.

John2202W commented 1 year ago

Updated ^

clint-lawrence commented 1 year ago

Looks good to me

jcollins1983 commented 1 year ago

Looks good. I can merge once the conflict on the release notes in resolved from the merge of PR #169