예제 #1
0
    def _importNode(self, node):
        """
        Import the settings from the DOM node.
        """

        MembraneToolXMLAdapter._importNode(self, node)
        self._annotateHash(node)
예제 #2
0
    def _importNode(self, node):
        """
        Import the settings from the DOM node.
        """

        MembraneToolXMLAdapter._importNode(self, node)
        self._annotateHash(node)
예제 #3
0
 def _exportNode(self):
     """
     Export the contents as an xml node
     """
     node = MembraneToolXMLAdapter._exportNode(self)
     mbtool = getToolByName(self.context, 'membrane_tool')
     annot = IAnnotations(mbtool)
     try:
         htype = annot[ANNOT_KEY]['hash_type']
         child = self._doc.createElement('hash-type')
         child.setAttribute('name', htype)
         fragment = self._doc.createDocumentFragment()
         fragment.appendChild(child)
         node.appendChild(fragment)
         self._logger.info("Remember hash-type exported: %s" % htype)
     except KeyError: # no hash_type annotated on mbtool, no need to add node
         pass
     return node
예제 #4
0
 def _exportNode(self):
     """
     Export the contents as an xml node
     """
     node = MembraneToolXMLAdapter._exportNode(self)
     mbtool = getToolByName(self.context, 'membrane_tool')
     annot = IAnnotations(mbtool)
     try:
         htype = annot[ANNOT_KEY]['hash_type']
         child = self._doc.createElement('hash-type')
         child.setAttribute('name', htype)
         fragment = self._doc.createDocumentFragment()
         fragment.appendChild(child)
         node.appendChild(fragment)
         self._logger.info("Remember hash-type exported: %s" % htype)
     except KeyError:
         # no hash_type annotated on mbtool, no need to add node
         pass
     return node