# HG changeset patch # User Oleksandr Gavenko # Date 1459115181 -10800 # Node ID f0ac87e10d9ae914fb9a66d8bb1b0e9eafb8ba3f # Parent 6208d07b30f086afeb8945518a6b47eb6fba60b8 Fix warnings from pylint/pyflakes. diff -r 6208d07b30f0 -r f0ac87e10d9a py/gadict.py --- a/py/gadict.py Mon Mar 28 00:37:40 2016 +0300 +++ b/py/gadict.py Mon Mar 28 00:46:21 2016 +0300 @@ -1,8 +1,12 @@ +""" +gadict dictionary format parser. +""" import regex class Prelude: + """Dictionary metainfo structure.""" name = None about = "" urls = [] @@ -12,7 +16,8 @@ class ParseException(BaseException): - def __init__(self, msg, lineno = None, line = None): + def __init__(self, msg, lineno=None, line=None): + super().__init__() self.msg = msg self.lineno = lineno self.line = line @@ -27,6 +32,7 @@ class Parser: + """gadict dictionary format parser.""" SEPARATOR_RE = regex.compile(r"^__$") HEADWORD_RE = regex.compile(r"^(\p{L}.*)$") @@ -66,7 +72,7 @@ while not self.eof: self.parse_article() except ParseException as ex: - raise ParseException(ex.msg, self.lineno, self.line) from ex + raise ParseException(ex.msg, self.lineno, self.line) return self.dom def parse_continuation(self): @@ -75,7 +81,7 @@ self.readline() if self.eof: return string - m = CONT_RE.match(self.line) + m = self.CONT_RE.match(self.line) if m is not None: string += "\n" + m.group(1) elif len(self.line) == 1: @@ -203,4 +209,3 @@ if len(tr) > 0: senses.append((pos, tr, ex)) self.tran = senses - diff -r 6208d07b30f0 -r f0ac87e10d9a py/gadict_c5.py --- a/py/gadict_c5.py Mon Mar 28 00:37:40 2016 +0300 +++ b/py/gadict_c5.py Mon Mar 28 00:46:21 2016 +0300 @@ -94,4 +94,3 @@ FOUT.write(tr) break FOUT.write("\n") -