File tree Expand file tree Collapse file tree 3 files changed +30
-1
lines changed Expand file tree Collapse file tree 3 files changed +30
-1
lines changed Original file line number Diff line number Diff line change 4444# Empty effects tuple
4545EFFECTS = ()
4646
47- EFFECT_MANAGER = 'demosys.effects.managers.single. SingleEffectManager'
47+ EFFECT_MANAGER = 'demosys.effects.managers.SingleEffectManager'
4848
4949
5050# Additional directories shaders can be found
Original file line number Diff line number Diff line change 1+ import demosys
2+ from demosys .core .management .base import BaseCommand
3+ from demosys .core .exceptions import ImproperlyConfigured
4+ from demosys .utils .module_loading import import_string
5+ from demosys .conf import settings
6+
7+
8+ class Command (BaseCommand ):
9+ help = "Run using the configured effect manager"
10+
11+ def add_arguments (self , parser ):
12+ pass
13+
14+ def handle (self , * args , ** options ):
15+ demosys .setup ()
16+ manager_path = getattr (settings , 'EFFECT_MANAGER' )
17+ if not manager_path :
18+ raise ImproperlyConfigured ("EFFECT_MANAGER not properly configured in settings" )
19+ print (manager_path )
20+ try :
21+ manager_cls = import_string (manager_path )
22+ except ImportError as e :
23+ raise ImproperlyConfigured ("EFFECT_MANAGER '{}' failed to initialize: {}" .format (manager_path , e ))
24+
25+ manager = manager_cls ()
26+ demosys .run (manager = manager )
Original file line number Diff line number Diff line change @@ -65,6 +65,9 @@ def pre_load(self):
6565 Initialize the effect that should run.
6666 """
6767 effect_list = [cfg .cls () for name , cfg in effects .effects .items ()]
68+ if not self .active_effect :
69+ self .active_effect = effect_list [0 ]
70+
6871 for effect in effect_list :
6972 if effect .name == self .effect_module :
7073 self .active_effect = effect
You can’t perform that action at this time.
0 commit comments