Changeset 4415
- Timestamp:
- 03/29/09 20:01:14 (4 years ago)
- Location:
- branch/PacketManipulator
- Files:
-
- 4 added
- 1 modified
-
PM/share/doc (added)
-
PM/share/doc/src (added)
-
PM/share/doc/src/conf.py (added)
-
PM/share/doc/src/index.rst (added)
-
setup.py (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branch/PacketManipulator/setup.py
r3693 r4415 19 19 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 20 20 21 import re 21 22 import sys 22 23 import glob 23 import os, os.path 24 25 import os 26 import os.path 24 27 25 28 from distutils.core import setup, Extension 26 29 from distutils.command.install import install 30 from distutils.command.build import build 27 31 from PM.Core.Const import PM_VERSION, PM_SITE 32 33 BASE_DOCS_DIR = os.path.join('share', 'doc', 'PacketManipulator-%s' % PM_VERSION) 34 DOCS_DIR = os.path.join('generated-doc', 'html') 28 35 29 36 def getoutput(cmd): … … 123 130 targetpath = os.path.dirname(os.path.join("share/locale",lang)) 124 131 mo_files.append((targetpath, [filepath])) 132 133 class pm_build(build): 134 def build_html_doc(self): 135 """Build the html documentation.""" 136 137 try: 138 import sphinx 139 except ImportError: 140 self.warn("sphinx not found, documentation won't be build.") 141 return 142 143 sphinx_ver = sphinx.__version__ 144 def digits(x): 145 res = re.match('\d+', x) 146 if res is None: 147 return 0 148 else: 149 return int(res.group()) 150 if map(digits, sphinx_ver.split('.')) < [0, 5, 1]: 151 self.warn("Sphinx's version is too old (%s, expected at least " 152 "0.5.1, documentation won't be build." % sphinx_ver) 153 return 154 155 # Build the documentation just like it is done through the Makefile 156 sphinx.main([__file__, 157 "-b", "html", 158 "-d", os.path.join("PM", "share", "doc", "doctrees"), 159 os.path.join("PM", "share", "doc", "src"), DOCS_DIR]) 160 161 def run(self): 162 self.build_html_doc() 163 build.run(self) 125 164 126 165 class pm_install(install): … … 221 260 'PM.higwidgets' 222 261 ], 223 data_files = [('share/pixmaps/umit', glob.glob("PM/share/pixmaps/umit/*"))] + mo_files, 262 data_files = [('share/pixmaps/umit', 263 glob.glob("PM/share/pixmaps/umit/*")), 264 (BASE_DOCS_DIR, glob.glob(DOCS_DIR + "/*/*")), 265 ] + mo_files, 224 266 scripts = ['PM/PacketManipulator'], 225 267 ext_modules = modules, 226 cmdclass = {'install' : pm_install} 268 cmdclass = {'install' : pm_install, 269 'build' : pm_build} 227 270 )
