~ubuntu-branches/debian/squeeze/nose/squeeze

« back to all changes in this revision

Viewing changes to scripts/mkindex.py

  • Committer: Bazaar Package Importer
  • Author(s): Torsten Marek, Torsten Marek, Gustavo Noronha Silva
  • Date: 2008-06-12 13:39:43 UTC
  • mfrom: (1.2.1 upstream) (2.1.5 intrepid)
  • Revision ID: james.westby@ubuntu.com-20080612133943-2q7syp67fwl4on13
Tags: 0.10.3-1

[Torsten Marek]
* New upstream release (Closes: #461994)
* debian/control
  - bump standards version to 3.8.0, no changes necessary
  - add suggestions for python-coverage (Closes: #457053)
  - change dependency on python-setuptools into 
    python-pkg-resources (Closes: #468719)
  - added myself to uploaders

[Gustavo Noronha Silva]
* debian/control:
  - remove -1 from build-dep on setuptools

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#!/usr/bin/env python
2
 
 
3
 
from docutils.core import publish_string, publish_parts
4
 
import nose
5
 
import nose.tools
6
 
import os
7
 
import re
8
 
import time
9
 
 
10
 
root = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
11
 
 
12
 
print "Main..."
13
 
tpl = open(os.path.join(root, 'index.html.tpl'), 'r').read()
14
 
 
15
 
pat = re.compile(r'^.*(Basic usage)', re.DOTALL)
16
 
txt = nose.__doc__.replace(':: python','::')
17
 
txt = pat.sub(r'\1', txt)
18
 
docs = publish_parts(txt, writer_name='html')
19
 
docs.update({'version': nose.__version__,
20
 
             'date': time.ctime()})
21
 
 
22
 
# print "Tools..."
23
 
# tools = publish_parts(nose.tools.__doc__, writer_name='html')
24
 
# docs['tools'] = tools['body']
25
 
 
26
 
print "Changelog..."
27
 
changes = open(os.path.join(root, 'CHANGELOG'), 'r').read()
28
 
changes_html = publish_parts(changes, writer_name='html')
29
 
docs['changelog'] = changes_html['body']
30
 
 
31
 
print "News..."
32
 
news = open(os.path.join(root, 'NEWS'), 'r').read()
33
 
news_html = publish_parts(news, writer_name='html')
34
 
docs['news'] = news_html['body']
35
 
 
36
 
print "Usage..."
37
 
usage_txt = nose.configure(help=True).replace('mkindex.py', 'nosetests')
38
 
# FIXME remove example plugin & html output parts
39
 
docs['usage'] = '<pre>%s</pre>' % usage_txt
40
 
 
41
 
out = tpl % docs
42
 
 
43
 
index = open(os.path.join(root, 'index.html'), 'w')
44
 
index.write(out)
45
 
index.close()
46
 
 
47
 
readme = open(os.path.join(root, 'README.txt'), 'w')
48
 
readme.write(nose.__doc__)
49
 
readme.close()