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