Package schrodinger :: Package ui :: Package qt :: Module appframework :: Class JobInputFrame
[hide private]
[frames] | no frames]

Class JobInputFrame

       object --+                    
                |                    
sip.simplewrapper --+                
                    |                
          sip.wrapper --+            
                        |            
     PyQt4.QtCore.QObject --+        
                            |        
           object --+       |        
                    |       |        
    sip.simplewrapper --+   |        
                        |   |        
 PyQt4.QtGui.QPaintDevice --+        
                            |        
          PyQt4.QtGui.QWidget --+    
                                |    
               PyQt4.QtGui.QFrame --+
                                    |
                                   JobInputFrame


An application input source selection widget. 

Allows the user to choose the source of the job input:  Project Table,
files, or Workspace (which is not included entries, just the Workspace
ct).

Configuration options set via constructor keywords are...

    filetypes -    If file input allowed, the file filters used in the
                   askopenfilename.  List of tuples.  Default is
                   [('Maestro Files', '*.mae')].
    initialdir -   If file input allowed, the default initial directory
                   in the askopenfilename.  Default is '.'.
    file -         Allow an external file as an input source.  Default is
                   True.
    selected_entries - Allow the selected Project Table entries to be used
                   as an input source.  Maestro only.  Default is True.
    included_entries - Allow the included Project Table entries to be used
                   as an input source. Maestro only. Default is False.
    included_entry - Allow the single included Project Table entry to be
                   used as an input source. An error is presented if more 
                   than one entry is included. Properties are preserved.
                   Maestro only. Default is False.
    workspace -    Allow the Workspace structure as an input source. If
                   more than one entry is included, they are merged and
                   CT-level properties are dropped.
                   Maestro only. Default is True. Consider using the 
                   'included_entries' or 'included_entry' instead.
    
    default_source - What the default source should be. Must be one of:
                     "file", "selected_entries", "included_entries", 
                     "included_entry", or "workspace". 
                     Default is "selected_entries", if enabled; if not,
                     then "file" (if enabled)
    
    writefile -    Automatically generate the '<jobname>.<ext>' file from
                   WS/PT/FILE source. Default is True.
                   If True:
                     The written file name is stored as 'inputstrucfile' 
                     in the JobParameters object. For FILE source, original
                     file path is also stored as 'inputstrucorigfile'.
                   If False:
                     For FILE source, store file path to "inputstrucfile"
                     For WORKSPACE and INCLUDED_ENTRY sources, store 
                     structure to "inputstruc". For SELECTED_ENTRIES and 
                     INCLUDED_ENTRIES sources, nothing is stored.
                     It is user's job then use this information as desired.
    label_text -   Default is: 'Use structures from:'
    
    file_text -    Default is: "Input file:" / "Input files:"
    
Job parameters passed out in the getParams() JobInputParams object are...

    state -         The input source type, FILE, SELECTED_ENTRIES, 
                    INCLUDED_ENTRIES, INCLUDED_ENTRY, or WORKSPACE
    fileselection - The file name if FILE source

These are not JobParameters attributes, and the input structure file is not
written by this class.  JobInputFrame does that work.

Nested Classes [hide private]

Inherited from PyQt4.QtGui.QFrame: Shadow, Shape, StyleMask

Inherited from PyQt4.QtGui.QWidget: RenderFlag, RenderFlags

Inherited from PyQt4.QtGui.QPaintDevice: PaintDeviceMetric

Instance Methods [hide private]
 
__init__(self, parent, **kwargs)
See class docstring.
 
_fileSelectSetEnabled(self, enable)
Turn the file selector browse button and entry field or or off.
 
_reset(self)
Reset the input frame
 
browseFiles(self)
Callback method of the file browse button.
 
getFile(self)
Return the contents of the filename entry field.
 
getFiles(self)
Return the list of file names from the file entry field.
 
getParams(self)
If the current GUI state isn't valid, pop up an error message and return None.
 
inputState(self)
Return the input type as class constant FILE, SELECTED_ENTRIES, INCLUDED_ENTRIES, INCLUDED_ENTRY, or WORKSPACE.
 
setup(self, jobparam)
This method serializes the input structure(s) to disk and stores the name of the file in the jobparam instance.
 
updateInput(self, result)
Callback method of the input option menu.
 
validate(self)
Validate that the JobInputFrame is in a consistent and complete state.
 
warning(self, text)
Display a warning window with the specified text.
 
writePTEntries(self, filename, warn=False, append=False, source='Project Table (selected entries)')
Write selected Project Table entries to 'filename'.
 
writeSelectedEntries(self, filename, warn=False, append=False)
For backwards-compatability.

Inherited from PyQt4.QtGui.QFrame: changeEvent, drawFrame, event, frameRect, frameShadow, frameShape, frameStyle, frameWidth, lineWidth, midLineWidth, paintEvent, setFrameRect, setFrameShadow, setFrameShape, setFrameStyle, setLineWidth, setMidLineWidth, sizeHint

Inherited from PyQt4.QtGui.QWidget: acceptDrops, accessibleDescription, accessibleName, actionEvent, actions, activateWindow, addAction, addActions, adjustSize, autoFillBackground, backgroundRole, baseSize, childAt, childrenRect, childrenRegion, clearFocus, clearMask, close, closeEvent, contentsMargins, contentsRect, contextMenuEvent, 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, 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, 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, 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]
  ERROR = 1
  FILE = 'File'
  INCLUDED_ENTRIES = 'Workspace (included entries)'
  INCLUDED_ENTRY = 'Workspace (included entry)'
  OK = 0
  PROJECT_TABLE = 'Project Table (selected entries)'
  SELECTED_ENTRIES = 'Project Table (selected entries)'
  WORKSPACE = 'Workspace'
  _FILES = 'Files'

Inherited from PyQt4.QtGui.QFrame: Box, HLine, NoFrame, Panel, Plain, Raised, Shadow_Mask, Shape_Mask, StyledPanel, Sunken, VLine, WinPanel

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

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, parent, **kwargs)
(Constructor)

 

See class docstring. Raises an Exception if no input source is allowed.

Overrides: object.__init__

browseFiles(self)

 

Callback method of the file browse button. Pops up a askopenfilename file selector and places the selected file name into the file text field

getFile(self)

 

Return the contents of the filename entry field. Returns "" if this is called while file input is not allowed.

getFiles(self)

 

Return the list of file names from the file entry field. This is a true list, not a comma-separated list.

getParams(self)

 

If the current GUI state isn't valid, pop up an error message and return None. Otherwise, return a JobInputParams object with the input source type and filename (if FILE source).

setup(self, jobparam)

 

This method serializes the input structure(s) to disk and stores the
name of the file in the jobparam instance.  Returns False (i.e.,
aborts the setup cascade) if no input structure file is written.
Otherwise, returns True.

Job parameters set by this method are...

    inputstrucsource -   The input source type that was used (FILE,
                         SELECTED_ENTRIES, INCLUDED_ENTIRES, 
                         INCLUDED_ENTRY, or WORKSPACE).
    
    If "writefile" is True (default):
      If "multiplefiles" is True:
        inputstrucfiles -    The names of the created structure files when
                             multiplefiles is False. If source is FILE, then
                             it's the original paths specified by the user.
      If "multiplefiles" is False:
        inputstrucfile -     The name of the created structure file
                             ( <jobname>.<ext> ) when multiple files is False
        inputstrucorigfile - For FILE source, the path to the original
                             structure file selected.
        NOTE: if "copyfile" is set to False, the "inputstrucfile" is set to
        the same value as the "inputstrucorigfile"
    
    If "writefile" is False:
        inputstruc -         Structure object if source is WORKSPACE or
                             INCLUDED_ENTRY.
        inputstrucfile -     Path to specified structures if source is
                             FILE and multiplefiles is False.
        inputstrucfiles -    List of paths to specified structure files,
                             if source is FILE and multiplefiles is True.
        
Unused parameters are set to None.

updateInput(self, result)

 

Callback method of the input option menu. Disables the file selector and entry field if that is not the source chosen.

validate(self)

 

Validate that the JobInputFrame is in a consistent and complete state. Pops up a warning dialog and returns ERROR if the source is set to FILE but there is no specified file name. Returns OK otherwise.

writePTEntries(self, filename, warn=False, append=False, source='Project Table (selected entries)')

 

Write selected Project Table entries to 'filename'.

append - If True, the structures will be appended to an existing file;
        otherwise, the existing file is overwritten.

warn - Obsolete. Warning is no longer issued when the file exists

Raises a RuntimeError on error.
Returns False if the user cancelled.
Returns True on success.

writeSelectedEntries(self, filename, warn=False, append=False)

 

For backwards-compatability. Use the writePTEntries() method instead.