]>
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
6 # Copyright: (c) 2007 Francesco Montorsi
7 # Licence: wxWindows licence
8 ##############################################################################
10 import sys
, os
, glob
, distutils
.file_util
12 DOCS_PATH
="../../docs/latex/wx"
14 # Calls the given callback with the name of a documented class, its .tex related file,
15 # the content of that .tex file and the number of the line of the relative \class tag,
16 # for all documented class in DOCS_PATH. If the callback returns false the processing is stopped.
17 # Returns the number of .tex files processed.
18 def scanTexFiles(callback
):
20 for f
in glob
.glob(DOCS_PATH
+ '/*.tex'):
23 print "could not open %s" % f
25 print "opened file %s" % f
29 content
= file.readlines()
31 for i
in range(len(content
)):
34 classdecl
= classdecl
+ 1
36 # polish the class name
38 classname
= classname
[classname
.find("\class{"):]
39 classname
= classname
[classname
.find("{")+1:classname.find("}")]
40 print " the class declared is named '%s'" % classname
43 if not callback(classname
, f
, content
, i
):
46 print " file %s contains %d class declarations" % (f
, classdecl
)