Commits

Joe Nassimian committed fc5dcea

Removed file logging

  • Participants
  • Parent commits 98616a6

Comments (0)

Files changed (4)

lml-preview/handlers/creole_handler/__init__.py

 
     def __call__(self, action, user_data):
         lmlpreview = user_data[0]
-        text = lmlpreview.get_selection()
 
+        text = lmlpreview.get_selection()
         text = unicode(text, 'utf-8')
 
-        with open("debug.txt", 'w') as f:
-            f.write(text)
-            f.write("\n\n-----------------\n\n")
-
-            html = creole2html(text)
-
-            f.write(html)
-            f.write("\n\n-----------------\n\n")
-
+        html = creole2html(text)
         lmlpreview.do_render(html)
 
 creole2preview = _Creole2Preview()

lml-preview/handlers/markdown_handler/__init__.py

 
     def __call__(self, action, user_data):
         lmlpreview = user_data[0]
-        text = lmlpreview.get_selection()
 
+        text = lmlpreview.get_selection()
         text = unicode(text, 'utf-8')
 
-        with open("debug.txt", 'w') as f:
-            f.write(text)
-            f.write("\n\n-----------------\n\n")
-
-            if self.version == "standard":
-                html = markdown(
-                    text,
-                    smart_emphasis=False
-                )
-            else:
-                html = markdown(
-                    text,
-                    extensions=['extra', 'headerid(forceid=False)']
-                )
-
-            f.write(html)
-            f.write("\n\n-----------------\n\n")
-
+        if self.version == "standard":
+            html = markdown(
+                text,
+                smart_emphasis=False
+            )
+        else:
+            html = markdown(
+                text,
+                extensions=['extra', 'headerid(forceid=False)']
+            )
         lmlpreview.do_render(html)
 
 md2preview = _Md2Preview()

lml-preview/handlers/rest_handler/__init__.py

 
 # -----------------------------------------------------------------------------
 
-print("importing reST")
-
-# -----------------------------------------------------------------------------
-
 # markup name
 name = "reST"
 
 
     def __call__(self, action, user_data):
         lmlpreview = user_data[0]
-        text = lmlpreview.get_selection()
 
+        text = lmlpreview.get_selection()
         text = unicode(text, 'utf-8')
 
-        with open("debug.txt", 'w') as f:
-            f.write(text)
-            f.write("\n\n-----------------\n\n")
+        html_body = publish_parts(text, writer_name="html")["html_body"]
 
-            html_body = publish_parts(text, writer_name="html")["html_body"]
-
-            template_file = os.path.join(templates_path, 'base.html')
-
-            mytemplate = Template(
-                filename=template_file,
-    #            module_directory=windowdata["mako_temp"]
-            )
-
-            html = mytemplate.render(
-                title=self.label,
-                styles=styles.read(),
-                body=html_body
-            )
+        template_file = os.path.join(templates_path, 'base.html')
+        mytemplate = Template(
+            filename=template_file,
+#            module_directory=windowdata["mako_temp"]
+        )
 
-            f.write(html)
-            f.write("\n\n-----------------\n\n")
+        html = mytemplate.render(
+            title=self.label,
+            styles=styles.read(),
+            body=html_body
+        )
 
         lmlpreview.do_render(html)
 

lml-preview/handlers/textile_handler/__init__.py

 
 # -----------------------------------------------------------------------------
 
-print("importing textile")
-
-# -----------------------------------------------------------------------------
-
 # markup name
 name = "textile"
 
 
     def __call__(self, action, user_data):
         lmlpreview = user_data[0]
-        text = lmlpreview.get_selection()
 
+        text = lmlpreview.get_selection()
         text = unicode(text, 'utf-8')
 
-        with open("debug.txt", 'w') as f:
-            f.write(text)
-            f.write("\n\n-----------------\n\n")
-
-            html = textile(text)
-
-            f.write(html)
-            f.write("\n\n-----------------\n\n")
-
+        html = textile(text)
         lmlpreview.do_render(html)
 
 textile2preview = _Textile2Preview()