X-Git-Url: http://users.mur.at/ms/git/gitweb/?p=OpenColorIO-Configs.git;a=blobdiff_plain;f=aces_1.0.0%2Fpython%2Faces_ocio%2Futilities.py;h=54a495e32c97062be2035af216b479da1a8ebbd6;hp=c60476a3813c311a19b3c737cb25a51c940bc486;hb=7a7ab56ee2c9a096f14667e9060a14617370e43d;hpb=c8a3f414098c640cdcfa0c5329637b4bfc913433 diff --git a/aces_1.0.0/python/aces_ocio/utilities.py b/aces_1.0.0/python/aces_ocio/utilities.py index c60476a..54a495e 100644 --- a/aces_1.0.0/python/aces_ocio/utilities.py +++ b/aces_1.0.0/python/aces_ocio/utilities.py @@ -31,6 +31,7 @@ class ColorSpace(object): def __init__(self, name, + aliases=[], description=None, bit_depth=OCIO.Constants.BIT_DEPTH_F32, equality_group=None, @@ -55,6 +56,7 @@ class ColorSpace(object): """ self.name = name + self.aliases = [] self.bit_depth = bit_depth self.description = description self.equality_group = equality_group @@ -167,4 +169,32 @@ def sanitize_path(path): Return value description. """ - return path.replace(' ', '_').replace(')', '_').replace('(', '_') \ No newline at end of file + return path.replace(' ', '_').replace(')', '_').replace('(', '_') + +def compact(string): + """ + Removes blanks, underscores, dashes and parentheses + + Parameters + ---------- + parameter : type + A string. + + Returns + ------- + type + A compact version of that string. + """ + + compact = string + compact = compact.lower() + compact = compact.replace(' ', '_') + compact = compact.replace('(', '_') + compact = compact.replace(')', '_') + compact = compact.replace('.', '_') + compact = compact.replace('-', '_') + compact = compact.replace('___', '_') + compact = compact.replace('__', '_') + compact = compact.replace('_', '') + + return compact