Logo Search packages:      
Sourcecode: qa-assistant version File versions  Download package

def checklist::CheckList::__Test::publish (   self,
  filename = None 
)

Saves the current state of the `CheckList` into a savefile.

Attributes:
filename -- File to save the checklist in. (default self.filename)

Saves the CheckList information into the filename.

Definition at line 443 of file checklist.py.

00443                                     :
        '''Saves the current state of the `CheckList` into a savefile.
        
        Attributes:
        filename -- File to save the checklist in. (default self.filename)
        
        Saves the CheckList information into the filename.
        '''
        
        self.filename = filename or self.filename
        if not self.filename:
            raise error.CannotAccessFile('No filename given to save to.')
        # Create the xml DOM conforming to our save DTD
        doc = libxml2.newDoc('1.0')
        doc.createIntSubset('checklist', self.publicID,
                self.canonicalURL)
        
        # Output root node
        root = doc.newChild(None, 'checklist', None)
        root.setProp('version', self.formatVersion)
        if not self.name.endswith(' Savefile'):
            self.name += ' Savefile'
        root.setProp('name', self.name)
        self.revision += 1
        root.setProp('revision', str(self.revision))
       
        # Output summary node
        root.newChild(None, 'summary', self.summary)

        # Output base checklist information
        node = root.newTextChild(None, 'base', self.baseFilename)
        node.setProp('name', self.baseName)
        node.setProp('revision', self.baseRevision)
       
        # Output properties we're concerned with
        if self.properties:
            props = root.newChild(None, 'properties', None)
            for propName in self.properties.keys():
                prop = self.properties[propName]
                node = props.newChild(None, 'property', None)
                node.setProp('name', propName)
                node.setProp('type', prop.valueType)
                require = node.newChild(None, 'require', None)
                require.setProp('type', prop.propType)
                for arg in prop.args:
                    require.newTextChild(None, 'arg', arg)
                if prop.function:
                    require.newTextChild(None, 'function', prop.function)
                if prop.value:
                    node.newTextChild(None, 'value', prop.value)

        # Output functions
        if self.functionFile:
            funcs = root.newTextChild(None, 'functions', self.functionFile)
            funcs.setProp('hash', self.functionHash)
            funcs.setProp('hashtype', self.functionHashType)
        
        # Output entries
        self.foreach(self.__create_entry, root)

        # Write the file
        doc.saveFormatFileEnc(self.filename, 'UTF-8', True)
        doc.freeDoc()

    def unpangoize_output(self, output):


Generated by  Doxygen 1.6.0   Back to index