class FileModeConfig(OutputModeConfig): mode_type = "file" _fields = [ ConfigField('file', None, ConfigPath), ConfigField('basename', None, str), ConfigField('prefix', None, str), ConfigField('suffix', None, str), ConfigField('dir', None, ConfigPath), ConfigField('series', False, bool), ConfigField('overwrite', True, bool), ConfigField('seriesPadding', 3, int), ConfigField('seriesStart', 0, int), ConfigField('format', None, str, widget_type='combo') ]
def __init__(self, mode, mode_config=None, title=None, parent=None): assert (mode is not None or mode_config is not None) QtGui.QGroupBox.__init__(self, parent) self.field_widgets = {} self._changed_config = {} self._changed_fields = {} if title is not None: self.setTitle(title) elif mode is not None: self.setTitle(mode.mode_type) else: self.setTitle("unknown") group_layout = QtGui.QGridLayout() group_layout.setMargin(5) group_layout.setSpacing(5) group_layout.setColumnStretch(1, 1) if mode is None: for k, v in mode_config.iteritems(): dummy_field = ConfigField(k, None, str) self.add_field(group_layout, dummy_field, mode_config, k) else: for field in mode.get_config().get_all_fields(): self.add_field(group_layout, field, mode_config, mode.mode_type) self.setLayout(group_layout)
class SpreadsheetModeConfig(OutputModeConfig): mode_type = "spreadsheet" _fields = [ ConfigField('row', None, int), ConfigField('col', None, int), ConfigField('sheetName', None, str), ConfigField('sheetRowCount', None, int), ConfigField('sheetColCount', None, int), ConfigField('rowSpan', None, int), ConfigField('colSpan', None, int) ]
class AlteredFileModeConfig(FileModeConfig): mode_type = "file" _fields = [ConfigField("newattr", 3, int)]
class AlteredFileModeConfig(FileModeConfig): _fields = [ConfigField("newattr", 3, int)]
class ImageFileModeConfig(FileModeConfig): mode_type = "file" _fields = [ConfigField('width', 800, int), ConfigField('height', 600, int)]
class vtkRendererToIPythonModeConfig(IPythonModeConfig): _fields = [ConfigField('width', 640, int), ConfigField('height', 480, int)]
class MplIPythonModeConfig(IPythonModeConfig): mode_type = "ipython" _fields = [ ConfigField('width', None, int), ConfigField('height', None, int) ]