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=6f30f3a58f9e3afa0b27565f6e3db1f42ffff88e;hp=1d426d98a659a28a45f09d23040d33ef8f31fbb9;hb=0c69264f95038bfc1060893a3f74296b3b101987;hpb=cad9d48a0f1067769435904348e9fffeffd25eb9 diff --git a/aces_1.0.0/python/aces_ocio/utilities.py b/aces_1.0.0/python/aces_ocio/utilities.py index 1d426d9..6f30f3a 100644 --- a/aces_1.0.0/python/aces_ocio/utilities.py +++ b/aces_1.0.0/python/aces_ocio/utilities.py @@ -39,16 +39,16 @@ class ColorSpace(object): def __init__(self, name, - aliases=[], + aliases=None, description=None, bit_depth=ocio.Constants.BIT_DEPTH_F32, equality_group='', family=None, is_data=False, - to_reference_transforms=[], - from_reference_transforms=[], + to_reference_transforms=None, + from_reference_transforms=None, allocation_type=ocio.Constants.ALLOCATION_UNIFORM, - allocation_vars=[0, 1], + allocation_vars=None, aces_transform_id=None): """ Object description. @@ -64,6 +64,18 @@ class ColorSpace(object): Return value description. """ + if aliases is None: + aliases = [] + + if to_reference_transforms is None: + to_reference_transforms = [] + + if from_reference_transforms is None: + from_reference_transforms = [] + + if allocation_vars is None: + allocation_vars = [0, 1] + self.name = name self.aliases = aliases self.bit_depth = bit_depth @@ -181,11 +193,11 @@ def replace(string, data): Examples -------- - >>> patterns = {"John" : "Luke", - ... "Jane" : "Anakin", - ... "Doe" : "Skywalker", - ... "Z6PO" : "R2D2"} - >>> data = "Users are: John Doe, Jane Doe, Z6PO." + >>> patterns = {'John' : 'Luke', + ... 'Jane' : 'Anakin', + ... 'Doe' : 'Skywalker', + ... 'Z6PO' : 'R2D2'} + >>> data = 'Users are: John Doe, Jane Doe, Z6PO.' >>> replace(data,patterns ) u'Users are: Luke Skywalker, Anakin Skywalker, R2D2.' """ @@ -277,6 +289,5 @@ def unpack_default(iterable, length=3, default=None): iterable """ - return itertools.islice(itertools.chain(iter(iterable), - itertools.repeat(default)), - length) + return itertools.islice( + itertools.chain(iter(iterable), itertools.repeat(default)), length)