schrodinger.application.livedesign.ld_base_classes module

Base classes used for LiveDesign import/export GUIs.

Copyright Schrödinger, LLC. All rights reserved.

exception schrodinger.application.livedesign.ld_base_classes.HandledError

Bases: exceptions.Exception

class schrodinger.application.livedesign.ld_base_classes.ImportExportBasePanel(*args, **kwargs)

Bases: schrodinger.ui.qt.appframework2.wizards.BaseWizardPanel

Main panel for specifying how to import or export the data to/from LD.

The following signals may be emitted for updating status text and color during export process.

TITLE_BASE = ''
allow_add_live_reports = True
clearLR()

Meant to be called when switching between LD Input combo box options. Resets data entered into the panel so that the source of the LiveReport will be unambiguous.

errorRaised
evaluateURL()

Parse the URL in the URL line edit and extract information about the specified Live Report. If it is valid, return the project ID and the LR ID. Otherwise, return (None, None) and create a helpful popup.

Returns:a tuple containing the project ID and Live Report ID, or else (None, None)
Return type:(int, int) or (None, None)
getUserURL()

Return the text entered into the URL line edit, stripped of whitespace.

Returns:the text in the text box, without bordering whitespace
Return type:str
infoUpdated
initLayOut()

See parent class for method documentation.

initSetDefaults()
initSetUp()
loadLiveReports()

Fetch the project’s live reports and load them into the combo box.

onLRSortMethodChanged(sort_value)

Store the selected sort method in response to the user selecting a new LiveReport sort method.

Parameters:sort_value – an enum value associated with a sort method
onLiveReportSelected(lr_id)

Slot invoked when a Live Report is chosen from the combobox.

Parameters:lr_id (str) – id of current live report chosen in tree view.
onNoProjectSelected()

Slot invoked when no project is selected in the combobox.

onProjectSelected(proj_name, proj_id)

Slot invoked when a project is chosen from combobox.

Parameters:
  • proj_name (str) – the selected project name
  • proj_id (int) – the selected project id
onURLEntered()

Parse data from the URL line edit and import the specified Live Report column names.

Meant to be called automatically when the user finishes editing in the URL line edit.

processPrevPanel(state)

This is called in BaseWizardPanel.run method.

Parameters:state (af2.settings.PanelState) – State of the previous panel
processSettings(settings=None, runner=None)

See parent class for method documentation.

processTaskMessage(message_type, text, options=None, runner=None)

This method is used as a callback to the task runner, and emits signals to interact with the main GUI. Signals are used here, instead of directly interacting with the GUI, which causes threading and parenting issues.

Parameters:
  • message_type (int) – the type of message being sent
  • text (str) – the main text to show the user
  • options (dict) – extra options
  • runner (tasks.ThreadRunner) – Task runner.
questionRaised
reject()

See parent class for more info. Resets the custom LiveReport combo box as the SettingsPanelMixin will not know how to set the default option.

setLiveReportDefaults()

Reset current live report selection and anything that depends on it.

setupStatusBar()

Set up the status bar with the help topic and product for the help icon. A separate parent for the status bar is created so the help dialog is opened correctly.

Note: The help topic is set here so an auto help dialog button isn’t added next to the ‘Back’ button.

setupTaskMessagingSignals()

Connect the signals for showing QMessageBoxes to the user or updating the status bar message from processTaskMessage().

setupTaskWidget()

Set up the task widget and thread runner.

statusChanged
warningRaised
class schrodinger.application.livedesign.ld_base_classes.ImportExportThreadRunner(*args, **kwargs)

Bases: schrodinger.ui.qt.appframework2.tasks.ThreadRunner

errorHandler(*args, **kwds)

A context manager for handling errors - catches a few specific error types, creating an error message as a function of the error type and calling. Reraises HandledError(error_msg) if any errors are caught.

Raise:HandledError if any errors are caught.
process_type = 'import/export'
setErrorStatus(curr_name, error_msg)

Update self.status and self.error with the proper error messages. :param curr_name: the name of the task that is reporting the error :param error_msg: the error message

use_event_loop = True
class schrodinger.application.livedesign.ld_base_classes.SwallowEnterFilter

Bases: PyQt5.QtCore.QObject

eventFilter(widget, event)

Swallow certain key presses so that if the user presses “Return” or “Enter” while widget is in focus, the only result will be that widget loses focus, and the key press event will not be propagated.

Parameters:
  • widget (QtWidgets.QWidget) – the widget being watched by this event filter
  • event (QtCore.QEvent) – an event
Returns:

True if the event should be ignored, False otherwise

Return type:

bool