@@ -413,15 +413,15 @@ def content(path, contentpage, output):
413413def do_index (library , output ):
414414 output .write ('<UL>\n ' )
415415 for book in library :
416- print '\t ' , book .title , '-' , book .indexpage
416+ print ( '\t ' , book .title , '-' , book .indexpage )
417417 if book .indexpage :
418418 index (book .directory , book .indexpage , output )
419419 output .write ('</UL>\n ' )
420420
421421def do_content (library , version , output ):
422422 output .write (contents_header )
423423 for book in library :
424- print '\t ' , book .title , '-' , book .firstpage
424+ print ( '\t ' , book .title , '-' , book .firstpage )
425425 path = book .directory + "/" + book .firstpage
426426 output .write ('<LI>' )
427427 output .write (object_sitemap % (book .title , path ))
@@ -449,12 +449,12 @@ def openfile(file):
449449 try :
450450 p = open (file , "w" )
451451 except IOError as msg :
452- print file , ":" , msg
452+ print ( file , ":" , msg )
453453 sys .exit (1 )
454454 return p
455455
456456def usage ():
457- print usage_mode
457+ print ( usage_mode )
458458 sys .exit (0 )
459459
460460def do_it (args = None ):
@@ -467,7 +467,7 @@ def do_it(args = None):
467467 try :
468468 optlist , args = getopt .getopt (args , 'ckpv:' )
469469 except getopt .error as msg :
470- print msg
470+ print ( msg )
471471 usage ()
472472
473473 if not args or len (args ) > 1 :
@@ -487,15 +487,15 @@ def do_it(args = None):
487487 if not (('-p' ,'' ) in optlist ):
488488 fname = arch + '.stp'
489489 f = openfile (fname )
490- print "Building stoplist" , fname , "..."
490+ print ( "Building stoplist" , fname , "..." )
491491 words = stop_list .split ()
492492 words .sort ()
493493 for word in words :
494- print >> f , word
494+ print ( word , file = f )
495495 f .close ()
496496
497497 f = openfile (arch + '.hhp' )
498- print "Building Project..."
498+ print ( "Building Project..." )
499499 do_project (library , f , arch , version )
500500 if version == '2.0.0' :
501501 for image in os .listdir ('icons' ):
@@ -505,13 +505,13 @@ def do_it(args = None):
505505
506506 if not (('-c' ,'' ) in optlist ):
507507 f = openfile (arch + '.hhc' )
508- print "Building Table of Content..."
508+ print ( "Building Table of Content..." )
509509 do_content (library , version , f )
510510 f .close ()
511511
512512 if not (('-k' ,'' ) in optlist ):
513513 f = openfile (arch + '.hhk' )
514- print "Building Index..."
514+ print ( "Building Index..." )
515515 do_index (library , f )
516516 f .close ()
517517
0 commit comments