Exemplo n.º 1
0
    def printOrphanCatEnt(self, OrphanICat):
        """ Print orphan catalog entry.  """    
        if OrphanICat != []:
            endOrphanSection = False
            for ligne in HtOrphans:
                if ligne.find("__ORPHANENTRY__") >= 0:
                    oprhanLine = ligne
                    break
                else:
                    self.repfile.write(ligne)

            for iCat in OrphanICat:
                catEntry = getCatEntry (iCat)
                Ts = catEntry[0][0]
                Name = catEntry[0][1]
                str = "<TT>" + ("%04i" % iCat) + " -- " + \
                      Ts.replace("  ", " &nbsp;") + " -- " + Name + "</TT><BR>\n"
                ligne = oprhanLine.replace("__ORPHANENTRY__", str)
                self.repfile.write(ligne)
                           
            for ligne in HtOrphans:
                if ligne.find("__ORPHANENTRY__") < 0:
                    if endOrphanSection:
                        self.repfile.write(ligne)
                else:
                    endOrphanSection = True
Exemplo n.º 2
0
    def flush(self, statstring):
        """ Process the report body and the report end.  """
        from vinutils import TNStreams
        from vinutils import Catalog

        self.headwrite()

        self.rownumber = 0
        self.tnId    = []
        self.tnFname = []
        self.tnTs    = []
        self.tnName  = []
        
#        for (iTN, vType, filename) in TNStreams:
        for iTN in TNStreams:
            for (vType, filename) in TNStreams[iTN]:
                self.tnId.append("%04i" % iTN)
                self.tnFname.append(filename)
                catEntry = getCatEntry (iTN)
                if len(catEntry) == 0:
                    Ts = ""
                    Name = ""
                elif len(catEntry) >= 1:
                # duplicate index numbers not properly handled !!!
                    Ts = catEntry[0][0]
                    Name = catEntry[0][1]
                self.tnTs.append(Ts)
                self.tnName.append(Name)
                if len(self.tnId) >= 5:
                    self.rowflush()
            
        if len(self.tnId) > 0:
            self.rowflush()
            
        # Scanning for orphan catalog entries
        OrphanICat = []
        for iCat in Catalog:
            if not TNStreams.has_key(iCat):
                OrphanICat.append(iCat)
        self.printOrphanCatEnt(OrphanICat)
        
        self.close(statstring)