Fixed: NameError: name 'ParseException' is not defined.
--- a/py/gadict.py Sat Apr 20 20:49:33 2019 +0300
+++ b/py/gadict.py Sat Apr 20 21:06:13 2019 +0300
@@ -6,6 +6,7 @@
import sys
import re
+from gadict_util import ParseException
class Prelude:
"""Dictionary metainfo structure."""
@@ -16,22 +17,6 @@
licences = []
-class ParseException(BaseException):
-
- def __init__(self, msg, lineno=None, line=None):
- BaseException.__init__(self)
- self.msg = msg
- self.lineno = lineno
- self.line = line
-
- def __repr__(self):
- if self.lineno is None:
- return self.msg
- elif self.line is None:
- return u":{:d}:{:s}".format(self.lineno, self.msg)
- else:
- return u":{:d}: {:s}\nLINE: {:s}".format(self.lineno, self.msg, self.line)
-
class Headword:
def __init__(self, headword, pron = None, attrs = None, homo = None):
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/py/gadict_util.py Sat Apr 20 21:06:13 2019 +0300
@@ -0,0 +1,16 @@
+
+class ParseException(BaseException):
+
+ def __init__(self, msg, lineno=None, line=None):
+ BaseException.__init__(self)
+ self.msg = msg
+ self.lineno = lineno
+ self.line = line
+
+ def __repr__(self):
+ if self.lineno is None:
+ return self.msg
+ elif self.line is None:
+ return u":{:d}:{:s}".format(self.lineno, self.msg)
+ else:
+ return u":{:d}: {:s}\nLINE: {:s}".format(self.lineno, self.msg, self.line)
--- a/py/gaphrase_srs_anki.py Sat Apr 20 20:49:33 2019 +0300
+++ b/py/gaphrase_srs_anki.py Sat Apr 20 21:06:13 2019 +0300
@@ -10,6 +10,8 @@
import tempfile
import shutil
+from gadict_util import ParseException
+
import anki
from anki.exporting import AnkiPackageExporter