def __init__(self, attributes): self.parsed_args = None self._attributes = {} for attribute in attributes: attr_name = names.ConvertToNamespaceName( attribute.concept.GetPresentationName()) if attr_name in self._attributes: raise ValueError('Attempting to add two concepts with the same ' 'presentation name: [{}]'.format(attr_name)) self._attributes[attr_name] = attribute
def __init__(self, values_dict): for key, value in six.iteritems(values_dict): setattr(self, names.ConvertToNamespaceName(key), value)
def testConvertToNamespaceName(self, input_val, expected): self.assertEqual(expected, names.ConvertToNamespaceName(input_val))
def _GetSubConceptName(self, attribute_name): if self.prefixes: return names.ConvertToNamespaceName(self.name + '_' + attribute_name) return attribute_name