]>
git.saurik.com Git - wxWidgets.git/blob - misc/scripts/update_doc_utils.py
1 ##############################################################################
2 # Name: misc/scripts/update_doc_utils.py
3 # Purpose: base utilities for others update_doc_*.py scripts
5 # Copyright: (c) 2007 Francesco Montorsi
6 # Licence: wxWindows licence
7 ##############################################################################
9 import sys
, os
, glob
, distutils
.file_util
11 DOCS_PATH
="../../docs/latex/wx"
13 # Calls the given callback with the name of a documented class, its .tex related file,
14 # the content of that .tex file and the number of the line of the relative \class tag,
15 # for all documented class in DOCS_PATH. If the callback returns false the processing is stopped.
16 # Returns the number of .tex files processed.
17 def scanTexFiles(callback
):
19 for f
in glob
.glob(DOCS_PATH
+ '/*.tex'):
22 print "could not open %s" % f
24 print "opened file %s" % f
28 content
= file.readlines()
30 for i
in range(len(content
)):
33 classdecl
= classdecl
+ 1
35 # polish the class name
37 classname
= classname
[classname
.find("\class{"):]
38 classname
= classname
[classname
.find("{")+1:classname.find("}")]
39 print " the class declared is named '%s'" % classname
42 if not callback(classname
, f
, content
, i
):
45 print " file %s contains %d class declarations" % (f
, classdecl
)