-
Notifications
You must be signed in to change notification settings - Fork 6
/
dbf.WHATSNEW
210 lines (141 loc) · 7.04 KB
/
dbf.WHATSNEW
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
What's New
==========
0.94.006
--------
Miscellaneous bugs squashed.
backup tables are created in the same location as the original table if TMP,
TEMP, nor DBF_TEMP are defined in the environment
delete() and undelete() now support RecordTemplate
Process() and Templates() now support start, stop, and filter to allow finer
control of which records will be returned.
Added Relation, which makes linking two tables together on a common field easier.
Not persistent.
xBase-Compatibility Break: added utf8 codepage (xf0).
Backwards-Compatibility Break: reverted Logical.__eq__ to return True if Logical
is True, False otherwise; this properly mimics the behavior of using True/False/None
directly. If the previous behavior is desired, use Quantum instead (it uses the
states On/Off/Other), or use `if Unknown: ... ; elif ... ; else ... `.
Many thanks to all who have help with ideas and bug fixes.
0.94.004
--------
Templates now use same (custom) data types as table they are created
from.
Added Index.index_search(match, start=None, stop=None, nearest=False, partial=False)
which returns the index of the first match. If nearest is False and nothing is found
a NotFoundError is raised, otherwise the index of where the match would be is
returned
Added IndexLocation, which is a subclass of long and is returned by Index.index_search.
Unlike normal numbers where 0 == False and anything else == True, IndexLocation is True if
the number represents a found match, and False if the number represents where a match
should be (a False value will only be returned if nearest == True).
Backwards-Compatibility Break: memory-only tables are now specified with on_disk=True
instead of bracketing the filename with ':'. Removed dbf.codepage() and dbf.encoding()
as users can directly access dbf.default_codepage and dbf.input_decoding.
Backwards-Compatibility Break: .use_deleted no longer used (it disappeared sometime
between .90.0 and now). Rationale: the deleted flag is just that: a flag. The record is
still present and still available. If you don't want to use it, either check if the
record has been deleted (dbf.is_deleted(record)) or create an index that doesn't include
the deleted records... or pack the table and actually remove the records for good.
0.94.003
--------
Minor bug fixes, more documentation.
0.94.001
--------
Added support for Clipper's large Character fields (up to 65,519)
More code clean-up and slight breakage::
- _Dbf* has had '_Dbf' removed (_DbfRecord --> Record)
- DbfTable --> Table (Table factory function removed)
0.94.000
--------
Massive backwards incompatible changes.
export() method removed from Tables and made into a normal function.
All non-underscore methods removed from the record class and made into
normal functions::
- delete_record --> delete
- field_names --> field_names
- gather_records --> gather
- has_been_deleted --> is_deleted
- record_number --> recno
- reset_record --> reset
- scatter_records --> scatter
- undelete_record --> undelete
- write_record --> write
Transaction methods removed entirely.
Can use strings as start/stop of slices: `record['name':'age']`
Record templates now exist, and are much like records except that they are
not directly tied to a table and can be freely modified. They can be created
by either the `dbf.create_template` function or the `table.create_template` method.
scatter() now returns a RecordTemplate instead of a dict, but the as_type parameter
can be used to get dicts (or tuples, lists, whatever)
0.93.020
--------
Finished changes so other Python implementations should work (PyPy
definitely does).
Table signature changed -- `read_only`, `meta_only`, and `keep_memos`
dropped.
tables now have a `status` attribute which will be one of `closed`,
'read_only`, or `read_write`
`.append` no longer returns the newly added record (use table[-1] if you need it)
`.find` method removed (use `.query` instead);
`.sql` method removed (use `.query` instead);
`.size` renamed to `.field_size`;
`.type` renamed to `.field_type` (which returns a FieldType named tuple);
the way to change records has changed:
to update any/all fields at once:
record.write_record(field1=..., field2=...)
or
record.gather_fields(dict)
to update one field at a time:
2.6, 2.7 (2.5 using `from __future__ import with_statement`)
with record:
record.field1 = ...
record.field2 = ...
or
for record in dbf.Process(table | records):
record.field1 = ...
record.field2 = ...
attempting to change a field outside of these two methods will raise a
`DbfError`.
Changing behavior based on a transaction:
record.gather_fields()
if a transaction is not running this will write to disk
(no changes made if error occurs, exception reraised)
if a transaction is running, and an error occurs, the calling code
is responsible for calling .rollback_transaction() or otherwise
handling the problem (exception is reraised)
record.reset_record()
if a transaction is not running the changes are written to disk
if a transaction is running the changes are not written to disk
`xxx in table` and `xxx in record` used to be a field-name check - it is
now a record / value check; use `xxx in table.field_names` and
`xxx in record.field_names` to do the field-name check.
added equality/inequality check for records, which can be compared against
other records / dicts / tuples (field/key order does not matter for
record-record nor record-dict checks).
0.93.011
--------
`with` will work now. Really.
Started making changes so dbf will work with the non-CPython
implementations (at this point it is not reliable).
0.93.010
--------
Table now returns a closed database; .open() must now be called before
accessing the records.
Note: fields, number of records, table type, and other metadata is
available on closed tables.
Finished adding support for 'F' (aka 'N') field types in dBase III tables;
this is a practicality beats purity issue as the F type is not part of the
db3 standard, but is exactly the same as N and other programs will use it
instead of N when creating db3 tables.
0.93.000
--------
PEP 8 changes (yo --> self, someMethod --> some_method)
0.92.002
--------
added more support for the Null type in the other custome data types
0.91.001
--------
Removed __del__ from dbf records; consequently they no longer autosave when
going out of scope. Either call .write_record() explicitly, or use the new
Write iterator which will call .write_record for you.
Finished adding Null support (not supported in db3 tables)