diff --git a/.gitignore b/.gitignore index 572bb84..ae58a6e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ dist /env/ +/venv/ \ No newline at end of file diff --git a/ever2simple/converter.py b/ever2simple/converter.py index 4a3f849..d608e9c 100644 --- a/ever2simple/converter.py +++ b/ever2simple/converter.py @@ -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 @@ -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 @@ -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) @@ -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) diff --git a/setup.py b/setup.py index 07936af..7b898e2 100644 --- a/setup.py +++ b/setup.py @@ -24,7 +24,7 @@ zip_safe=False, install_requires=[ 'lxml', - 'python-dateutil<2.0', + 'python-dateutil', 'html2text', ], entry_points="""