1 |
|
2003-04-30 Bernhard Herzog <[email protected]> |
2 |
|
|
3 |
|
* Thuban/UI/view.py: Fix some typos. |
4 |
|
|
5 |
|
* Thuban/UI/mainwindow.py (MainWindow.identify_view_on_demand): Do |
6 |
|
not pop up the dialog if the selection becomes empty (this could |
7 |
|
happen if e.g. a new selection is opened while the identify tool |
8 |
|
is active and dialog had been closed) |
9 |
|
|
10 |
|
2003-04-30 Bernhard Herzog <[email protected]> |
11 |
|
|
12 |
|
* Thuban/Model/transientdb.py (TransientTableBase.__init__): New |
13 |
|
instance variable read_record_last_result |
14 |
|
(TransientTableBase.read_record): Make sure reading the same |
15 |
|
record twice works. The implementation uses the new instance |
16 |
|
variable read_record_last_result |
17 |
|
|
18 |
|
* test/test_transientdb.py |
19 |
|
(TestTransientTable.test_transient_table_read_twice): New test |
20 |
|
case for the above bug-fix. |
21 |
|
|
22 |
|
2003-04-29 Bernhard Herzog <[email protected]> |
23 |
|
|
24 |
|
* Thuban/Model/session.py (Session.Destroy): Explicitly close the |
25 |
|
transient DB if it exists to make sure it doesn't leave a journal |
26 |
|
file in the temp directory. |
27 |
|
|
28 |
|
* Thuban/Model/transientdb.py (TransientDatabase.close): Set |
29 |
|
self.conn to None after closing the connection to make sure it's |
30 |
|
not closed twice |
31 |
|
|
32 |
|
2003-04-29 Jonathan Coles <[email protected]> |
33 |
|
|
34 |
|
Add a visible parameter in the layer XML tag. The default value is |
35 |
|
"true". If anything other than "false" is specified we also assume |
36 |
|
"true". Addresses RTbug #1025. |
37 |
|
|
38 |
|
* Doc/thuban.dtd: Add visible parameter to a layer. |
39 |
|
|
40 |
|
* Thuban/Model/layer.py (BaseLayer.__init__): Change default value |
41 |
|
of visible from 1 to True. |
42 |
|
(Layer.__init__): Change default value of visible from 1 to True. |
43 |
|
|
44 |
|
* Thuban/Model/load.py (SessionLoader.start_layer): Read visible |
45 |
|
parameter. |
46 |
|
|
47 |
|
* Thuban/Model/save.py (SessionSaver.write_layer): Save visible |
48 |
|
parameter. |
49 |
|
|
50 |
|
* test/test_load.py: Add new test data contents_test_visible. |
51 |
|
(LoadSessionTest.setUp): save test data. |
52 |
|
(LoadSessionTest.testLayerVisibility): Test if the visible flag |
53 |
|
is loaded correctly. |
54 |
|
|
55 |
|
* test/test_save.py (SaveSessionTest.testSingleLayer): Add test |
56 |
|
for saving an invisible layer. |
57 |
|
|
58 |
|
2003-04-29 Jonathan Coles <[email protected]> |
59 |
|
|
60 |
|
* Thuban/UI/mainwindow.py (MainWindow.SetMap): Look up the |
61 |
|
legend dialog box and tell it to change its map to the one |
62 |
|
supplied to SetMap(). Fixes RTbug #1770. |
63 |
|
|
64 |
|
2003-04-29 Bernhard Herzog <[email protected]> |
65 |
|
|
66 |
|
Next step of table implementation. Introduce a transient database |
67 |
|
using SQLite that some of the data is copied to on demand. This |
68 |
|
allows us to do joins and other operations that require an index |
69 |
|
for good performance with reasonable efficiency. Thuban now needs |
70 |
|
SQLite 2.8.0 and pysqlite 0.4.1. Older versions may work but I |
71 |
|
haven't tested that. |
72 |
|
|
73 |
|
* Thuban/Model/transientdb.py: New. Transient database |
74 |
|
implementation. |
75 |
|
|
76 |
|
* test/test_transientdb.py: New. Tests for the transient DB |
77 |
|
classes. |
78 |
|
|
79 |
|
* Thuban/Model/session.py (AutoRemoveFile, AutoRemoveDir): New |
80 |
|
classes to help automatically remove temporary files and |
81 |
|
directories. |
82 |
|
(Session.__init__): New instance variables temp_dir for the |
83 |
|
temporary directory and transient_db for the SQLite database |
84 |
|
(Session.temp_directory): New. Create a temporary directory if not |
85 |
|
yet done and return its name. Use AutoRemoveDir to have it |
86 |
|
automatically deleted |
87 |
|
(Session.TransientDB): Instantiate the transient database if not |
88 |
|
done yet and return it. |
89 |
|
|
90 |
|
* Thuban/Model/data.py (ShapefileStore.__init__): Use an |
91 |
|
AutoTransientTable so that data is copied to the transient DB on |
92 |
|
demand. |
93 |
|
(SimpleStore): New class that simply combines a table and a |
94 |
|
shapefile |
95 |
|
|
96 |
|
* Thuban/Model/table.py (Table, DBFTable): Rename Table into |
97 |
|
DBFTable and update its doc-string to reflect the fact that this |
98 |
|
is only the table interface to a DBF file. Table is now an alias |
99 |
|
for DBFTable for temporary backwards compatibility. |
100 |
|
|
101 |
|
* Thuban/UI/application.py (ThubanApplication.OnExit): Make sure |
102 |
|
the last reference to the session goes away so that the temporary |
103 |
|
files are removed properly. |
104 |
|
|
105 |
|
* test/test_load.py (LoadSessionTest.tearDown): Remove the |
106 |
|
reference to the session to make sure the temporary files are |
107 |
|
removed. |
108 |
|
|
109 |
|
2003-04-29 Bernhard Herzog <[email protected]> |
110 |
|
|
111 |
|
* Thuban/Model/load.py (XMLReader.__init__, XMLReader.read): Turn |
112 |
|
the __parser instance variable into a normal local variable in |
113 |
|
read. It's only used there and read will never be called more than |
114 |
|
once. Plus it introduces a reference cycle that keeps can keep the |
115 |
|
session object alive for a long time. |
116 |
|
|
117 |
|
2003-04-29 Jonathan Coles <[email protected]> |
118 |
|
|
119 |
|
* Thuban/Model/proj.py (Projection): Removed Set*() methods to make |
120 |
|
Projection an immutable item. Fixes RTbug #1825. |
121 |
|
(Projection.__init__): Initialize instance variables here. |
122 |
|
(ProjFile.Replace): New. Replace the given projection object with |
123 |
|
the new projection object. This solves the problem of needing the |
124 |
|
mutator Projection.SetProjection() in the ProjFrame class and |
125 |
|
allows a projection to change parameters without changing its |
126 |
|
location in the file. |
127 |
|
|
128 |
|
* Thuban/UI/mainwindow.py (MainWindow.SaveSessionAs): Dialog should |
129 |
|
be of type wxSAVE and should verify overwriting a file. |
130 |
|
|
131 |
|
* Thuban/UI/projdialog.py (ProjFrame._OnSave): Use the new |
132 |
|
ProjFile.Replace() method instead of the mutator |
133 |
|
Projection.SetProjection(). Also requires that we reassign the |
134 |
|
client data to the new projection. |
135 |
|
|
136 |
|
* test/test_proj.py (TestProjection.test): Test GetName() and |
137 |
|
GetAllParameters() |
138 |
|
(TestProjFile.test): Remove tests for Set*() methods. Add tests |
139 |
|
for Replace(). |
140 |
|
|
141 |
|
2003-04-25 Jonathan Coles <[email protected]> |
142 |
|
|
143 |
|
* Thuban/Model/save.py (SessionSaver.write_projection): Make sure |
144 |
|
to save the name of the projection. |
145 |
|
|
146 |
|
* test/test_save.py (SaveSessionTest.testLayerProjection): New |
147 |
|
test to verify layer projections are saved correctly. |
148 |
|
|
149 |
|
2003-04-25 Jonathan Coles <[email protected]> |
150 |
|
|
151 |
|
* Thuban/Model/proj.py (Projection.SetName): Set the name |
152 |
|
to "Unknown" if name is None. |
153 |
|
(Projection.SetAllParameters): New. Set the projection's |
154 |
|
parameter list to the one supplied. |
155 |
|
(Projection.SetProjection): New. Set the projection's |
156 |
|
properties to those of the supplied Projection. |
157 |
|
|
158 |
|
* Thuban/UI/mainwindow.py (MainWindow.MapProjection): Set |
159 |
|
the dialog title to include the map's title. |
160 |
|
(MainWindow.LayerProjection): Set the dialog title to include |
161 |
|
the layer's title. |
162 |
|
|
163 |
|
* Thuban/UI/projdialog.py (ProjFrame.__ShowError): Consolidate |
164 |
|
error dialogs into a single method call. |
165 |
|
(ProjFrame.__VerifyButtons): Add more states to check. |
166 |
|
(ProjFrame.__GetProjection): Return the current state of an |
167 |
|
edited projection or None. |
168 |
|
(ProjFrame.__FillAvailList): Remove checks for states that |
169 |
|
shouldn't exist. |
170 |
|
(ProjFrame._OnNew): Clear all selected items and supply |
171 |
|
a projection panel if necessary. |
172 |
|
|
173 |
|
* test/test_proj.py (TestProjFile.test): Add tests for |
174 |
|
ProjFile.SetAllParameters, ProjFile.SetProjection, |
175 |
|
ProjFile.SetName. |
176 |
|
|
177 |
|
2003-04-25 Jonathan Coles <[email protected]> |
178 |
|
|
179 |
|
* Thuban/UI/projdialog.py (ProjFrame.__FillAvailList): Now |
180 |
|
takes an optional argument to select the current projection. |
181 |
|
This does not guarantee that the item is visible due to |
182 |
|
limited wxWindows functionality. Fixes RTBug #1821. |
183 |
|
|
184 |
|
2003-04-25 Jonathan Coles <[email protected]> |
185 |
|
|
186 |
|
* Thuban/Model/load.py (SessionLoader.start_projection): Remember |
187 |
|
the projection name and use it when constructing the Projection |
188 |
|
object. |
189 |
|
|
190 |
|
* Thuban/Model/proj.py (Projection.__init__): Change the default |
191 |
|
value for 'name' to None and then test if name is equal to None |
192 |
|
in the body of the constructor. This way the caller doesn't have to |
193 |
|
know what the default value should be. Namely, useful in load.py |
194 |
|
where we have to pick a default value if the 'name' parameter |
195 |
|
doesn't exist in the XML file. |
196 |
|
|
197 |
|
* test/test_load.py (LoadSessionTest.testLayerProjection): New. |
198 |
|
Tests a file where a layer has a projection. |
199 |
|
|
200 |
|
2003-04-25 Jonathan Coles <[email protected]> |
201 |
|
|
202 |
|
* Thuban/Model/layer.py (Layer.TreeInfo): Add an item to the |
203 |
|
tree for projection information. |
204 |
|
|
205 |
|
* Thuban/Model/load.py (XMLReader.GetFilename): Renamed from |
206 |
|
XMLReader.GetFileName. |
207 |
|
(SessionLoader): Added support for loading projection tags that |
208 |
|
appear inside a layer. |
209 |
|
|
210 |
|
* Thuban/Model/proj.py (ProjFile): Document the class. Move |
211 |
|
back to using a list because the order of the projections in |
212 |
|
the file is important to maintain. Fixes RTbug #1817. |
213 |
|
|
214 |
|
* Thuban/Model/resource.py: Rename calls to ProjFile.GetFileName |
215 |
|
to ProjFile.GetFilename. |
216 |
|
|
217 |
|
* Thuban/Model/save.py (SessionSaver.write_layer): Save projection |
218 |
|
information. |
219 |
|
|
220 |
|
* Thuban/UI/projdialog.py (ProjFrame._OnAddToList): Renamed from |
221 |
|
ProjFrame._OnSaveAs. Removed old dead code from previous |
222 |
|
implementation. |
223 |
|
(ProjFrame._OnExport): Add support for exporting more than one |
224 |
|
projection to a single file. |
225 |
|
(ProjFrame.__FillAvailList): use string formatting (% operator) |
226 |
|
to build strings that are (partly) translated. Fixes RTbug #1818. |
227 |
|
|
228 |
|
* test/test_proj.py (TestProjFile.test): New. Tests the base ProjFile |
229 |
|
class. |
230 |
|
|
231 |
|
2003-04-24 Bernhard Herzog <[email protected]> |
232 |
|
|
233 |
|
* po/es.po: Updated Spanish translation by Daniel Calvelo Aros |
234 |
|
|
235 |
|
* po/fr.po: New. French translation by Daniel Calvelo Aros |
236 |
|
|
237 |
|
* Thuban/UI/projdialog.py (ProjFrame._OnSaveAs): Don't translate |
238 |
|
empty strings. |
239 |
|
|
240 |
|
2003-04-24 Jonathan Coles <[email protected]> |
241 |
|
|
242 |
|
* Thuban/Model/layer.py (Layer.GetProjection): New. Needed to |
243 |
|
implement the interface that the ProjFrame dialog expects. |
244 |
|
|
245 |
|
* Thuban/Model/proj.py (Projection.SetName): New. Allows the |
246 |
|
name of the projection to be changed. |
247 |
|
(ProjFile): Use a dictionary instead of a list so that removing |
248 |
|
projections is easier and we are sure about uniqueness. |
249 |
|
(ProjFile.Remove): Remove the given projection object. |
250 |
|
|
251 |
|
* Thuban/Model/resource.py (GetSystemProjFiles, GetUserProjFiles): |
252 |
|
Return a list with only one projection file instead of searching for |
253 |
|
any projection file. This simplifies many things if the user can |
254 |
|
only have one system file and one user file. |
255 |
|
|
256 |
|
* Thuban/UI/classgen.py: Change all references to |
257 |
|
genCombo to genChoice. |
258 |
|
|
259 |
|
* Thuban/UI/mainwindow.py: Add a Projection option under the |
260 |
|
layer menu. |
261 |
|
(MainWindow.LayerProjection): New. Open up a projection window |
262 |
|
for a layer. |
263 |
|
|
264 |
|
* Thuban/UI/projdialog.py: Large changes to how the dialog is |
265 |
|
laid out. Use three panels instead of one. One for the list of |
266 |
|
projections, one for the edit controls, and one for the buttons. |
267 |
|
Fixed resizing problems so that the dialog resizes correctly |
268 |
|
when the projection panel changes. Added import/export, save, and |
269 |
|
new buttons/functionality. |
270 |
|
|
271 |
|
2003-04-24 Bernhard Herzog <[email protected]> |
272 |
|
|
273 |
|
First step towards table management. Introduce a simple data |
274 |
|
abstraction so that we replace the data a layer uses more easily |
275 |
|
in the next step. |
276 |
|
|
277 |
|
* Thuban/Model/data.py: New file with a simple data abstraction |
278 |
|
that bundles shapefile and dbffile into one object. |
279 |
|
|
280 |
|
* Thuban/Model/session.py (Session.OpenShapefile): New method to |
281 |
|
open shapefiles and return a shape store object |
282 |
|
|
283 |
|
* Thuban/Model/layer.py (Layer.__init__): Pass the data as a store |
284 |
|
object instead of a shapefile filename. This introduces a new |
285 |
|
instance variable store holding the datastore. For intermediate |
286 |
|
backwards compatibility keep the old instance variables. |
287 |
|
(open_shapefile): Removed. No longer needed with the shape store. |
288 |
|
(Layer.SetShapeStore, Layer.ShapeStore): New methods to set and |
289 |
|
get the shape store used by a layer. |
290 |
|
(Layer.Destroy): No need to explicitly destroy the shapefile or |
291 |
|
table anymore. |
292 |
|
|
293 |
|
* Thuban/UI/mainwindow.py (MainWindow.AddLayer) |
294 |
|
(MainWindow.AddLayer): Use the session's OpenShapefile method to |
295 |
|
open shapefiles |
296 |
|
|
297 |
|
* Thuban/Model/load.py (ProcessSession.start_layer): Use the |
298 |
|
session's OpenShapefile method to open shapefiles |
299 |
|
|
300 |
|
* test/test_classification.py |
301 |
|
(TestClassification.test_classification): Use the session's |
302 |
|
OpenShapefile method to open shapefiles and build the filename in |
303 |
|
a more platform independed way |
304 |
|
|
305 |
|
* test/test_layer.py (TestLayer.setUp, TestLayer.tearDown): |
306 |
|
Implement to have a session to use in the tests |
307 |
|
(TestLayer.test_arc_layer, TestLayer.test_polygon_layer) |
308 |
|
(TestLayer.test_point_layer, TestLayer.test_empty_layer): Use the |
309 |
|
session's OpenShapefile method to open shapefiles |
310 |
|
(TestLayerLegend.setUp): Instantiate a session so that we can use |
311 |
|
it to open shapefiles. |
312 |
|
(TestLayerLegend.tearDown): Make sure that all references to |
313 |
|
layers and session are removed otherwise we may get a resource |
314 |
|
leak |
315 |
|
|
316 |
|
* test/test_map.py (TestMapAddLayer.test_add_layer) |
317 |
|
(TestMapWithContents.setUp): Instantiate a session so that we can |
318 |
|
use it to open shapefiles. |
319 |
|
(TestMapWithContents.tearDown): Make sure that all references to |
320 |
|
layers, maps and sessions are removed otherwise we may get a |
321 |
|
resource leak |
322 |
|
("__main__"): use support.run_tests() so that more info about |
323 |
|
uncollected garbage is printed |
324 |
|
|
325 |
|
* test/test_save.py (SaveSessionTest.testSingleLayer): Use the |
326 |
|
session's OpenShapefile method to open shapefiles |
327 |
|
("__main__"): use support.run_tests() so that more info about |
328 |
|
uncollected garbage is printed |
329 |
|
|
330 |
|
* test/test_selection.py (TestSelection.tearDown): Make sure that |
331 |
|
all references to the session and the selection are removed |
332 |
|
otherwise we may get a resource leak |
333 |
|
(TestSelection.get_layer): Instantiate a session so that we can |
334 |
|
use it to open shapefiles. |
335 |
|
("__main__"): use support.run_tests() so that more info about |
336 |
|
uncollected garbage is printed |
337 |
|
|
338 |
|
* test/test_session.py (TestSessionBase.tearDown) |
339 |
|
(TestSessionWithContent.tearDown): Make sure that all references |
340 |
|
to the session and layers are removed otherwise we may get a |
341 |
|
resource leak |
342 |
|
(TestSessionWithContent.setUp): Use the session's OpenShapefile |
343 |
|
method to open shapefiles |
344 |
|
|
345 |
|
2003-04-24 Jonathan Coles <[email protected]> |
346 |
|
|
347 |
|
* Thuban/Model/load.py (XMLReader.read): Should have been checking |
348 |
|
if the file_or_filename object had the 'read' attribute. |
349 |
|
|
350 |
|
2003-04-23 Jonathan Coles <[email protected]> |
351 |
|
|
352 |
|
* Thuban/Model/resource.py: Fixes RTbug #1813. |
353 |
|
(ReadProjFile): Add documentation about which exceptions are raised. |
354 |
|
Always pass the exceptions up to the caller. |
355 |
|
(GetProjFiles): If the directory can't be read return an empty list. |
356 |
|
If any of the proj files can't be read skip that file and go |
357 |
|
on to the next one. |
358 |
|
|
359 |
|
* test/test_proj.py: Added test cases to handle nonexistent files, |
360 |
|
unreadable files, and files that don't parse correctly. |
361 |
|
|
362 |
2003-04-23 Jonathan Coles <[email protected]> |
2003-04-23 Jonathan Coles <[email protected]> |
363 |
|
|
364 |
Projection dialog. Allows the user to select from a list |
Projection dialog. Allows the user to select from a list |