-##############################################################################\r
-# Name: misc/scripts/update_doc_utils.py\r
-# Purpose: base utilities for others update_doc_*.py scripts\r
-# Created: 2007-08-1\r
-# RCS-ID: $Id: makeunixtags.sh 46320 2007-06-04 11:02:29Z VZ $\r
-# Copyright: (c) 2007 Francesco Montorsi\r
-# Licence: wxWindows licence\r
-##############################################################################\r
-\r
-import sys, os, glob, distutils.file_util\r
-\r
-DOCS_PATH="../../docs/latex/wx"\r
-\r
-# Calls the given callback with the name of a documented class, its .tex related file,\r
-# the content of that .tex file and the number of the line of the relative \class tag,\r
-# for all documented class in DOCS_PATH. If the callback returns false the processing is stopped.\r
-# Returns the number of .tex files processed.\r
-def scanTexFiles(callback):\r
- count = 0\r
- for f in glob.glob(DOCS_PATH + '/*.tex'):\r
- file = open(f, "r")\r
- if not file:\r
- print "could not open %s" % f\r
- continue\r
- print "opened file %s" % f\r
- count = count + 1\r
-\r
- # search \class tags\r
- content = file.readlines()\r
- classdecl = 0\r
- for i in range(len(content)):\r
- line = content[i]\r
- if "\class{" in line:\r
- classdecl = classdecl + 1\r
-\r
- # polish the class name\r
- classname = line\r
- classname = classname[classname.find("\class{"):]\r
- classname = classname[classname.find("{")+1:classname.find("}")]\r
- print " the class declared is named '%s'" % classname\r
-\r
- # process this \class\r
- if not callback(classname, f, content, i):\r
- return count\r
-\r
- print " file %s contains %d class declarations" % (f, classdecl)\r
-\r
- return count\r
-\r
+##############################################################################
+# Name: misc/scripts/update_doc_utils.py
+# Purpose: base utilities for others update_doc_*.py scripts
+# Created: 2007-08-1
+# Copyright: (c) 2007 Francesco Montorsi
+# Licence: wxWindows licence
+##############################################################################
+
+import sys, os, glob, distutils.file_util
+
+DOCS_PATH="../../docs/latex/wx"
+
+# Calls the given callback with the name of a documented class, its .tex related file,
+# the content of that .tex file and the number of the line of the relative \class tag,
+# for all documented class in DOCS_PATH. If the callback returns false the processing is stopped.
+# Returns the number of .tex files processed.
+def scanTexFiles(callback):
+ count = 0
+ for f in glob.glob(DOCS_PATH + '/*.tex'):
+ file = open(f, "r")
+ if not file:
+ print "could not open %s" % f
+ continue
+ print "opened file %s" % f
+ count = count + 1
+
+ # search \class tags
+ content = file.readlines()
+ classdecl = 0
+ for i in range(len(content)):
+ line = content[i]
+ if "\class{" in line:
+ classdecl = classdecl + 1
+
+ # polish the class name
+ classname = line
+ classname = classname[classname.find("\class{"):]
+ classname = classname[classname.find("{")+1:classname.find("}")]
+ print " the class declared is named '%s'" % classname
+
+ # process this \class
+ if not callback(classname, f, content, i):
+ return count
+
+ print " file %s contains %d class declarations" % (f, classdecl)
+
+ return count
+