mirror of
				https://github.com/python/cpython.git
				synced 2025-11-04 03:44:55 +00:00 
			
		
		
		
	.use_latex(): Make this a little smarter so that it only runs pdflatex
once if all the temporary files are available from building
               a DVI file.  This can avoid two runs of pdflatex.
			
			
This commit is contained in:
		
							parent
							
								
									51f53df4c8
								
							
						
					
					
						commit
						df84facf0d
					
				
					 1 changed files with 24 additions and 31 deletions
				
			
		| 
						 | 
					@ -276,25 +276,29 @@ class Job:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def use_latex(self, binary):
 | 
					    def use_latex(self, binary):
 | 
				
			||||||
        self.require_temps(binary=binary)
 | 
					        self.require_temps(binary=binary)
 | 
				
			||||||
        if os.path.isfile("mod%s.idx" % self.doc):
 | 
					        if self.latex_runs < 2:
 | 
				
			||||||
            self.run("%s mod%s.idx" % (MAKEINDEX_BINARY, self.doc))
 | 
					            if os.path.isfile("mod%s.idx" % self.doc):
 | 
				
			||||||
        if os.path.isfile(self.doc + ".idx"):
 | 
					                self.run("%s mod%s.idx" % (MAKEINDEX_BINARY, self.doc))
 | 
				
			||||||
            # call to Doc/tools/fix_hack omitted; doesn't appear necessary
 | 
					            if os.path.isfile(self.doc + ".idx"):
 | 
				
			||||||
            self.run("%s %s.idx" % (MAKEINDEX_BINARY, self.doc))
 | 
					                # call to Doc/tools/fix_hack omitted; doesn't appear necessary
 | 
				
			||||||
            import indfix
 | 
					                self.run("%s %s.idx" % (MAKEINDEX_BINARY, self.doc))
 | 
				
			||||||
            indfix.process(self.doc + ".ind")
 | 
					                import indfix
 | 
				
			||||||
        if self.use_bibtex:
 | 
					                indfix.process(self.doc + ".ind")
 | 
				
			||||||
            self.run("%s %s" % (BIBTEX_BINARY, self.doc))
 | 
					            if self.use_bibtex:
 | 
				
			||||||
        self.process_synopsis_files()
 | 
					                self.run("%s %s" % (BIBTEX_BINARY, self.doc))
 | 
				
			||||||
        #
 | 
					            self.process_synopsis_files()
 | 
				
			||||||
        # let the doctype-specific handler do some intermediate work:
 | 
					            #
 | 
				
			||||||
        #
 | 
					            # let the doctype-specific handler do some intermediate work:
 | 
				
			||||||
        if self.doctype == "manual":
 | 
					            #
 | 
				
			||||||
            self.use_latex_manual(binary=binary)
 | 
					            self.run("%s %s" % (binary, self.doc))
 | 
				
			||||||
        elif self.doctype == "howto":
 | 
					            self.latex_runs += 1
 | 
				
			||||||
            self.use_latex_howto(binary=binary)
 | 
					            if os.path.isfile("mod%s.idx" % self.doc):
 | 
				
			||||||
        else:
 | 
					                self.run("%s -s %s mod%s.idx"
 | 
				
			||||||
            raise RuntimeError, "unsupported document type: " + self.doctype
 | 
					                         % (MAKEINDEX_BINARY, ISTFILE, self.doc))
 | 
				
			||||||
 | 
					            if os.path.isfile(self.doc + ".idx"):
 | 
				
			||||||
 | 
					                self.run("%s -s %s %s.idx"
 | 
				
			||||||
 | 
					                         % (MAKEINDEX_BINARY, ISTFILE, self.doc))
 | 
				
			||||||
 | 
					            self.process_synopsis_files()
 | 
				
			||||||
        #
 | 
					        #
 | 
				
			||||||
        # and now finish it off:
 | 
					        # and now finish it off:
 | 
				
			||||||
        #
 | 
					        #
 | 
				
			||||||
| 
						 | 
					@ -308,18 +312,7 @@ class Job:
 | 
				
			||||||
        if self.use_bibtex:
 | 
					        if self.use_bibtex:
 | 
				
			||||||
            self.run("%s %s" % (BIBTEX_BINARY, self.doc))
 | 
					            self.run("%s %s" % (BIBTEX_BINARY, self.doc))
 | 
				
			||||||
        self.run("%s %s" % (binary, self.doc))
 | 
					        self.run("%s %s" % (binary, self.doc))
 | 
				
			||||||
 | 
					        self.latex_runs += 1
 | 
				
			||||||
    def use_latex_howto(self, binary):
 | 
					 | 
				
			||||||
        self.run("%s %s" % (binary, self.doc))
 | 
					 | 
				
			||||||
        if os.path.isfile("mod%s.idx" % self.doc):
 | 
					 | 
				
			||||||
            self.run("%s -s %s mod%s.idx"
 | 
					 | 
				
			||||||
                     % (MAKEINDEX_BINARY, ISTFILE, self.doc))
 | 
					 | 
				
			||||||
        if os.path.isfile(self.doc + ".idx"):
 | 
					 | 
				
			||||||
            self.run("%s -s %s %s.idx" % (MAKEINDEX_BINARY, ISTFILE, self.doc))
 | 
					 | 
				
			||||||
        self.process_synopsis_files()
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    def use_latex_manual(self, binary):
 | 
					 | 
				
			||||||
        self.use_latex_howto(binary)
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def process_synopsis_files(self):
 | 
					    def process_synopsis_files(self):
 | 
				
			||||||
        synopsis_files = glob.glob(self.doc + "*.syn")
 | 
					        synopsis_files = glob.glob(self.doc + "*.syn")
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue