1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
|
#!/usr/bin/env python
import os
import subprocess
import shutil
PROJECT='simplejson'
def _get_version():
from pkg_resources import PathMetadata, Distribution
egg_info = PROJECT + '.egg-info'
base_dir = os.path.dirname(egg_info)
metadata = PathMetadata(base_dir, egg_info)
dist_name = os.path.splitext(os.path.basename(egg_info))[0]
dist = Distribution(base_dir, project_name=dist_name, metadata=metadata)
return dist.version
VERSION = _get_version()
PUDGE = '/Library/Frameworks/Python.framework/Versions/2.4/bin/pudge'
#PUDGE = 'pudge'
res = subprocess.call([
PUDGE, '-v', '-d', 'docs', '-m', PROJECT,
'-l', '%s %s' % (PROJECT, VERSION),
'--theme=green'
])
if not res:
shutil.copyfile('docs/module-simplejson.html', 'docs/index.html')
raise SystemExit(res)
|