1
2 """
3 Formalizing the effects.
4 """
5 from toon import optgroup
6 from twisted.python import modules
7
9 """
10 Video Effect base class
11 """
17
20
23
26
29
30 - def post_draw(self):
32
33
35 """
36 Loads modules in the toon.effects package and returns a dict with
37 their name as the key
38 """
39 ret = {}
40 fx_package = modules.getModule("toon.effects")
41 for module in fx_package.iterModules():
42 try:
43 loaded_module = module.load()
44 effect = loaded_module.create_effect()
45 except Exception, e:
46 print("Error loading %s effect module : %s " % (module.name, e.message))
47
48 else:
49 effect.setup()
50 if not effect.loaded:
51 print("Could not load effect %s." % (effect.name))
52 else:
53 ret[effect.name] = effect
54 return ret
55