コード例 #1
0
    def __init__(self, *params, **kwds):
        """
        Constructors:
        __init__(element, doc)
        __init__(actions=list, destination=directory, [errors=(ignore|raise|*log)], [doc=document])
        __init__(action=what, destination=directory, [errors=(ignore|raise|*log)], [doc=document])
        __init__(element=element, doc=doc)

        @element: the element of the modification
        @doc: the root document
        @actions: list of actions to be done
        @destination: where to put the results
        @errors: how to handle the errors
        """
        if len(params)==2:
            _element=params[0]
            _doc=params[0]
        elif kwds:
            if kwds.has_key("element") and kwds.has_key("doc"):
                _element=kwds["element"]
                _doc=kwds["doc"]
            else:
                (_element, _doc)=self._createElement(**kwds)
        else:
            raise TypeError("__init__() takes exactly 2 arguments or different keys. (%u given)" %len(params))
        Modification.__init__(self, _element, _doc)
コード例 #2
0
    def __init__(self, *params, **kwds):
        """
        Constructors:
        __init__(element, doc)
        __init__(self, command=cmd, [settrigger=*True|False])
        __init__(self, commands=list<cmd>, [settrigger=*True|False])
        __init__(element=element, doc=doc)

        @element: the element of the modification
        @doc: the root document
        @command: sysrq command to be executed
        @commands: list of sysrq commands to be executed
        @settrigger: set the trigger or not
        """
        if len(params)==2:
            _element=params[0]
            _doc=params[0]
        elif kwds:
            if kwds.has_key("element") and kwds.has_key("doc"):
                _element=kwds["element"]
                _doc=kwds["doc"]
            else:
                (_element, _doc)=self._createElement(**kwds)
        else:
            raise TypeError("__init__() takes exactly 2 arguments or different keys. (%u given)" %len(params))
        Modification.__init__(self, _element, _doc)
        self.sysrqs=list()
        for _sysrq in self.getElement().getElementsByTagName(Sysrq.TAGNAME):
            self.sysrqs.append(Sysrq(_sysrq, _doc))
コード例 #3
0
    def __init__(self, *params, **kwds):
        """
        Constructors:
        __init__(element, doc)
        __init__(self, command=cmd, [settrigger=*True|False])
        __init__(self, commands=list<cmd>, [settrigger=*True|False])
        __init__(element=element, doc=doc)

        @element: the element of the modification
        @doc: the root document
        @command: sysrq command to be executed
        @commands: list of sysrq commands to be executed
        @settrigger: set the trigger or not
        """
        if len(params) == 2:
            _element = params[0]
            _doc = params[0]
        elif kwds:
            if kwds.has_key("element") and kwds.has_key("doc"):
                _element = kwds["element"]
                _doc = kwds["doc"]
            else:
                (_element, _doc) = self._createElement(**kwds)
        else:
            raise TypeError(
                "__init__() takes exactly 2 arguments or different keys. (%u given)"
                % len(params))
        Modification.__init__(self, _element, _doc)
        self.sysrqs = list()
        for _sysrq in self.getElement().getElementsByTagName(Sysrq.TAGNAME):
            self.sysrqs.append(Sysrq(_sysrq, _doc))
コード例 #4
0
 def __init__(self, element, doc):
     Modification.__init__(self, element, doc)
コード例 #5
0
 def __init__(self, element, doc):
     """
     Creates a new requirement instance
     """
     Modification.__init__(self, element, doc)
     self._message=Message(self)
コード例 #6
0
 def __init__(self, element, doc):
     """
     Creates a new requirement instance
     """
     Modification.__init__(self, element, doc)
     self._message = Message(self)