File: make_docs.py

package info (click to toggle)
simplejson 1.9.2-1
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 752 kB
  • ctags: 1,480
  • sloc: python: 1,549; ansic: 582; makefile: 52; sh: 2
file content (28 lines) | stat: -rwxr-xr-x 806 bytes parent folder | download
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)