Source code for schrodinger.application.desmond.platforms
"""
Non-gui code related to Desmond's unavailability on some platforms.
Copyright Schrodinger, LLC. All rights reserved.
"""
# Keep this module clean of any GUI code so that it can be imported by backends
# on machines that do not have gui libraries
import sys
PLATFORM_WARNING = ('Desmond jobs can only be run on a Linux host. You can '
'submit Desmond jobs to a Linux host from a Windows or Mac '
'host.')
# These strings are values returned by sys.platform
INCOMPATIBLE_PLATFORMS = ('win32', 'darwin')
[docs]def validate_host(host):
"""
Validates whether or not a launch
host is valid for Desmond jobs. Currently
only validates localhost.
:param host: Launch host to validate
:type host: `schrodinger.job.jobcontrol.Host` object
:return: True if the selected host is valid for Desmond jobs,
False otherwise.
:rtype: bool
"""
return not (host.name == 'localhost' and
sys.platform in INCOMPATIBLE_PLATFORMS)