diff options
| author | tassaron | 2017-05-30 22:05:56 -0400 |
|---|---|---|
| committer | tassaron | 2017-05-30 22:05:56 -0400 |
| commit | 5295a6d9ae3d73c7dceb286f13c6a1429e55393c (patch) | |
| tree | da62d3717a40689269f19375274d28d87619137e /components/__base__.py | |
| parent | ca7e8bdb0dc998088aeb45a77987a78cc4656b34 (diff) | |
presets are working
except for font because it can't be represented as a string
Diffstat (limited to 'components/__base__.py')
| -rw-r--r-- | components/__base__.py | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/components/__base__.py b/components/__base__.py index 252ad03..05d5cb6 100644 --- a/components/__base__.py +++ b/components/__base__.py @@ -5,18 +5,21 @@ class Component: 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 ''' @@ -58,7 +61,9 @@ class Component: image = Image.new("RGBA", (width, height), (0,0,0,0)) return image - def version(self): - # change this number to identify new versions of your component - return 1 + def loadPreset(self, presetDict): + # update widgets using a preset dict + + def savePreset(self): + return {} ''' |
