def __new__(cls, name, bases, attributes): new_class = super(RequirementMetaclass, cls).__new__(cls, name, bases, attributes) new_class._interpreter_check_method = 'check_%s' % utils.camel_to_underscores(name) new_class._interpreter_satisfy_method = 'satisfy_%s' % utils.camel_to_underscores(name) return new_class
def __new__(cls, name, bases, attributes): new_class = super(RequirementMetaclass, cls).__new__(cls, name, bases, attributes) new_class._interpreter_check_method = 'check_%s' % utils.camel_to_underscores( name) new_class._interpreter_satisfy_method = 'satisfy_%s' % utils.camel_to_underscores( name) return new_class
def update_uid(self): if self.uid is None: uid_parts = [] for attribute_name in sorted(self._attributes.keys()): attribute = self._attributes[attribute_name] if attribute.is_uid: value = getattr(self, attribute_name) if isinstance(value, (list, tuple)): value = '|'.join(value) uid_parts.append(str(value)) self.uid = '#%s(%s)' % (utils.camel_to_underscores(self.type_name()), ', '.join(uid_parts))
def update_uid(self): if self.uid is None: uid_parts = [] for attribute_name in sorted(self._attributes.keys()): attribute = self._attributes[attribute_name] if attribute.is_uid: value = getattr(self, attribute_name) if isinstance(value, (list, tuple)): value = '|'.join(value) uid_parts.append(str(value)) self.uid = '#%s(%s)' % (utils.camel_to_underscores( self.type_name()), ', '.join(uid_parts))
def __new__(cls, name, bases, attributes): new_class = super(ActionMetaclass, cls).__new__(cls, name, bases, attributes) new_class._interpreter_do_method = 'do_%s' % utils.camel_to_underscores(name) return new_class
def __new__(cls, name, bases, attributes): new_class = super(ActionMetaclass, cls).__new__(cls, name, bases, attributes) new_class._interpreter_do_method = 'do_%s' % utils.camel_to_underscores( name) return new_class