コード例 #1
0
ファイル: requirements.py プロジェクト: IdenGit/questgen
    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
コード例 #2
0
    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
コード例 #3
0
ファイル: facts.py プロジェクト: Tiendil/questgen
    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))
コード例 #4
0
    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))
コード例 #5
0
ファイル: actions.py プロジェクト: Tiendil/questgen
 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
コード例 #6
0
ファイル: actions.py プロジェクト: mm3/questgen
 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