schrodinger.application.livedesign.login module¶
Login page of the Maestro LiveDesign Export GUI.
Copyright Schrodinger, LLC. All rights reserved.
- class schrodinger.application.livedesign.login.Version(major, minor)¶
Bases:
tuple
- __contains__(key, /)¶
Return key in self.
- __len__()¶
Return len(self).
- count(value, /)¶
Return number of occurrences of value.
- index(value, start=0, stop=9223372036854775807, /)¶
Return first index of value.
Raises ValueError if the value is not present.
- major¶
Alias for field number 0
- minor¶
Alias for field number 1
- class schrodinger.application.livedesign.login.LDMode(value)[source]¶
Bases:
str
,enum.Enum
Enumerate the different LiveDesign modes.
- DRUG_DISCOVERY = 'DRUG_DISCOVERY'¶
- MATERIALS_SCIENCE = 'MATERIALS_SCIENCE'¶
- schrodinger.application.livedesign.login.download_ld_client(url, tmp_dir, tar_filename, glob_path, timeout=None)[source]¶
Download the ld client under tmp_dir. :param url: url of the ld client :type url: str
- Parameters
tmp_dir (str) – Directory under which ld client will be downloaded
tar_filename (str) – tar filename of the client (without
tar.gz
ext)glob_path (str) – glob path with wildcards (ex:
ldclient-*
)timeout (int or NoneType) – Timeout for the download request (in secs)
- Returns
Returns the path to the client
- Return type
str
- Raises
Exception – Raises RuntimeError in case of any error
- schrodinger.application.livedesign.login.remove_previous_existing_files(dirpath, name)[source]¶
This helper method removed all files and directories matching the given name in the directory specified by dirpath.
- Parameters
dirpath – Path to the directory under which the files needs to be removed
name (str) – to match any files or directories in the form of ‘name*’
- schrodinger.application.livedesign.login.required_login_info_set() bool [source]¶
- Returns
whether the necessary information is cached to initialize a new
LDClient
instance
- schrodinger.application.livedesign.login.get_ld_client_and_models()[source]¶
Returns a new instance of ldclient.client.LDClient() and ld_client.models using the login credentials and the host server set in the Live Design login panel. If the instantiation was unsuccessful, the first object in the tuple will hold the error msg - otherwise, it will hold an empty str.
- Returns
tuple of error msg str, new instance of the LD Client, and the ldclient.models module
- Return type
(str, ldclient.client.LDClient(), ldclient.models)
- schrodinger.application.livedesign.login.format_host(host)[source]¶
Format the given host. Adds ‘https’ protocol if none, and removes any trailing ‘/’s
- Parameters
host (str) – LiveDesign server host
- Returns
Formatted host
- Return type
str
- schrodinger.application.livedesign.login.get_host()[source]¶
- Returns
the host for the current session
- Return type
str
- schrodinger.application.livedesign.login.get_credentials()[source]¶
- Returns
the username and password for the current session
- Return type
tuple(str, str)
- schrodinger.application.livedesign.login.get_username()[source]¶
- Returns
the username for the current session
- Return type
str
- schrodinger.application.livedesign.login.get_LD_version(ld_client=None)[source]¶
Given an LDClient instance, return the LD version number.
- Parameters
ld_client (ld_client.LDClient or NoneType) – optionally, an instance of the LDClient
- Returns
the version of the LD server
- Return type
- schrodinger.application.livedesign.login.get_LD_mode(ld_client)[source]¶
Given an LDClient instance, return the LD instance mode. For example, if the instance is in DRUG_DISCOVERY or MATERIAL_SCIENCE mode, etc. Note, that for older LD versions (< 8.6), there was no concept of a LD mode, and thus we assume the default mode of DRUG_DISCOVERY.
- Parameters
ld_client (
ld_client.LDClient
) – instance of the LDClient- Returns
the server mode.
- Return type
str