Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Editor log fix for gnsync

  • Loading branch information...
commit 6cc1cfe3683e33e39bbb21803d172b5fc49f4759 1 parent 4c2deb6
@varche1 varche1 authored
Showing with 5 additions and 2 deletions.
  1. +4 −1 editor.py
  2. +1 −1  gnsync.py
View
5 editor.py
@@ -25,7 +25,7 @@ def wrapENML(contentHTML):
body += '<en-note>%s</en-note>' % contentHTML
return body
-def textToENML(content):
+def textToENML(content, raise_ex=False):
"""
Create an ENML format of note.
"""
@@ -40,6 +40,9 @@ def textToENML(content):
contentHTML = re.sub(r'\n', r'', contentHTML)
return wrapENML(contentHTML)
except:
+ if raise_ex:
+ raise Exception("Error while parsing text to html. Content must be an UTF-8 encode.")
+
logging.error("Error while parsing text to html. Content must be an UTF-8 encode.")
out.failureMessage("Error while parsing text to html. Content must be an UTF-8 encode.")
return tools.exit()
View
2  gnsync.py
@@ -177,7 +177,7 @@ def _get_file_content(self, path):
Get file content.
"""
content = open(path, "r").read()
- content = editor.textToENML(content)
+ content = editor.textToENML(content=content, raise_ex=True)
if content is None:
logger.warning("File {0}. Content must be an UTF-8 encode.".format(path))
Please sign in to comment.
Something went wrong with that request. Please try again.