Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
dist
/env/
/venv/
12 changes: 6 additions & 6 deletions ever2simple/converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import os
import sys
from csv import DictWriter
from cStringIO import StringIO
from io import StringIO
from dateutil.parser import parse
from html2text import HTML2Text
from lxml import etree
Expand All @@ -29,9 +29,9 @@ def _load_xml(self, enex_file):
try:
parser = etree.XMLParser(huge_tree=True)
xml_tree = etree.parse(enex_file, parser)
except (etree.XMLSyntaxError, ), e:
print 'Could not parse XML'
print e
except etree.XMLSyntaxError as e:
print('Could not parse XML')
print(e)
sys.exit(1)
return xml_tree

Expand Down Expand Up @@ -71,7 +71,7 @@ def prepare_notes(self, xml_tree):

def convert(self):
if not os.path.exists(self.enex_filename):
print "File does not exist: %s" % self.enex_filename
print("File does not exist: %s" % self.enex_filename )
sys.exit(1)
# TODO: use with here, but pyflakes barfs on it
enex_file = open(self.enex_filename)
Expand Down Expand Up @@ -116,7 +116,7 @@ def _convert_dir(self, notes):
sys.stdout.write(json.dumps(notes))
else:
if os.path.exists(self.simple_filename) and not os.path.isdir(self.simple_filename):
print '"%s" exists but is not a directory. %s' % self.simple_filename
print('"%s" exists but is not a directory. %s' % self.simple_filename)
sys.exit(1)
elif not os.path.exists(self.simple_filename):
os.makedirs(self.simple_filename)
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
zip_safe=False,
install_requires=[
'lxml',
'python-dateutil<2.0',
'python-dateutil',
'html2text',
],
entry_points="""
Expand Down