File tree Expand file tree Collapse file tree 1 file changed +28
-0
lines changed
Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change 66from demosys .effects .effect import Effect
77
88
9+ def parse_package_string (path ):
10+ """
11+ Parse the effect package string.
12+ Can contain the package python path or path to effect class in an effect package.
13+
14+ Examples::
15+
16+ # Path to effect pacakge
17+ examples.cubes
18+
19+ # Path to effect class
20+ examples.cubes.Cubes
21+
22+ Args:
23+ path: python path to effect package. May also include effect class name.
24+
25+ Returns:
26+ tuple: (package_path, effect_class)
27+ """
28+ parts = path .split ('.' )
29+
30+ # Is the last entry in the path capitalized?
31+ if parts [- 1 ][0 ].isupper ():
32+ return "." .join (parts [:- 1 ]), parts [- 1 ]
33+
34+ return path
35+
36+
937class EffectRegistry :
1038 """
1139 Registry for effects classes (not instances).
You can’t perform that action at this time.
0 commit comments