DocumentationTools/QtHelpGenerator.py

changeset 2596
32c4afbe0801
parent 2302
f29e9405c851
child 2615
bdc9b4659826
equal deleted inserted replaced
2595:921067c38243 2596:32c4afbe0801
9 9
10 import sys 10 import sys
11 import os 11 import os
12 import shutil 12 import shutil
13 import subprocess 13 import subprocess
14
15 from PyQt4.QtCore import QLibraryInfo
14 16
15 from Utilities import joinext, relpath, html_encode 17 from Utilities import joinext, relpath, html_encode
16 18
17 HelpCollection = r"""<?xml version="1.0" encoding="utf-8" ?> 19 HelpCollection = r"""<?xml version="1.0" encoding="utf-8" ?>
18 <QHelpCollectionProject version="1.0"> 20 <QHelpCollectionProject version="1.0">
257 259
258 cwd = os.getcwd() 260 cwd = os.getcwd()
259 # generate the compressed files 261 # generate the compressed files
260 shutil.copy(os.path.join(self.outputDir, HelpProjectFile), self.htmlDir) 262 shutil.copy(os.path.join(self.outputDir, HelpProjectFile), self.htmlDir)
261 os.chdir(self.htmlDir) 263 os.chdir(self.htmlDir)
262 subprocess.call(["qhelpgenerator", "source.qhp", 264 subprocess.call([os.path.join(QLibraryInfo.location(QLibraryInfo.BinariesPath),
263 "-o", os.path.join(self.outputDir, HelpHelpFile)]) 265 "qhelpgenerator"),
266 "source.qhp", "-o", os.path.join(self.outputDir, HelpHelpFile)])
264 os.remove(HelpProjectFile) 267 os.remove(HelpProjectFile)
265 268
266 if self.createCollection: 269 if self.createCollection:
267 sys.stdout.write("Generating QtHelp collection...\n") 270 sys.stdout.write("Generating QtHelp collection...\n")
268 sys.stdout.flush() 271 sys.stdout.flush()
269 sys.stderr.flush() 272 sys.stderr.flush()
270 os.chdir(self.outputDir) 273 os.chdir(self.outputDir)
271 subprocess.call(["qcollectiongenerator", "source.qhcp", "-o", "collection.qhc"]) 274 subprocess.call([os.path.join(
275 QLibraryInfo.location(QLibraryInfo.BinariesPath),
276 "qcollectiongenerator"),
277 "source.qhcp", "-o", "collection.qhc"])
272 278
273 os.chdir(cwd) 279 os.chdir(cwd)

eric ide

mercurial