File: make_docs.py

package info (click to toggle)
simplejson 1.3-0.1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 472 kB
  • ctags: 1,026
  • sloc: python: 953; makefile: 13; sh: 1
file content (26 lines) | stat: -rwxr-xr-x 721 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
#!/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()


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)