예제 #1
0
 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
예제 #2
0
 def __init__(self, values_dict):
     for key, value in six.iteritems(values_dict):
         setattr(self, names.ConvertToNamespaceName(key), value)
예제 #3
0
 def testConvertToNamespaceName(self, input_val, expected):
     self.assertEqual(expected, names.ConvertToNamespaceName(input_val))
예제 #4
0
 def _GetSubConceptName(self, attribute_name):
     if self.prefixes:
         return names.ConvertToNamespaceName(self.name + '_' +
                                             attribute_name)
     return attribute_name