Joe Nassimian avatar Joe Nassimian committed fc5dcea

Removed file logging

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()
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.