DocumentationTools/IndexGenerator.py

changeset 253
3ccdf551bde7
parent 96
9624a110667d
child 406
eacf81fad150
child 792
a13346916170
--- a/DocumentationTools/IndexGenerator.py	Sat May 15 10:19:07 2010 +0200
+++ b/DocumentationTools/IndexGenerator.py	Sat May 15 15:29:39 2010 +0200
@@ -106,12 +106,13 @@
         elt["modules"][moduleDocument.name()] = \
             moduleDocument.shortDescription()
     
-    def __writeIndex(self, packagename, package):
+    def __writeIndex(self, packagename, package, newline = None):
         """
         Private method to generate an index file for a package.
         
         @param packagename The name of the package. (string)
         @param package A dictionary with information about the package.
+        @param newline newline character to be used (string)
         @return The name of the generated index file.
         """
         if packagename == "00index":
@@ -172,19 +173,20 @@
               } + \
               self.footerTemplate
     
-        f = open(filename, "w", encoding = "utf-8")
+        f = open(filename, "w", encoding = "utf-8", newline = newline)
         f.write(doc)
         f.close()
     
         return filename
     
-    def writeIndices(self, basename = ""):
+    def writeIndices(self, basename = "", newline = None):
         """
         Public method to generate all index files.
         
         @param basename The basename of the file hierarchy to be documented.
             The basename is stripped off the filename if it starts with
             the basename.
+        @param newline newline character to be used (string)
         """
         if not self.remembered:
             sys.stderr.write("No index to generate.\n")
@@ -198,7 +200,7 @@
             try:
                 if basename:
                     package = package.replace(basename,"")
-                out = self.__writeIndex(package, element)
+                out = self.__writeIndex(package, element, newline)
             except IOError as v:
                 sys.stderr.write("%s error: %s\n" % (package, v[1]))
             else:

eric ide

mercurial