-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Whitespace handling in search string #75
Comments
Hello @markusEmm123 This is a rather weird one. So actually |
Yes, it's pretty much possible that Chrome does strange things when i select not exactly to the end of the line. Or maybe it catches ne newline-character when selecting the line up to the end. |
@markusEmm123 Yes maybe it is the case. I'm not really sure I want to clean up the input part number for all copy-paste manipulation ambiguity. Were you able to try a different copy-paste technique to make it work? |
The easy solution was deleting the whitespace(s) manually from the input field. |
Yes input part number is treated as a string, however I'm reluctant of the idea of using any post processing function on the input string to avoid altering it. |
Thank you for the information. I won't complain about an otherwise really great tool, please keep up the good work! |
Thanks, let's keep an eye on this if it comes up often we can get that proposed fix in |
Description
When i copy an article number from the mouser site and copy it to the search field, e.g.
"614-SMTU2032-LF", it copies the trailing \n with the article number.
This creates an error when searching.
Error message
Traceback (most recent call last):
File "c:\users\username\appdata\local\programs\python\python37-32\lib\runpy.py", line 193, in _run_module_as_main
"main", mod_spec)
File "c:\users\username\appdata\local\programs\python\python37-32\lib\runpy.py", line 85, in run_code
exec(code, run_globals)
File "C:\Users\Username\AppData\Local\Programs\Python\Python37-32\Scripts\kintree.exe_main.py", line 7, in
File "c:\users\username\appdata\local\programs\python\python37-32\lib\site-packages\kintree\kintree_gui.py", line 1046, in main
part_supplier_info = inventree_interface.supplier_search(values['supplier'], values['part_number'])
File "c:\users\username\appdata\local\programs\python\python37-32\lib\site-packages\kintree\database\inventree_interface.py", line 326, in supplier_search
part_info = search_api.load_from_file(search_filename, test_mode)
File "c:\users\username\appdata\local\programs\python\python37-32\lib\site-packages\kintree\search\search_api.py", line 14, in load_from_file
part_data = config_interface.load_file(search_file)
File "c:\users\username\appdata\local\programs\python\python37-32\lib\site-packages\kintree\config\config_interface.py", line 14, in load_file
with open(file_path, 'r') as file:
OSError: [Errno 22] Invalid argument: 'C:/Users/username/[..somepath...]/KinTree/cache\search\Mouser_614-SMTU2032-LF\n.yaml'
Expected Behaviour
Trim whitespaces in search field.
The text was updated successfully, but these errors were encountered: