~ubuntu-branches/ubuntu/wily/hedgewars/wily

« back to all changes in this revision

Viewing changes to misc/libfreetype/src/tools/docmaker/docmaker.py

  • Committer: Package Import Robot
  • Author(s): Dmitry E. Oboukhov
  • Date: 2011-09-23 10:16:55 UTC
  • mfrom: (1.2.11 upstream)
  • Revision ID: package-import@ubuntu.com-20110923101655-3977th2gc5n0a3pv
Tags: 0.9.16-1
* New upstream version.
 + Downloadable content! Simply click to install any content.
   New voices, hats, maps, themes, translations, music, scripts...
   Hedgewars is now more customisable than ever before! As time goes
   by we will be soliciting community content to feature on this page,
   so remember to check it from time to time. If you decide you want
   to go back to standard Hedgewars, just remove the Data directory
   from your Hedgewars config directory.
 + 3-D rendering! Diorama-like rendering of the game in a variety
   of 3D modes. Let us know which ones work best for you, we didn't
   really have the equipment to test them all.
 + Resizable game window.
 + New utilities! The Time Box will remove one of your hedgehogs
   from the game for a while, protecting from attack until it returns,
   somewhere else on the map. Land spray will allow you to build bridges,
   seal up holes, or just make life unpleasant for your enemies.
 + New single player: Bamboo Thicket, That Sinking Feeling, Newton and
   the Tree and multi-player: The Specialists, Space Invaders,
   Racer - scripts! And a ton more script hooks for scripters
 + New twists on old weapons. Drill strike, seduction and fire have
   been adjusted. Defective mines have been added, rope can attach to
   hogs/crates/barrels again, grenades now have variable bounce (use
   precise key + 1-5). Portal gun is now more usable in flight and
   all game actions are a lot faster.
 + New theme - Golf, dozens of new community hats and a new
   localised Default voice, Ukranian.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/env python
 
2
#
 
3
#  DocMaker (c) 2002, 2004, 2008 David Turner <david@freetype.org>
 
4
#
 
5
# This program is a re-write of the original DocMaker took used
 
6
# to generate the API Reference of the FreeType font engine
 
7
# by converting in-source comments into structured HTML.
 
8
#
 
9
# This new version is capable of outputting XML data, as well
 
10
# as accepts more liberal formatting options.
 
11
#
 
12
# It also uses regular expression matching and substitution
 
13
# to speed things significantly.
 
14
#
 
15
 
 
16
from sources   import *
 
17
from content   import *
 
18
from utils     import *
 
19
from formatter import *
 
20
from tohtml    import *
 
21
 
 
22
import utils
 
23
 
 
24
import sys, os, time, string, glob, getopt
 
25
 
 
26
 
 
27
def  usage():
 
28
    print "\nDocMaker Usage information\n"
 
29
    print "  docmaker [options] file1 [file2 ...]\n"
 
30
    print "using the following options:\n"
 
31
    print "  -h : print this page"
 
32
    print "  -t : set project title, as in '-t \"My Project\"'"
 
33
    print "  -o : set output directory, as in '-o mydir'"
 
34
    print "  -p : set documentation prefix, as in '-p ft2'"
 
35
    print ""
 
36
    print "  --title  : same as -t, as in '--title=\"My Project\"'"
 
37
    print "  --output : same as -o, as in '--output=mydir'"
 
38
    print "  --prefix : same as -p, as in '--prefix=ft2'"
 
39
 
 
40
 
 
41
def  main( argv ):
 
42
    """main program loop"""
 
43
 
 
44
    global output_dir
 
45
 
 
46
    try:
 
47
        opts, args = getopt.getopt( sys.argv[1:], \
 
48
                                    "ht:o:p:",    \
 
49
                                    ["help", "title=", "output=", "prefix="] )
 
50
    except getopt.GetoptError:
 
51
        usage()
 
52
        sys.exit( 2 )
 
53
 
 
54
    if args == []:
 
55
        usage()
 
56
        sys.exit( 1 )
 
57
 
 
58
    # process options
 
59
    #
 
60
    project_title  = "Project"
 
61
    project_prefix = None
 
62
    output_dir     = None
 
63
 
 
64
    for opt in opts:
 
65
        if opt[0] in ( "-h", "--help" ):
 
66
            usage()
 
67
            sys.exit( 0 )
 
68
 
 
69
        if opt[0] in ( "-t", "--title" ):
 
70
            project_title = opt[1]
 
71
 
 
72
        if opt[0] in ( "-o", "--output" ):
 
73
            utils.output_dir = opt[1]
 
74
 
 
75
        if opt[0] in ( "-p", "--prefix" ):
 
76
            project_prefix = opt[1]
 
77
 
 
78
    check_output()
 
79
 
 
80
    # create context and processor
 
81
    source_processor  = SourceProcessor()
 
82
    content_processor = ContentProcessor()
 
83
 
 
84
    # retrieve the list of files to process
 
85
    file_list = make_file_list( args )
 
86
    for filename in file_list:
 
87
        source_processor.parse_file( filename )
 
88
        content_processor.parse_sources( source_processor )
 
89
 
 
90
    # process sections
 
91
    content_processor.finish()
 
92
 
 
93
    formatter = HtmlFormatter( content_processor, project_title, project_prefix )
 
94
 
 
95
    formatter.toc_dump()
 
96
    formatter.index_dump()
 
97
    formatter.section_dump_all()
 
98
 
 
99
 
 
100
# if called from the command line
 
101
#
 
102
if __name__ == '__main__':
 
103
    main( sys.argv )
 
104
 
 
105
 
 
106
# eof