Package dbf :: Module exceptions
[hide private]
[frames] | no frames]

Source Code for Module dbf.exceptions

 1  "warnings and errors" 
 2   
3 -class DbfError(Exception):
4 "Fatal errors elicit this response." 5 pass
6 -class DataOverflow(DbfError):
7 "Data too large for field"
8 - def __init__(yo, message, data=None):
9 super(DataOverflow, yo).__init__(message) 10 yo.data = data
11 -class FieldMissing(KeyError, DbfError):
12 "Field does not exist in table"
13 - def __init__(yo, fieldname):
14 super(FieldMissing, yo).__init__('%s: no such field in table' % fieldname) 15 yo.data = fieldname
16 -class DbfWarning(Exception):
17 "Normal operations elicit this response"
18 -class Eof(DbfWarning, StopIteration):
19 "End of file reached" 20 message = 'End of file reached'
21 - def __init__(yo):
22 super(Eof, yo).__init__(yo.message)
23 -class Bof(DbfWarning, StopIteration):
24 "Beginning of file reached" 25 message = 'Beginning of file reached'
26 - def __init__(yo):
27 super(Bof, yo).__init__(yo.message)
28