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