@@ -88,7 +88,6 @@ class _Lock(object):
8888 def __exit__(self, exc_type, exc_value, traceback):
8989 self._session.unlock()
9090
91-
9291% endif
9392% if len (config[' repeated_capabilities' ]) > 0 :
9493
@@ -205,6 +204,7 @@ class _NoChannel(object):
205204
206205 def __exit__(self, exc_type, exc_value, traceback):
207206 self._session._repeated_capability = self._repeated_capability_cache
207+ % endif
208208
209209
210210% endif
@@ -216,6 +216,11 @@ class _SessionBase(object):
216216
217217% for attribute in helper.sorted_attrs(helper.filter_codegen_attributes(attributes)):
218218<%
219+ # Skip attributes with repeated capability expansion set to "custom"
220+ if ' repeated_capability_type' in attributes[attribute]:
221+ rep_cap_type = attributes[attribute][' repeated_capability_type' ]
222+ if any (rep_cap.get(' python_name' ) == rep_cap_type and config[' rep_cap_expansion' ] == ' custom' for rep_cap in config[' repeated_capabilities' ]):
223+ continue
219224helper.add_attribute_rep_cap_tip(attributes[attribute], config)
220225%> \
221226 % if attributes[attribute][' enum' ]:
@@ -257,9 +262,13 @@ constructor_params = helper.filter_parameters(init_function['parameters'], helpe
257262
258263% if len (config[' repeated_capabilities' ]) > 0 :
259264 # Instantiate any repeated capability objects
260- % for rep_cap in config[' repeated_capabilities' ]:
265+ % for rep_cap in config[' repeated_capabilities' ]:
266+ % if config[' rep_cap_expansion' ] == ' custom' :
267+ self.${ rep_cap[' python_name' ]} = _RepCap${ rep_cap[' python_name' ].capitalize()} (self, repeated_capability_list)
268+ % else :
261269 self.${ rep_cap[' python_name' ]} = _RepeatedCapabilities(self, '${ rep_cap[" prefix" ]} ', repeated_capability_list)
262- % endfor
270+ % endif
271+ % endfor
263272
264273% endif
265274 # Finally, set _is_frozen to True which is used to prevent clients from accidentally adding
0 commit comments