diff options
Diffstat (limited to 'components/__base__.py')
| -rw-r--r-- | components/__base__.py | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/components/__base__.py b/components/__base__.py index 87440bb..05d5cb6 100644 --- a/components/__base__.py +++ b/components/__base__.py @@ -3,17 +3,23 @@ from PyQt4 import QtGui class Component: def __str__(self): return self.__doc__ + + def version(self): + # change this number to identify new versions of a component + return 1 def preFrameRender(self, **kwargs): - for kwarg, value in kwargs.items(): - exec('self.%s = value' % kwarg) + for item in kwargs.items(): + exec('self.%s = %s' % item) def pickColor(self): color = QtGui.QColorDialog.getColor() if color.isValid(): - RGBstring = '%s,%s,%s' % (str(color.red()), str(color.green()), str(color.blue())) - btnStyle = "QPushButton { background-color : %s; outline: none; }" % color.name() - return RGBstring, btnStyle + RGBstring = '%s,%s,%s' % (str(color.red()), str(color.green()), str(color.blue())) + btnStyle = "QPushButton { background-color : %s; outline: none; }" % color.name() + return RGBstring, btnStyle + else: + return None, None def RGBFromString(self, string): ''' turns an RGB string like "255, 255, 255" into a tuple ''' @@ -54,4 +60,10 @@ class Component: height = int(self.worker.core.settings.value('outputHeight')) image = Image.new("RGBA", (width, height), (0,0,0,0)) return image + + def loadPreset(self, presetDict): + # update widgets using a preset dict + + def savePreset(self): + return {} ''' |
