LISE-B26 / pylabcontrol

pylabcontrol: Laboratory Equipment Control for Scientific Experiments.
GNU General Public License v3.0
9 stars 9 forks source link

get_config_value() in read_write_functions.py raises an error if no config file exists, should instead fail more gracefully #135

Closed asafira closed 6 years ago

asafira commented 6 years ago

Currently, if you try to load an instrument that requires a dll, but you don't have a config.txt file, we cannot import it and an exception is raised in get_config_value(). It would be great to fail more gracefully when we import those instruments, so that we can import them but can't create instances of them.

akabcenell commented 6 years ago

todo: search for all config.txt and make sure that call to dll is inside the class definition

akabcenell commented 6 years ago

Above done in 7aee1398019d1eadd2b70699836eb34e4336a46b All checks for config.txt should now occur within script class definitions, rather than at the top of the file outside of the class. This should solve this problem. Closing the issue for now, reopen it if this occurs in the future.