3
3
from builtins import input
4
4
"""
5
5
tesshelper.py -- Utility operations to compare, report stats, and copy
6
- public headers for tesseract 3.0x VS2008 Project
6
+ public headers for tesseract 3.0x VS2010 Project
7
7
8
8
$RCSfile: tesshelper.py,v $ $Revision: 7ca575b377aa $ $Date: 2012/03/07 17:26:31 $
9
9
"""
31
31
epilogStr = r"""
32
32
Examples:
33
33
34
- Assume that tesshelper.py is in c:\buildfolder\tesseract-3.02\vs2008 ,
34
+ Assume that tesshelper.py is in c:\buildfolder\tesseract-3.02\vs2010 ,
35
35
which is also the current directory. Then,
36
36
37
37
python tesshelper .. compare
38
38
39
39
will compare c:\buildfolder\tesseract-3.02 "library" directories to the
40
40
libtesseract Project
41
- (c:\buildfolder\tesseract-3.02\vs2008 \libtesseract\libtesseract.vcproj).
41
+ (c:\buildfolder\tesseract-3.02\vs2010 \libtesseract\libtesseract.vcproj).
42
42
43
43
python tesshelper .. report
44
44
52
52
53
53
python tesshelper .. clean
54
54
55
- will clean the vs2008 folder of all build directories, and .user, .suo,
55
+ will clean the vs2010 folder of all build directories, and .user, .suo,
56
56
.ncb, and other temp files.
57
57
58
58
"""
70
70
# ====================================================================
71
71
72
72
VERSION = "1.0 %s" % "$Date: 2012/03/07 17:26:31 $" .split ()[1 ]
73
- PROJ_SUBDIR = r"vs2008 \libtesseract"
73
+ PROJ_SUBDIR = r"vs2010 \libtesseract"
74
74
PROJFILE = "libtesseract.vcproj"
75
75
76
76
NEWHEADERS_FILENAME = "newheaders.txt"
@@ -209,7 +209,7 @@ def tessCompare(tessDir):
209
209
def tessReport (tessDir ):
210
210
"""Report summary stats on "sub-library" files and libtesseract Project file."""
211
211
212
- vs2010Dir = os .path .join (tessDir , "vs2008 " )
212
+ vs2010Dir = os .path .join (tessDir , "vs2010 " )
213
213
libTessDir = os .path .join (vs2010Dir , "libtesseract" )
214
214
libProjectFile = os .path .join (libTessDir ,"libtesseract.vcproj" )
215
215
tessAbsDir = os .path .abspath (tessDir )
@@ -253,7 +253,7 @@ def tessReport(tessDir):
253
253
print (" %5d %3d %3d" % (totalFiles , totalH , totalCPP ))
254
254
255
255
print ()
256
- print ('Summary stats for VS2008 Project "%s"' % libProjectFile )
256
+ print ('Summary stats for VS2010 Project "%s"' % libProjectFile )
257
257
print (" %5d %s" % (len (projectHFiles ), "Header files" ))
258
258
print (" %5d %s" % (len (projectCFiles ), "Source files" ))
259
259
print (" %5d %s" % (len (projectRFiles ), "Resource files" ))
@@ -359,9 +359,9 @@ def tessCopy(tessDir, includeDir):
359
359
}
360
360
361
361
extraFilesSet = {
362
- #r"vs2008 \include\stdint.h",
363
- r"vs2008 \include\leptonica_versionnumbers.vsprops" ,
364
- r"vs2008 \include\tesseract_versionnumbers.vsprops" ,
362
+ #r"vs2010 \include\stdint.h",
363
+ r"vs2010 \include\leptonica_versionnumbers.vsprops" ,
364
+ r"vs2010 \include\tesseract_versionnumbers.vsprops" ,
365
365
}
366
366
367
367
tessIncludeDir = os .path .join (includeDir , "tesseract" )
@@ -380,21 +380,21 @@ def tessCopy(tessDir, includeDir):
380
380
# ====================================================================
381
381
382
382
def tessClean (tessDir ):
383
- '''Clean vs2008 folder of all build directories and certain temp files.'''
383
+ '''Clean vs2010 folder of all build directories and certain temp files.'''
384
384
385
- vs2010Dir = os .path .join (tessDir , "vs2008 " )
386
- vs2008AbsDir = os .path .abspath (vs2010Dir )
385
+ vs2010Dir = os .path .join (tessDir , "vs2010 " )
386
+ vs2010AbsDir = os .path .abspath (vs2010Dir )
387
387
388
388
answer = eval (input (
389
389
'Are you sure you want to clean the\n "%s" folder (Yes/No) [No]? ' %
390
- vs2008AbsDir ))
390
+ vs2010AbsDir ))
391
391
if answer .lower () not in ("yes" ,):
392
392
return
393
393
answer = eval (input ('Only list the items to be deleted (Yes/No) [Yes]? ' ))
394
394
answer = answer .strip ()
395
395
listOnly = answer .lower () not in ("no" ,)
396
396
397
- for rootDir , dirs , files in os .walk (vs2008AbsDir ):
397
+ for rootDir , dirs , files in os .walk (vs2010AbsDir ):
398
398
for buildDir in ("LIB_Release" , "LIB_Debug" , "DLL_Release" , "DLL_Debug" ):
399
399
if buildDir in dirs :
400
400
dirs .remove (buildDir )
@@ -405,7 +405,7 @@ def tessClean(tessDir):
405
405
print ("Removing: %s" % absBuildDir )
406
406
shutil .rmtree (absBuildDir )
407
407
408
- if rootDir == vs2008AbsDir :
408
+ if rootDir == vs2010AbsDir :
409
409
for file in files :
410
410
if file .lower () not in ("tesseract.sln" ,
411
411
"tesshelper.py" ,
@@ -484,7 +484,7 @@ def main ():
484
484
parser_copy .set_defaults (func = tessCopy )
485
485
486
486
parser_clean = subparsers .add_parser ('clean' ,
487
- help = "clean vs2008 folder of build folders and .user files" )
487
+ help = "clean vs2010 folder of build folders and .user files" )
488
488
parser_clean .set_defaults (func = tessClean )
489
489
490
490
#kludge because argparse has no ability to set default subparser
0 commit comments