Commits

Samuel Ytterbrink committed 4c25f3c

now pylint gives max score to py2js/formater.py

Comments (0)

Files changed (1)

py2js/formater.py

+""" A formater module that keeps trac of indentation
+"""
 class Formater(object):
     """
     A very simple code formater that handles efficient concatenation and indentation of lines.
         self.__indentation += 1
         self.__indent_temp = self.__indent_string*self.__indentation
 
-    def write(self, s, indent=True, newline=True):
+    def write(self, text, indent=True, newline=True):
         """
-        Writes the string s to the buffer with indentation and a newline if not specified otherwise.
+        Writes the string text to the buffer with indentation and a newline if not specified otherwise.
         """
         if indent:
             self.__buffer.append(self.__indent_temp)
-        self.__buffer.append(s)
+        self.__buffer.append(text)
         if newline:
             self.__buffer.append("\n")
 
         Returns a string representation of the buffer.
         """
         if size == None:
-            s = self.__string_buffer + "".join(self.__buffer)
+            text = self.__string_buffer + "".join(self.__buffer)
             self.__buffer = []
             self.__string_buffer = ""
-            return s
+            return text
         else:
             if len(self.__string_buffer) < size:
                 self.__string_buffer += "".join(self.__buffer)
                 self.__buffer = []
                 if len(self.__string_buffer) < size:
-                    s, self.__string_buffer = self.__string_buffer, ""
-                    return s
+                    text, self.__string_buffer = self.__string_buffer, ""
+                    return text
                 else:
-                    s, self.__string_buffer = self.__string_buffer[:size], self.__string_buffer[size:]
-                    return s
+                    text, self.__string_buffer = self.__string_buffer[:size], \
+                        self.__string_buffer[size:]
+                    return text
             else:
-                s, self.__string_buffer = self.__string_buffer[:size], self.__string_buffer[size:]
-                return s
+                text, self.__string_buffer = self.__string_buffer[:size], \
+                    self.__string_buffer[size:]
+                return text