Mercurial > p > roundup > code
view roundup/dist/command/build_doc.py @ 7800:2d4684e4702d
fix: enhancement to history command output and % template fix.
Rather than using the key field, use the label field for descriptions.
Call cls.labelprop(default_to_id=True) so it returns id rather than
the first sorted property name.
If labelprop() returns 'id' or 'title', we return nothing. 'id' means
there is no label set and no properties named 'name' or 'title'. So
have the caller do whatever it wants (prepend classname for example)
when there is no human readable name. This prevents %(name)s%(key)s
from producing: 23(23).
Also don't accept the 'title' property. Titles can be too
long. Arguably we could: '%(name)20s' to limit the title
length. However without ellipses or something truncating the title
might be confusing. So again pretend there is no human readable name.
| author | John Rouillard <rouilj@ieee.org> |
|---|---|
| date | Tue, 12 Mar 2024 11:52:17 -0400 |
| parents | d2ca7b1bfc6b |
| children |
line wrap: on
line source
# # Copyright (C) 2009 Stefan Seefeld # All rights reserved. # For license terms see the file COPYING.txt. # import os, sys import os.path try: from setuptools.command.install import install as _build_py except ImportError: from distutils.command.build import build as _build_py # try/except clause orig_build = _build_py try: # would be nice to use setuptools.Command.spawn() as it # obeys the dry-run flag. from subprocess import run as spawn except ImportError: from distutils.spawn import spawn # try/except: in except for subprocess try: from distutils.spawn import find_executable # try/except: in try local find except ImportError: from roundup.dist.command import find_executable class build_doc(_build_py): """Defines the specific procedure to build roundup's documentation.""" description = "build documentation" def run(self): """Run this command, i.e. do the actual document generation.""" sphinx = find_executable('sphinx-build') if sphinx: sphinx = [sphinx] else: try: # try to find version installed with Python tools # tested with Sphinx 1.1.3 import sphinx as sp except ImportError: pass else: sphinx = [sys.executable, sp.__file__] if not sphinx: self.warn("could not find sphinx-build in PATH") self.warn("cannot build documentation") return doc_dir = os.path.join('share', 'doc', 'roundup', 'html') temp_dir = os.path.join(self.build_base, 'temp.doc') cmd = sphinx + ['-d', temp_dir, 'doc', doc_dir] spawn(cmd)
