Closed ondras12345 closed 4 months ago
As mentioned in #12, TME seems to be the issue here. I simply accept "invalid" language codes now, if the TME api supports them. So you should set language: cz
for TME.
You can override this setting only for TME btw, by defining it in the tme
section in suppliers.yaml
.
It still says
$ inventree-part-import -o tme ESD5Z3.3T1G
error: failed to load 'TME' supplier module (invalid language code 'cz')
Usage: inventree-part-import [OPTIONS] [INPUTS]...
Try 'inventree-part-import --help' for help.
Error: Invalid value for '-o' / '--only': 'tme' is not one of .
No matter whether I set language: CZ
in config.yaml
or suppliers.yaml
.
Ah great so this is an internal TME bug ...
Their Utils/GetCountries
API endpoint returns:
['ar', 'bg', 'cs', 'de', 'el', 'en', 'es', 'et', 'fi', 'fr', 'hr', 'hu', 'it', 'ja', 'ko', 'lt', 'lv', 'nl', 'pl', 'pt', 'ro', 'ru', 'sk', 'sl', 'sv', 'tr', 'uk', 'vi', 'zh']
I've added a url check for tme.eu/cs/
now and I am just replacing that with tme.eu/cz/
. Ugly, but should hopefully do the trick.
So language: cs
should work now after all.
Thanks, working with language: cs
.
When setting this in my
config.yaml
:Links for TME parts are generated like this: https://www.tme.eu/cs/details/esd5z3.3t1g/transil-diody-jednosmerne-smd/onsemi/ Whereas the correct link is: https://www.tme.eu/cz/details/esd5z3.3t1g/transil-diody-jednosmerne-smd/onsemi/
Previously, I worked around this by setting
which is not a valid ISO639 code. The new version (as of f6e8cf9) correctly complains about this:
However, this means that I can no longer get a working link.