Logo Search packages:      
Sourcecode: dblatex version File versions  Download package

def dbtexmf::dblatex::grubber::index::Index::post_compile (   self  ) 

Run makeindex if needed, with appropriate options and environment.

Definition at line 103 of file index.py.

00103                            :
        """
        Run makeindex if needed, with appropriate options and environment.
        """
        if not os.path.exists(self.source):
            msg.log(_("strange, there is no %s") % self.source, pkg="index")
            return 0
        if not self.run_needed():
            return 0

        msg.progress(_("processing index %s") % self.source)

        if self.tool == "makeindex":
            cmd = ["makeindex", "-o", self.target] + self.opts
            cmd.extend(["-t", self.transcript])
            if self.style:
                cmd.extend(["-s", self.style])
            cmd.append(self.source)
            path_var = "INDEXSTYLE"

        elif self.tool == "xindy":
            cmd = ["texindy", "--quiet"]
            for opt in self.opts:
                if opt == "-g":
                    if self.lang != "":
                        msg.warn(_("'language' overrides 'order german'"),
                            pkg="index")
                    else:
                        self.lang = "german-din"
                elif opt == "-l":
                    self.modules.append("letter-ordering")
                    msg.warn(_("use 'module letter-ordering' instead of 'order letter'"),
                        pkg="index")
                else:
                    msg.error("unknown option to xindy: %s" % opt, pkg="index")
            for mod in self.modules:
                cmd.extend(["--module", mod])
            if self.lang:
                cmd.extend(["--language", self.lang])
            cmd.append(self.source)
            path_var = "XINDY_SEARCHPATH"

        if self.path != []:
            env = { path_var:
                string.join(self.path + [os.getenv(path_var, "")], ":") }
        else:
            env = {}
#        if self.doc.env.execute(cmd, env):
#            msg.error(_("could not make index %s") % self.target)
#            return 1
        msg.debug(" ".join(cmd))
        rc = os.system(" ".join(cmd))
        if (rc != 0):
            msg.error(_("could not make index %s") % self.target)
            return 1

        self.doc.must_compile = 1
        return 0

    def run_needed (self):


Generated by  Doxygen 1.6.0   Back to index