211 """Report summary stats on "sub-library" files and libtesseract Project file."""
213 vs2010Dir = os.path.join(tessDir,
"vs2008")
214 libTessDir = os.path.join(vs2010Dir,
"libtesseract")
215 libProjectFile = os.path.join(libTessDir,
"libtesseract.vcproj")
216 tessAbsDir = os.path.abspath(tessDir)
217 nTrimChars = len(tessAbsDir)+1
219 projectFilesSet, projectHFiles, projectCFiles, projectRFiles = \
223 print(
'Summary stats for "%s" library directories' % tessAbsDir)
225 for tessFile
in tessFiles:
226 tessFile = tessFile.lower()
227 folder, head = os.path.split(tessFile)
228 file, ext = os.path.splitext(head)
229 typeCounter = folderCounters.setdefault(folder, collections.Counter())
230 typeCounter[ext[1:]] += 1
232 folders = list(folderCounters.keys())
240 print(
" total h cpp")
241 print(
" ----- --- ---")
242 for folder
in folders:
243 counters = folderCounters[folder]
244 nHFiles = counters[
'h']
245 nCPPFiles = counters[
'cpp']
247 total = nHFiles + nCPPFiles
250 totalCPP += nCPPFiles
252 print(
" %5d %3d %3d %s" % (total, nHFiles, nCPPFiles, folder))
253 print(
" ----- --- ---")
254 print(
" %5d %3d %3d" % (totalFiles, totalH, totalCPP))
257 print(
'Summary stats for VS2008 Project "%s"' % libProjectFile)
258 print(
" %5d %s" %(len(projectHFiles),
"Header files"))
259 print(
" %5d %s" % (len(projectCFiles),
"Source files"))
260 print(
" %5d %s" % (len(projectRFiles),
"Resource files"))
262 print(
" %5d" % (len(projectHFiles) + len(projectCFiles) + len(projectRFiles), ))