Package schrodinger :: Package application :: Package jaguar :: Package gui :: Module edit_dialog :: Class EditDialog
[hide private]
[frames] | no frames]

Class EditDialog

       object --+                    
                |                    
sip.simplewrapper --+                
                    |                
          sip.wrapper --+            
                        |            
     PyQt4.QtCore.QObject --+        
                            |        
           object --+       |        
                    |       |        
    sip.simplewrapper --+   |        
                        |   |        
 PyQt4.QtGui.QPaintDevice --+        
                            |        
          PyQt4.QtGui.QWidget --+    
                                |    
          PyQt4.QtGui.QMainWindow --+
                                    |
                                   EditDialog

A dialog that allows JaguarInput objects to be directly edited.

Nested Classes [hide private]

Inherited from PyQt4.QtGui.QMainWindow: DockOption, DockOptions

Inherited from PyQt4.QtGui.QWidget: RenderFlag, RenderFlags

Inherited from PyQt4.QtGui.QPaintDevice: PaintDeviceMetric

Instance Methods [hide private]
 
accepted(...)
A signal emitted when the user clicks OK.
 
run_requested(...)
A signal emitted when the user selects Run from the File menu.
 
restore_workspace(...)
A signal emitted when the user clicks Cancel after modifying the workspace via a preview.
 
__init__(self, parent, jag_input=None)
Create the dialog and load the specified JaguarInput object, if any.
 
loadMmJag(self, jag_input)
Load the specified JaguarInput object.
 
modeChanged(self)
Respond to the user switching between "Input file" and "Structure" via the radio buttons
str
_getFullText(self)
Update and return the current full text of the input file.
str
_getStrucText(self, text, struc_num=1, block='zmat')
Get the text block corresponding to the requested structure
str
_replaceZMatText(self, text, new_struc, struc_num=1)
Replace the zmat block for the specified structure.
str
_replaceStrucText(self, text, new_struc, struc_num=1, block='zmat')
Replace the specified structure block.
str
_replaceZVarText(self, text, new_struc, struc_num=1)
Replace the zvar block for the specified structure.
str
_removeZVarText(self, text, struc_num=1)
Remove the zvar block for the specified structure
str
_genRegex(self, struc_num=1, block='zmat')
Create a regular expression that will match the specified block.
str
_getCurrentText(self)
Get the text from the text edit and convert it to a Python string
 
accept(self)
Accept the edits and update the Jaguar panel.
 
close(self)
Close the dialog without saving it's contents.
 
preview(self)
Display the current structure in the workspace
 
help(self)
Launch help for this dialog
 
write(self)
Write the input file to disk
 
_getJagInput(self, run_preflight)
Create a JaguarInput object containing the currently specified job settings.
 
revert(self)
Revert the input script to its original state
 
convertToZMatrix(self)
Convert the structure currently in the text edit to internal coordinates (i.e.
 
convertToCartesian(self)
Convert the structure currently in the text edit to Coordinates coordinates
schrodinger.application.jaguar.input.JaguarInput
_createJagInputForStrucConversion(self)
Create a JaguarInput object containing only the current structure.
 
runJob(self)
Emit the run_requested signal with the current job settings.
 
viewAtomLabels(self, enabled)
Toggle showing atom labels.
 
error(self, msg)
Display the specified error.
 
_compareStrucs(self, struc1, struc2)
Determine if two structures have different coordinates or atom names.

Inherited from PyQt4.QtGui.QMainWindow: addDockWidget, addToolBar, addToolBarBreak, centralWidget, contextMenuEvent, corner, createPopupMenu, dockOptions, dockWidgetArea, documentMode, event, iconSize, iconSizeChanged, insertToolBar, insertToolBarBreak, isAnimated, isDockNestingEnabled, isSeparator, menuBar, menuWidget, removeDockWidget, removeToolBar, removeToolBarBreak, restoreDockWidget, restoreState, saveState, setAnimated, setCentralWidget, setCorner, setDockNestingEnabled, setDockOptions, setDocumentMode, setIconSize, setMenuBar, setMenuWidget, setStatusBar, setTabPosition, setTabShape, setToolButtonStyle, setUnifiedTitleAndToolBarOnMac, splitDockWidget, statusBar, tabPosition, tabShape, tabifiedDockWidgets, tabifyDockWidget, toolBarArea, toolBarBreak, toolButtonStyle, toolButtonStyleChanged, unifiedTitleAndToolBarOnMac

Inherited from PyQt4.QtGui.QWidget: acceptDrops, accessibleDescription, accessibleName, actionEvent, actions, activateWindow, addAction, addActions, adjustSize, autoFillBackground, backgroundRole, baseSize, changeEvent, childAt, childrenRect, childrenRegion, clearFocus, clearMask, closeEvent, contentsMargins, contentsRect, contextMenuPolicy, create, cursor, customContextMenuRequested, destroy, devType, dragEnterEvent, dragLeaveEvent, dragMoveEvent, dropEvent, effectiveWinId, enabledChange, ensurePolished, enterEvent, find, focusInEvent, focusNextChild, focusNextPrevChild, focusOutEvent, focusPolicy, focusPreviousChild, focusProxy, focusWidget, font, fontChange, fontInfo, fontMetrics, foregroundRole, frameGeometry, frameSize, geometry, getContentsMargins, grabGesture, grabKeyboard, grabMouse, grabShortcut, graphicsEffect, graphicsProxyWidget, handle, hasFocus, hasMouseTracking, height, heightForWidth, hide, hideEvent, inputContext, inputMethodEvent, inputMethodHints, inputMethodQuery, insertAction, insertActions, isActiveWindow, isAncestorOf, isEnabled, isEnabledTo, isEnabledToTLW, isFullScreen, isHidden, isLeftToRight, isMaximized, isMinimized, isModal, isRightToLeft, isTopLevel, isVisible, isVisibleTo, isWindow, isWindowModified, keyPressEvent, keyReleaseEvent, keyboardGrabber, languageChange, layout, layoutDirection, leaveEvent, locale, lower, mapFrom, mapFromGlobal, mapFromParent, mapTo, mapToGlobal, mapToParent, mask, maximumHeight, maximumSize, maximumWidth, metric, minimumHeight, minimumSize, minimumSizeHint, minimumWidth, mouseDoubleClickEvent, mouseGrabber, mouseMoveEvent, mousePressEvent, mouseReleaseEvent, move, moveEvent, nativeParentWidget, nextInFocusChain, normalGeometry, overrideWindowFlags, overrideWindowState, paintEngine, paintEvent, palette, paletteChange, parentWidget, pos, previousInFocusChain, raise_, rect, releaseKeyboard, releaseMouse, releaseShortcut, removeAction, render, repaint, resetInputContext, resize, resizeEvent, restoreGeometry, saveGeometry, scroll, setAcceptDrops, setAccessibleDescription, setAccessibleName, setAttribute, setAutoFillBackground, setBackgroundRole, setBaseSize, setContentsMargins, setContextMenuPolicy, setCursor, setDisabled, setEnabled, setFixedHeight, setFixedSize, setFixedWidth, setFocus, setFocusPolicy, setFocusProxy, setFont, setForegroundRole, setGeometry, setGraphicsEffect, setHidden, setInputContext, setInputMethodHints, setLayout, setLayoutDirection, setLocale, setMask, setMaximumHeight, setMaximumSize, setMaximumWidth, setMinimumHeight, setMinimumSize, setMinimumWidth, setMouseTracking, setPalette, setParent, setShortcutAutoRepeat, setShortcutEnabled, setShown, setSizeIncrement, setSizePolicy, setStatusTip, setStyle, setStyleSheet, setTabOrder, setToolTip, setUpdatesEnabled, setVisible, setWhatsThis, setWindowFilePath, setWindowFlags, setWindowIcon, setWindowIconText, setWindowModality, setWindowModified, setWindowOpacity, setWindowRole, setWindowState, setWindowTitle, show, showEvent, showFullScreen, showMaximized, showMinimized, showNormal, size, sizeHint, sizeIncrement, sizePolicy, stackUnder, statusTip, style, styleSheet, tabletEvent, testAttribute, toolTip, topLevelWidget, underMouse, ungrabGesture, unsetCursor, unsetLayoutDirection, unsetLocale, update, updateGeometry, updateMicroFocus, updatesEnabled, visibleRegion, whatsThis, wheelEvent, width, winId, window, windowActivationChange, windowFilePath, windowFlags, windowIcon, windowIconText, windowModality, windowOpacity, windowRole, windowState, windowTitle, windowType, x, x11Info, x11PictureHandle, y

Inherited from PyQt4.QtCore.QObject: __getattr__, blockSignals, childEvent, children, connect, connectNotify, customEvent, deleteLater, destroyed, disconnect, disconnectNotify, dumpObjectInfo, dumpObjectTree, dynamicPropertyNames, emit, eventFilter, findChild, findChildren, inherits, installEventFilter, isWidgetType, killTimer, metaObject, moveToThread, objectName, parent, property, pyqtConfigure, receivers, removeEventFilter, sender, senderSignalIndex, setObjectName, setProperty, signalsBlocked, startTimer, thread, timerEvent, tr, trUtf8

Inherited from PyQt4.QtGui.QPaintDevice: colorCount, depth, heightMM, logicalDpiX, logicalDpiY, numColors, paintingActive, physicalDpiX, physicalDpiY, widthMM

Inherited from sip.simplewrapper: __new__

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables [hide private]
  NEW_STRUCTURE = 1
  RELOAD_STRUCTURE = -1
  SAME_STRUCTURE = 0
hash(x)
  SINGLE_STRUC = 1
  WHOLE_FILE = 0
hash(x)

Inherited from PyQt4.QtGui.QMainWindow: AllowNestedDocks, AllowTabbedDocks, AnimatedDocks, ForceTabbedDocks, VerticalTabs

Inherited from PyQt4.QtGui.QWidget: DrawChildren, DrawWindowBackground, IgnoreMask

Inherited from PyQt4.QtCore.QObject: staticMetaObject

Inherited from PyQt4.QtGui.QPaintDevice: PdmDepth, PdmDpiX, PdmDpiY, PdmHeight, PdmHeightMM, PdmNumColors, PdmPhysicalDpiX, PdmPhysicalDpiY, PdmWidth, PdmWidthMM

Instance Variables [hide private]
int _cur_mode
Whether the dialog is in "Input File" mode (WHOLE_FILE) or "Structure" mode SINGLE_STRUC
str _full_text
The full text of the input file being edited.
schrodinger.structure.Structure _orig_struc
The structure that was originally read into the dialog.
str _orig_text
The text to revert back to if the user clicks Revert
bool _preview_ran
Whether or not the user has replaced the workspace via a Preview since the dialog was created.
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

accepted(...)

 
A signal emitted when the user clicks OK. It is emitted with two arguments:
  • A schrodinger.application.jaguar.input.JaguarInput object representing the current dialog contents.
  • An integer flag indicating whether the structure in the schrodinger.application.jaguar.input.JaguarInput object is new. The flag is one of:
    • SAME_STRUCTURE: If neither the structure nor the workspace contents have changed
    • NEW_STRUCTURE: If the structure has changed.
    • RELOAD_STRUCTURE: If the structure has not changed, but the workspace contents have been changed via a preview. In these cases, the workspace contents should be reset.

run_requested(...)

 
A signal emitted when the user selects Run from the File menu. This signal is emitted with one argument, a schrodinger.application.jaguar.input.JaguarInput object to run. Actually running the job is the responsibility of the parent widget.

restore_workspace(...)

 
A signal emitted when the user clicks Cancel after modifying the workspace via a preview. The parent widget is responsible for setting the workspace back to its previous state.

__init__(self, parent, jag_input=None)
(Constructor)

 

Create the dialog and load the specified JaguarInput object, if any.

Parameters:
Overrides: object.__init__

loadMmJag(self, jag_input)

 

Load the specified JaguarInput object.

Parameters:

_getFullText(self)

 

Update and return the current full text of the input file.

Returns: str
The updated input file text

_getStrucText(self, text, struc_num=1, block='zmat')

 

Get the text block corresponding to the requested structure

Parameters:
  • text (str) - The input file text to retrieve the structure from
  • struc_num (int) - The Z-matrix number to retrieve the structure for. May be 1, 2, or 3.
  • block (str) - The block of text to retrieve. This may be "zmat" or "zvar".
Returns: str
The requested text block. If no such block is present, an empty string will be returned.

_replaceZMatText(self, text, new_struc, struc_num=1)

 

Replace the zmat block for the specified structure. If there is no zmat block in text, one will be added at the end.

Parameters:
  • text (str) - The input file text to replace the zmat block in
  • new_struc (str) - The text of the new zmat block to insert
  • struc_num (int) - The Z-matrix number to replace. May be 1, 2, or 3.
Returns: str
The input file text with the requested replacement

_replaceStrucText(self, text, new_struc, struc_num=1, block='zmat')

 

Replace the specified structure block. If the specified block does not yet exist, no replacement will be made.

Parameters:
  • text (str) - The input file text
  • new_struc (str) - The new text for the specified block
  • struc_num (int) - The Z-matrix number to replace the structure for. May be 1, 2, or 3.
  • block (str) - The block of text to replace. This may be "zmat" or "zvar".
Returns: str
The input file text with the requested replacement

_replaceZVarText(self, text, new_struc, struc_num=1)

 

Replace the zvar block for the specified structure. If there is no zvar block in text, one will be added after the corresponding zmat block. If there is no zmat block, then a blank zmat block and the new zvar block will be added at the end.

Parameters:
  • text (str) - The input file text to replace the zvar block in
  • new_struc (str) - The text of the new zvar block to insert
  • struc_num (int) - The Z-matrix number to replace. May be 1, 2, or 3.
Returns: str
The input file text with the requested replacement

_removeZVarText(self, text, struc_num=1)

 

Remove the zvar block for the specified structure

Parameters:
  • text (str) - The input file text to remove the zvar block from
  • struc_num (int) - The Z-matrix number to remove. May be 1, 2, or 3.
Returns: str
The input file text with the requested block removed

_genRegex(self, struc_num=1, block='zmat')

 

Create a regular expression that will match the specified block.

Parameters:
  • struc_num (int) - The Z-matrix number to match. May be 1, 2, or 3. If the Z-matrix number is one, the number is optional, i.e. the regex will match "&zmat" or "&zmat1".
  • block (str) - The block of text to match. This may be "zmat" or "zvar".
Returns: str
The requested regular expression. Group 1 of the regular expression is the block header (e.g. "&zmat2" or "&zvar"). Group 2 of the regular expression is the block itself (i.e. the coordinates). Group 3 of the regular expression is the trailing ampersand.

_getCurrentText(self)

 

Get the text from the text edit and convert it to a Python string

Returns: str
The text from the text edit

accept(self)

 

Accept the edits and update the Jaguar panel.

Decorators:
  • @gui_utils.catch_jag_errors
Notes:

close(self)

 

Close the dialog without saving it's contents. If the user has changed the workspace, the restore_workspace signal will be emitted.

Overrides: PyQt4.QtGui.QWidget.close

preview(self)

 

Display the current structure in the workspace

Decorators:
  • @gui_utils.catch_jag_errors

write(self)

 

Write the input file to disk

Decorators:
  • @gui_utils.catch_jag_errors

_getJagInput(self, run_preflight)

 

Create a JaguarInput object containing the currently specified job settings.

Parameters:
  • run_preflight (bool) - Whether the preflight check should be run on the JaguarInput object after it's generated
Returns:
A tuple of
  • A JaguarInput object containing the currently specified job settings
  • The full text of the input file
Raises:
  • JaguarSettingError - If the preflight check catches an error. Or if there are unknown keywords present in the input file and the user does not want to continue. In this case, the user will already have been warned about the unknown keywords and should not be prompted again. As such, the error text will be blank.

convertToZMatrix(self)

 

Convert the structure currently in the text edit to internal coordinates (i.e. a Z-matrix).

Decorators:
  • @gui_utils.catch_jag_errors

convertToCartesian(self)

 

Convert the structure currently in the text edit to Coordinates coordinates

Decorators:
  • @gui_utils.catch_jag_errors

_createJagInputForStrucConversion(self)

 

Create a JaguarInput object containing only the current structure. Both the zmat block and the zvar block (if present) will be included.

Returns: schrodinger.application.jaguar.input.JaguarInput
A JaguarInput object containing only the current structure

runJob(self)

 

Emit the run_requested signal with the current job settings.

Decorators:
  • @gui_utils.catch_jag_errors

viewAtomLabels(self, enabled)

 

Toggle showing atom labels.

Parameters:
  • enabled (bool) - Whether atom labels should be turned on or off

error(self, msg)

 

Display the specified error. This function is required for the schrodinger.application.jaguar.gui.utils.catch_jag_errors decorator.

Parameters:
  • msg (str) - The error to display

_compareStrucs(self, struc1, struc2)

 

Determine if two structures have different coordinates or atom names.

Parameters:

Note: This function is noticeably less "picky" than schrodinger.structure.Structure.isEquivalent


Instance Variable Details [hide private]

_full_text

The full text of the input file being edited. Note that this variable is not kept fully up to date. The full text should always be retrieved via _getFullText.
Type:
str

_orig_struc

The structure that was originally read into the dialog. Used to determine if the user has changed the structure.
Type:
schrodinger.structure.Structure