DocumentationTools/QtHelpGenerator.py

branch
Py2 comp.
changeset 2677
3d4277929fb3
parent 2525
8b507a9a2d40
parent 2615
bdc9b4659826
child 3057
10516539f238
equal deleted inserted replaced
2670:e60ea6cb8e11 2677:3d4277929fb3
12 import sys 12 import sys
13 import os 13 import os
14 import shutil 14 import shutil
15 import subprocess 15 import subprocess
16 16
17 from Utilities import joinext, relpath, html_encode 17 from Utilities import joinext, relpath, html_encode, getQtBinariesPath
18 18
19 HelpCollection = r"""<?xml version="1.0" encoding="utf-8" ?> 19 HelpCollection = r"""<?xml version="1.0" encoding="utf-8" ?>
20 <QHelpCollectionProject version="1.0"> 20 <QHelpCollectionProject version="1.0">
21 <docFiles> 21 <docFiles>
22 <register> 22 <register>
259 259
260 cwd = os.getcwd() 260 cwd = os.getcwd()
261 # generate the compressed files 261 # generate the compressed files
262 shutil.copy(os.path.join(self.outputDir, HelpProjectFile), self.htmlDir) 262 shutil.copy(os.path.join(self.outputDir, HelpProjectFile), self.htmlDir)
263 os.chdir(self.htmlDir) 263 os.chdir(self.htmlDir)
264 subprocess.call(["qhelpgenerator", "source.qhp", 264 subprocess.call([os.path.join(getQtBinariesPath(), "qhelpgenerator"),
265 "-o", os.path.join(self.outputDir, HelpHelpFile)]) 265 "source.qhp", "-o", os.path.join(self.outputDir, HelpHelpFile)])
266 os.remove(HelpProjectFile) 266 os.remove(HelpProjectFile)
267 267
268 if self.createCollection: 268 if self.createCollection:
269 sys.stdout.write("Generating QtHelp collection...\n") 269 sys.stdout.write("Generating QtHelp collection...\n")
270 sys.stdout.flush() 270 sys.stdout.flush()
271 sys.stderr.flush() 271 sys.stderr.flush()
272 os.chdir(self.outputDir) 272 os.chdir(self.outputDir)
273 subprocess.call(["qcollectiongenerator", "source.qhcp", "-o", "collection.qhc"]) 273 subprocess.call([os.path.join(getQtBinariesPath(), "qcollectiongenerator"),
274 "source.qhcp", "-o", "collection.qhc"])
274 275
275 os.chdir(cwd) 276 os.chdir(cwd)

eric ide

mercurial