-
Notifications
You must be signed in to change notification settings - Fork 43
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
alternative configuration file option fixed, python3 compatible, adds start_lims function #202
alternative configuration file option fixed, python3 compatible, adds start_lims function #202
Conversation
… start_lims function Makes genologics.config work with python3, fixes alternative config option.
Thanks for sharing! |
from genologics.lims import Lims | ||
from sys import version_info | ||
|
||
if version_info.major == 2: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not compatible with python 2.6, please use version_info[0]
sys.exit(-1) | ||
|
||
if startup and config_file is None: | ||
return warnings.warn("Config File Not Found"), None, None, None, None |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warnings.warn returns None, and if there is no exit, then the caller will see a warning, but still end up with seemingly populated BASEURI, USERNAME, PASSWORD, VERSION, MAIN_LOG, but they will all contain None.
I don't really agree with that, as the current method hard-exits if there is no configuration file, it should be the same for providing a different config file.
return BASEURI, USERNAME, PASSWORD, VERSION, MAIN_LOG | ||
|
||
|
||
def start_lims(config=None): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think that code related to instantiating a LIMS object belongs in the config module.
def load_config(specified_config = None): | ||
if specified_config != None: | ||
|
||
def load_config(specified_config = None, startup=True): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor, but would you mind keeping the same spacing rule for the two arguments ?
This is now handled in the main branch. |
To fix this issue: #201
We’ve been using a version of the start_lims function outside of this package to solve this issue. It hadn’t been backwards compatible so I did not submit a pull request, but I just made a couple changes that should make it backwards compatible.
Makes genologics.config work with python3, fixes alternative config
option.