From a5123bfab06f7fd8884b9b4f12f579dceec43aa1 Mon Sep 17 00:00:00 2001 From: yo mama Date: Wed, 11 Mar 2015 02:51:58 -0700 Subject: finished OOP rewrite --- test.py | 67 ++++++++++++++++++++++++++++++----------------------------------- 1 file changed, 31 insertions(+), 36 deletions(-) (limited to 'test.py') diff --git a/test.py b/test.py index f547e47..eab9512 100755 --- a/test.py +++ b/test.py @@ -1,41 +1,36 @@ -#!/usr/bin/python2.7 -from lib.dumpfm import DumpFmImageSearch - -#ok so lib.dumpfm is completely different and I'll ask about that later - - -from Pb_Api.ImGradient import * -from Pb_Api.ImGrid import * - -#ok how do I initialize and load params? - -imgradient = Pb_Api_ImGradient() #this class name doesn't seem right though, is that what we named it? no, but should be about that, i'm using perl style, so path and class name basically same, we can't use dot in class name, so i'm using _. why can't we use the dot in the classname? i think it's syntax error. hmm should we test real quick? sure -params = imgradient.params() -params.param("gradienttype").value("mirror") +#!/usr/bin/python2.7 +from Pb_Api.ImPattern import Pb_Api_ImPattern +from Pb_Api.ImGrid import Pb_Api_ImGrid +from Pb_Api.ImBreak import Pb_Api_ImBreak +from Pb_Api.ImGradient import Pb_Api_ImGradient +import pprint + +#api = Pb_Api_ImPattern() +#params = api.params_init() #params.randomize() -params.defaults() # if I want defaults? yep -result = imgradient.call(params) -# seomthing like this +#print params.as_hash() +#req = params.execute() +#print req -#this is how they are getting imported...does it look a little bit weird? -#well it fine, what about all those services, imbreak, imgradient, can they be sort of merged together? not really -#they take very different parameters...that's the issue, but the service call, I made a master class for it -imbreak = ImBreak() -imgradient = ImGradient() -imgrid = ImGrid() -impattern = ImPattern() -#p = ImBreakParams_FromDefaults() -#image = imbreak.new(p.from_random()) -#print image +#api = Pb_Api_ImGrid() +#params = api.params_init() +#params.randomize() +#print params.as_hash() +#req = params.execute() +#print req -#p = ImGradientParams_FromDefaults() -#image = imgradient.new(p.from_random()) -#print image -#p = ImGridParams_FromDefaults() -#image = imgrid.new(p.from_random()) -#print image -p = ImPatternParams_FromDefaults() -image = impattern.new(p.from_random()) -print image +#api = Pb_Api_ImBreak() +#params = api.params_init() +#params.randomize() +#print params.as_hash() +#req = params.execute() +#print req + +api = Pb_Api_ImGradient() +params = api.params_init() +params.randomize() +print params.as_hash() +req = params.execute() +print req -- cgit v1.2.3-70-g09d2