From b02cc8d49513cdcc54f4421e71db3512354d4e2e Mon Sep 17 00:00:00 2001 From: yo mama Date: Sat, 10 Oct 2015 02:54:41 -0700 Subject: renamed options to selections --- ricky/imgradient/options.py | 101 ----------------------------------------- ricky/imgradient/params.py | 42 ++++++++--------- ricky/imgradient/selections.py | 101 +++++++++++++++++++++++++++++++++++++++++ 3 files changed, 122 insertions(+), 122 deletions(-) delete mode 100644 ricky/imgradient/options.py create mode 100644 ricky/imgradient/selections.py (limited to 'ricky/imgradient') diff --git a/ricky/imgradient/options.py b/ricky/imgradient/options.py deleted file mode 100644 index dd14cba..0000000 --- a/ricky/imgradient/options.py +++ /dev/null @@ -1,101 +0,0 @@ -from ricky.param.options import Options - -width_options = Options.from_dict( - {"value": 40, "weight": 60}, - {"value": 20, "weight": 60}, - {"value": 60, "weight": 60}, - {"value": 80, "weight": 60}, -) -height_options = Options.from_dict( - {"value": 400, "weight": 900}, -) -color1_options = Options.from_dict( - {"value": "", "weight": 0}, -# {"value": "black", "weight": 1}, -# {"value": "white", "weight": 2}, -) -color2_options = Options.from_dict( - {"value": "", "weight": 0}, -# {"value": "black", "weight": 2}, -# {"value": "white", "weight": 1}, -) -stripes_options = Options.from_dict( - {"value": "true", "weight": 3}, - {"value": "false", "weight": 1}, -) -stripenumber_options = Options.from_dict( - {"value": 3, "weight": 10}, - {"value": 10, "weight": 10}, - {"value": 20, "weight": 10}, - {"value": 100, "weight": 10}, - {"value": 40, "weight": 10}, -# {"value": 1, "weight": 50}, -# {"value": 2, "weight": 50}, -# {"value": 2, "weight": 50}, - -) -stripeintensity_options = Options.from_dict( - {"value": 1000, "weight": 10}, - {"value": 4, "weight": 10}, -) -# contrast_options = \ -brightness_options = \ - saturation_options = \ - hue_options = \ - Options.from_dict( - {"value": "", "weight": 0}, -# {"value": "", "weight": 300}, -) -halftone_options = Options.from_dict( - {"value": "", "weight": 60}, - {"value": "checkeredfade", "weight": 10}, - {"value": "etchedtransition", "weight": 10}, - {"value": "bendaydots", "weight": 10}, - {"value": "smallerdots1", "weight": 10}, - {"value": "smallerdots2", "weight": 10}, - {"value": "flatstripes", "weight": 10}, -) -bevel_options = Options.from_dict( - {"value": "", "weight": 4}, - {"value": "flatout", "weight": 1}, - {"value": "flatinner", "weight": 0}, - {"value": "evenlyframed", "weight": 1}, -# {"value": "biginner", "weight": 1}, - {"value": "bigouter", "weight": 1}, - {"value": "dramaticflatout", "weight": 1}, -# {"value": "dramaticflatinner", "weight": 1}, -) - -blurriness_options = \ - percentbeveled_options = Options.from_dict( - {"value": 30, "weight": 20}, - {"value": 10, "weight": 2}, - {"value": "", "weight": 1}, -) -rotate_options = \ - tilt_options = Options.from_dict( - {"value": 0, "weight": 200}, - {"value": 90, "weight": 2}, - {"value": 180, "weight": 2}, - {"value": 270, "weight": 2}, -) -flop_options = flip_options = Options.from_dict( - {"value": "", "weight": 1}, - {"value": "true", "weight": 1}, -) - -filetype_options = Options.from_dict( - {"value": "png", "weight": 10}, - {"value": "jpg", "weight": 2}, - {"value": "gif", "weight": 2}, -) -gradienttype_options = Options.from_dict( - {"value": "canvas", "weight": 1}, - {"value": "gradient", "weight": 5}, - {"value": "radial", "weight": 1}, - {"value": "colorspace", "weight": 1}, - {"value": "plasmawash", "weight": 2}, - {"value": "gradientwash", "weight": 1}, - {"value": "mirrored", "weight": 0}, - {"value": "noise", "weight": 1}, -) diff --git a/ricky/imgradient/params.py b/ricky/imgradient/params.py index f950429..373a9a1 100644 --- a/ricky/imgradient/params.py +++ b/ricky/imgradient/params.py @@ -4,7 +4,7 @@ from ricky.param.username import Username from ricky.param.multiselect import MultiSelect from ricky.param.numberrange import NumberRange from ricky.param.color import Color -from ricky.imgradient.options import * +from ricky.imgradient.selections import * class Params(_Params): @@ -14,47 +14,47 @@ class Params(_Params): NumberRange( name="width", required=1, - options=width_options, + selections=width_selections, min=10, max=800 ), NumberRange( name="height", required=1, - options=height_options, + selections=height_selections, min=10, max=800 ), - Color(name="color1", required=1, options=color1_options), - Color(name="color2", required=1, options=color2_options), + Color(name="color1", required=1, selections=color1_selections), + Color(name="color2", required=1, selections=color2_selections), MultiSelect( name="filetype", required=0, - options=filetype_options + selections=filetype_selections ), MultiSelect( name="gradienttype", required=1, - options=gradienttype_options + selections=gradienttype_selections ), MultiSelect( name="halftone", required=0, - options=halftone_options + selections=halftone_selections ), - MultiSelect(name="bevel", required=0, options=bevel_options), + MultiSelect(name="bevel", required=0, selections=bevel_selections), NumberRange( name="stripenumber", required=0, - options=stripenumber_options, + selections=stripenumber_selections, min=0, max=400 ), NumberRange( name="stripeintensity", required=0, - options=stripeintensity_options, + selections=stripeintensity_selections, min=0, max=5000 ), @@ -62,59 +62,59 @@ class Params(_Params): NumberRange( name="blurriness", required=0, - options=blurriness_options, + selections=blurriness_selections, min=0, max=200 ), # NumberRange( # name="contrast", # required=0, - # options=contrast_options, + # selections=contrast_selections, # min=0, # max=200 # ), NumberRange( name="brightness", required=0, - options=brightness_options, + selections=brightness_selections, min=0, max=200 ), NumberRange( name="saturation", required=0, - options=saturation_options, + selections=saturation_selections, min=0, max=200 ), NumberRange( name="hue", required=0, - options=hue_options, + selections=hue_selections, min=0, max=200 ), NumberRange( name="percentbeveled", required=0, - options=percentbeveled_options, + selections=percentbeveled_selections, min=0, max=100 ), NumberRange( name="rotate", required=0, - options=rotate_options, + selections=rotate_selections, min=0, max=360 ), NumberRange( name="tilt", required=0, - options=tilt_options, + selections=tilt_selections, min=0, max=360 ), - MultiSelect(name="flop", required=0, options=flop_options), - MultiSelect(name="flip", required=0, options=flip_options), + MultiSelect(name="flop", required=0, selections=flop_selections), + MultiSelect(name="flip", required=0, selections=flip_selections), ) diff --git a/ricky/imgradient/selections.py b/ricky/imgradient/selections.py new file mode 100644 index 0000000..d5eda16 --- /dev/null +++ b/ricky/imgradient/selections.py @@ -0,0 +1,101 @@ +from ricky.param.selections import Selections + +width_selections = Selections.from_dict( + {"value": 40, "weight": 60}, + {"value": 20, "weight": 60}, + {"value": 60, "weight": 60}, + {"value": 80, "weight": 60}, +) +height_selections = Selections.from_dict( + {"value": 400, "weight": 900}, +) +color1_selections = Selections.from_dict( + {"value": "", "weight": 0}, +# {"value": "black", "weight": 1}, +# {"value": "white", "weight": 2}, +) +color2_selections = Selections.from_dict( + {"value": "", "weight": 0}, +# {"value": "black", "weight": 2}, +# {"value": "white", "weight": 1}, +) +stripes_selections = Selections.from_dict( + {"value": "true", "weight": 3}, + {"value": "false", "weight": 1}, +) +stripenumber_selections = Selections.from_dict( + {"value": 3, "weight": 10}, + {"value": 10, "weight": 10}, + {"value": 20, "weight": 10}, + {"value": 100, "weight": 10}, + {"value": 40, "weight": 10}, +# {"value": 1, "weight": 50}, +# {"value": 2, "weight": 50}, +# {"value": 2, "weight": 50}, + +) +stripeintensity_selections = Selections.from_dict( + {"value": 1000, "weight": 10}, + {"value": 4, "weight": 10}, +) +# contrast_selections = \ +brightness_selections = \ + saturation_selections = \ + hue_selections = \ + Selections.from_dict( + {"value": "", "weight": 0}, +# {"value": "", "weight": 300}, +) +halftone_selections = Selections.from_dict( + {"value": "", "weight": 60}, + {"value": "checkeredfade", "weight": 10}, + {"value": "etchedtransition", "weight": 10}, + {"value": "bendaydots", "weight": 10}, + {"value": "smallerdots1", "weight": 10}, + {"value": "smallerdots2", "weight": 10}, + {"value": "flatstripes", "weight": 10}, +) +bevel_selections = Selections.from_dict( + {"value": "", "weight": 4}, + {"value": "flatout", "weight": 1}, + {"value": "flatinner", "weight": 0}, + {"value": "evenlyframed", "weight": 1}, +# {"value": "biginner", "weight": 1}, + {"value": "bigouter", "weight": 1}, + {"value": "dramaticflatout", "weight": 1}, +# {"value": "dramaticflatinner", "weight": 1}, +) + +blurriness_selections = \ + percentbeveled_selections = Selections.from_dict( + {"value": 30, "weight": 20}, + {"value": 10, "weight": 2}, + {"value": "", "weight": 1}, +) +rotate_selections = \ + tilt_selections = Selections.from_dict( + {"value": 0, "weight": 200}, + {"value": 90, "weight": 2}, + {"value": 180, "weight": 2}, + {"value": 270, "weight": 2}, +) +flop_selections = flip_selections = Selections.from_dict( + {"value": "", "weight": 1}, + {"value": "true", "weight": 1}, +) + +filetype_selections = Selections.from_dict( + {"value": "png", "weight": 10}, + {"value": "jpg", "weight": 2}, + {"value": "gif", "weight": 2}, +) +gradienttype_selections = Selections.from_dict( + {"value": "canvas", "weight": 1}, + {"value": "gradient", "weight": 5}, + {"value": "radial", "weight": 1}, + {"value": "colorspace", "weight": 1}, + {"value": "plasmawash", "weight": 2}, + {"value": "gradientwash", "weight": 1}, + {"value": "mirrored", "weight": 0}, + {"value": "noise", "weight": 1}, +) -- cgit v1.2.3-70-g09d2