Skip to content
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

Closed

Conversation

juliambrosman
Copy link

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.

… start_lims function

Makes genologics.config work with python3, fixes alternative config
option.
@rernst
Copy link

rernst commented Aug 10, 2017

Thanks for sharing!

from genologics.lims import Lims
from sys import version_info

if version_info.major == 2:
Copy link

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
Copy link

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):
Copy link

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):
Copy link

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 ?

@Galithil
Copy link

This is now handled in the main branch.

@Galithil Galithil closed this Feb 12, 2018
@juliambrosman juliambrosman deleted the sci-life-lab_fix_config branch December 5, 2022 16:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants