From fc5bfb3aaa82628e831f5a3d2c7a2dfc4e54f8bb Mon Sep 17 00:00:00 2001 From: Pepper Date: Sat, 3 Oct 2015 01:14:19 -0400 Subject: fixed some minor bugs --- lib/pb/generate.py | 3 ++- lib/pb/gradient.py | 15 +++++++++++---- lib/pb/grid.py | 4 ++-- 3 files changed, 15 insertions(+), 7 deletions(-) (limited to 'lib/pb') diff --git a/lib/pb/generate.py b/lib/pb/generate.py index a97970c..11df3b0 100755 --- a/lib/pb/generate.py +++ b/lib/pb/generate.py @@ -16,6 +16,7 @@ _COMPOSE_PARAMS = [ ] _DISPOSE_PARAMS = ["None", "Previous", "Background"] _DISPOSE_DEFAULT = "None" +_HUE_DEFUALT = '100'; class PbGenerate(Pb): #{{{ example params example_params = { @@ -79,7 +80,7 @@ class PbGenerate(Pb): 'contrast': {'type': 'int'}, 'saturation': {'type': 'int'}, 'rotate': {'type': 'int'}, - 'hue': {'type': 'int'}, + 'hue': {'type': 'int', 'default': _HUE_DEFUALT}, #ENUMS 'compose': {'type': 'enum', 'enum_values': _COMPOSE_PARAMS, 'default': 'Atop'}, diff --git a/lib/pb/gradient.py b/lib/pb/gradient.py index c2a9066..8f99a95 100755 --- a/lib/pb/gradient.py +++ b/lib/pb/gradient.py @@ -70,7 +70,7 @@ class PbGradient(Pb): 'default': DEFAULT_FINALFORMAT }, 'gradienttype': {'type':'enum', 'enum_values':[ - 'gradient', 'canvas', 'radial', 'colorspace', + 'gradient', 'canvas', 'plasma', 'radial', 'colorspace', 'mirrored', 'plasmawash', 'gradientwash', 'noise' ], 'default': 'gradient'}, 'username': {'type':'string'} @@ -79,7 +79,7 @@ class PbGradient(Pb): self.filename, self.filepath = self._filename_filepath_create() - def _filename_create(self): + def _filename_create(self, **kwargs): _base = "{}{}-{}_{}".format( self.__class__.__name__, str(self.params.color1).replace('#', '').replace('(', '-').replace(')', '-'), @@ -113,6 +113,9 @@ class PbGradient(Pb): "radial" : [ "radial-gradient:{}-{}".format(self.params.color1, self.params.color2) ], + "plasma" : [ + "plasma:{}-{}".format(self.params.color1, self.params.color2) + ], "colorspace" : [ "-colorspace", "Gray", @@ -162,11 +165,15 @@ class PbGradient(Pb): if self.params.bevel: self._make_bevel() def _get_bevelvalue(self): + sys.stderr.write("in the bevel function"); w, h = map(int, (self.params.width, self.params.height)) if h >= w: - bevpercentval = str(int(self.params.percentbeveled)*0.005*int(h)) + sys.stderr.write("In the first block") + bevpercentval = str(int(int(self.params.percentbeveled)*int(h))/500) else: - bevpercentval = str(int(self.params.percentbeveled)*0.005*int(w)) + sys.stderr.write("In the second block") + + bevpercentval = str(int(int(self.params.percentbeveled)*int(w))/500) return { "flatout": ["-s", bevpercentval, "-m", "outer"], "flatinner": ["-s", bevpercentval, "-m", "inner"], diff --git a/lib/pb/grid.py b/lib/pb/grid.py index d8b1aaa..8a59b83 100755 --- a/lib/pb/grid.py +++ b/lib/pb/grid.py @@ -39,7 +39,7 @@ class PbGrid(Pb): 'swing': {'type':'int'}, 'tilt': {'type':'int'}, 'roll': {'type':'int'}, - 'zoom': {'type':'int'}, + 'zoom': {'type':'float'}, 'skycolor': {'type':'color', 'default': 'transparent'}, 'transition': { 'type':'enum', @@ -51,7 +51,7 @@ class PbGrid(Pb): 'trim': {'type':'bool'}, 'finalformat': { 'type':'enum', - 'enum_values' :OUTPUT_IMAGE_TYPES, + 'enum_values': OUTPUT_IMAGE_TYPES, 'default': DEFAULT_FINALFORMAT }, 'username': {'type':'string'}, -- cgit v1.2.3-70-g09d2