[Mumps2Py:] [19] fixed the tab function; " %*c" % (indentlevel,'\t') did not work as I expected.

[ Thread Index | Date Index | More lists.mumps2py.org/discuss Archives ]


Revision: 19
Author:   pgallot
Date:     2008-01-17 20:34:06 +0000 (Thu, 17 Jan 2008)

Log Message:
-----------
fixed the tab function; " %*c" % (indentlevel,'\t') did not work as I expected.

Modified Paths:
--------------
    trunk/mumps2py/tok2python.py


Modified: trunk/mumps2py/tok2python.py
===================================================================
--- trunk/mumps2py/tok2python.py	2008-01-17 20:32:45 UTC (rev 18)
+++ trunk/mumps2py/tok2python.py	2008-01-17 20:34:06 UTC (rev 19)
@@ -46,10 +46,8 @@
         self.code.append(block)
 
 def tab(indentlevel):
-    if indentlevel:
-        return "%*c" % (indentlevel, '\t')
-    else:
-        return ""
+    tab_str = "%*c" % (indentlevel*4, '^') 
+    return tab_str[:-1]
     
 def translate_comment(translation, token):
     """translate a Mumps comment to Python"""


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/