3 # current output directory
8 # This function is used to sort the index. It is a simple lexicographical
9 # sort, except that it places capital letters before lowercase ones.
11 def index_sort( s1, s2 ):
20 m1 = string.lower( s1 )
21 m2 = string.lower( s2 )
24 if i >= l2 or m1[i] > m2[i]:
41 # Sort input_list, placing the elements of order_list in front.
43 def sort_order_list( input_list, order_list ):
44 new_list = order_list[:]
46 if not id in order_list:
52 # Open the standard output to a given project documentation file. Use
53 # "output_dir" to determine the filename location if necessary and save the
54 # old stdout in a tuple that is returned by this function.
56 def open_output( filename ):
59 if output_dir and output_dir != "":
60 filename = output_dir + os.sep + filename
62 old_stdout = sys.stdout
63 new_file = open( filename, "w" )
66 return ( new_file, old_stdout )
69 # Close the output that was returned by "close_output".
71 def close_output( output ):
73 sys.stdout = output[1]
76 # Check output directory.
82 if not os.path.isdir( output_dir ):
83 sys.stderr.write( "argument" + " '" + output_dir + "' " +
84 "is not a valid directory" )