Author: sebastien.lelong
Date: Fri Apr  3 07:17:22 2009
New Revision: 911

Modified:
    trunk/tools/jallib.py

Log:
finally fixed weird linefeed chars + reindent using linefeed defined by OS

Modified: trunk/tools/jallib.py
==============================================================================
--- trunk/tools/jallib.py       (original)
+++ trunk/tools/jallib.py       Fri Apr  3 07:17:22 2009
@@ -470,10 +470,11 @@
        newcontent = ""
        start = 0
        for m in toreplace:
+               sectionname = m.groups()[-1].strip()
                # when eating line sep char (to keep layout),
                # remember some OS needs 2 chars !
                newcontent += testcontent[start:m.start() - len(os.linesep)]
-               new = os.linesep.join(board['sections'][m.groups()[-1].strip()])
+               new = os.linesep.join(board['sections'][sectionname])
                start = m.end() + 1     # next char
                newcontent += new
        newcontent += testcontent[start:]
@@ -510,8 +511,8 @@
        test = [l for i,l in test]
        merged = merge_board_testfile(board,test)
        fout = file(outfile,"w")
-       print >> fout, header
-       print >> fout, merged
+       fout.write(header)
+       fout.write(merged)
        fout.close()

        # compile it !
@@ -700,7 +701,7 @@
        assert level == 0, "Reached the end of file, but indent level is not 
null  
(it should)"
        # ok, now we can save the content back to the file
        fout = file(filename,"w")
-       print >> fout, "\n".join(content)
+       print >> fout, os.linesep.join(content)
        fout.close()

  def do_reindent(args):

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"jallib" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/jallib?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to