X-Git-Url: https://git.phdru.name/?a=blobdiff_plain;f=m_lib%2Fflad%2Fflad.py;h=b2446d824bfa8cdeac042995405c0e4ca6f4a159;hb=fea5b1d068bc94adce899a804a643bf24b8a9777;hp=05703c149f34872d451f213d185f0e7dfef4d6d4;hpb=13a21366e5dbeb344656cbfd00432be176ae5cdb;p=m_lib.git diff --git a/m_lib/flad/flad.py b/m_lib/flad/flad.py index 05703c1..b2446d8 100644 --- a/m_lib/flad/flad.py +++ b/m_lib/flad/flad.py @@ -1,8 +1,6 @@ """ Flat ASCII Database. This module implements a very simple database on the flat ASCII files. - - Written by Broytman. Copyright (C) 1997-2005 PhiloSoft Design """ @@ -42,7 +40,7 @@ class Flad(UserList): if callable(self.check_record_func): return self.check_record_func(self, record) else: - raise TypeError, "non-callable restriction function" + raise TypeError("non-callable restriction function") else: return 1 @@ -90,7 +88,7 @@ class Flad(UserList): if line[-1] == '\n': line = line[:-1] # Chop - l = string.split(line, self.key_sep, 1) # Just split to key and reminder + l = line.split(self.key_sep, 1) # Just split to key and reminder return tuple(l) @@ -107,7 +105,7 @@ class Flad(UserList): # so it is not ready to be checked :( # And, of course, two keys with the same name # cannot be added to dictionary - raise KeyError, "field key \"" + key + "\" already in record" + raise KeyError("field key \"" + key + "\" already in record") record[key] = value @@ -218,7 +216,7 @@ class Flad(UserList): flush_record = 0 # Do not close record on 1st loop - if self.comment <> '': + if self.comment != '': outfile.write(self.comment) for record in self: