py/gadict.py
changeset 1148 263e9e066981
parent 1011 fdf5640f221a
child 1182 0ef4b4264a1a
--- 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):