diff options
| author | Brianna | 2017-05-31 16:22:58 -0400 |
|---|---|---|
| committer | GitHub | 2017-05-31 16:22:58 -0400 |
| commit | a1ae1dfde90907914232a95032ec1d99ecbc6476 (patch) | |
| tree | 1d132e8cc494aa722cc5dd81e2805d1579484f48 /components/__base__.py | |
| parent | 7240f25deb21db365f39d00c50eb07d41dc4c797 (diff) | |
| parent | 9be8f742c6a694c3d85eacfedf03808f215295ad (diff) | |
basic preset functionality
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 {} ''' |
