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

def checkload::NewDruid::build_selector (   self,
  checklists 
)

Creates pages for selecting a new checklist.

Arguments:
:checklists: list of checklists we can instantiate.

Definition at line 142 of file checkload.py.

00142                                         :
        '''Creates pages for selecting a new checklist.

        Arguments:
        :checklists: list of checklists we can instantiate.
        '''
        selectorPage = gnome.ui.DruidPageStandard()
        self.selectorPage = selectorPage
        selectorPage.set_title('Select the Checklist to start')
        selectorPage.set_logo(self.logo)
        selectorGroup = gtk.VBox()
        
        selectorLabel = gtk.Label("Please select the type of review you wish"
                " to start from the following list.  If you don't see the"
                " type of review you want to create it means no one has"
                " taken the time to write a checklist definition for it yet."
                " Please consider contributing one if that's the case.")
        selectorLabel.set_line_wrap(True)
        selectorGroup.add(selectorLabel)
        
        # Create a selection menu to choose from the available checklists
        checkStore = gtk.ListStore(gobject.TYPE_STRING,
                gobject.TYPE_STRING,
                gobject.TYPE_STRING)
        for filename in checklists:
            summary = None
            name = None
            # Set up a stream reader for the checklist file.
            try:
                checkReader = libxml2.newTextReaderFilename(filename)
            except libxml2.treeError:
                print '%s was not a CheckList file' % (filename)
                continue
            
            # Read in the summary and name for the checklist
            status = checkReader.Read()
            while status == 1:
                if (checkReader.LocalName() == 'checklist' and
                        checkReader.NodeType() == 1):
                    name = checkReader.GetAttribute('name')
                elif checkReader.LocalName() == 'summary':
                    status = checkReader.Read()     # Get the text element
                    if status == 1:
                        summary = checkReader.Value()
                    break
                status = checkReader.Read()
            
            if not (summary and name):
                print 'Unable to get a summary and name from %s' % (filename)
                continue
            
            # Enter the information into the checkStore
            checkIter = checkStore.append(None)
            checkStore.set(checkIter, self.__FILENAME, filename,
                    self.__CHECKNAME, name,
                    self.__CHECKSUMMARY, summary)
                   
        checkList = gtk.TreeView(checkStore)
        self.selectorSelection = checkList.get_selection()
        self.selectorSelection.set_mode(gtk.SELECTION_SINGLE)

        renderer = gtk.CellRendererText()
        column = gtk.TreeViewColumn('Name', renderer, text=1)
        checkList.append_column(column)

        renderer = gtk.CellRendererText()
        column = gtk.TreeViewColumn('Summary', renderer, text=2)
        checkList.append_column(column)

        selectorGroup.add(checkList)
        selectorPage.append_item('', selectorGroup, '')

        selectorPage.connect('next', self.selector_next)

        self.druidWidget.add(selectorPage)

        # Double-clicking the row is the same as selecting next.
        checkList.connect('row-activated',
                lambda self, selector, column, druid: druid.next.clicked(),
                self.druidWidget)

    def build_loader(self):


Generated by  Doxygen 1.6.0   Back to index