We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8f930be commit 0fd7f6cCopy full SHA for 0fd7f6c
demosys/effects/registry.py
@@ -6,6 +6,34 @@
6
from demosys.effects.effect import Effect
7
8
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
37
class EffectRegistry:
38
"""
39
Registry for effects classes (not instances).
0 commit comments