示例#1
0
 def __init__(self,compiler):
     self.compiler = compiler
     self.typeinfo = [
         TypeInfo(self, compiler, fc.FormulaTypes.FRACTAL),
         TypeInfo(self, compiler, fc.FormulaTypes.COLORFUNC, "INSIDE"),
         TypeInfo(self, compiler, fc.FormulaTypes.COLORFUNC, "OUTSIDE"),
         TypeInfo(self, compiler, fc.FormulaTypes.TRANSFORM),
         TypeInfo(self, compiler, fc.FormulaTypes.GRADIENT)
         ]
     self.current_type = -1
     self.type_changed = event.T()
     self.file_changed = event.T()
     self.formula_changed = event.T()
     self.set_type(FRACTAL)
示例#2
0
    def testAdd(self):
        e = event.T()

        def foo():
            pass

        e += foo
        self.assertEqual([foo], e.targets)
示例#3
0
    def testCall(self):
        results = []

        def call(arg):
            results.append(arg)

        e = event.T()
        e += call
        e(2)
        self.assertEqual([2], results)

        e += call
        e("fish")
        self.assertEqual([2, "fish", "fish"], results)
示例#4
0
 def testCreate(self):
     e = event.T()
     self.assertEqual([], e.targets)
示例#5
0
 def __init__(self):
     self.x = event.T()
     self.x()