/[thuban]/branches/WIP-pyshapelib-bramz/Thuban/Model/load.py
ViewVC logotype

Log of /branches/WIP-pyshapelib-bramz/Thuban/Model/load.py

Parent Directory Parent Directory | Revision Log Revision Log


Sticky Revision:
(Current path doesn't exist after revision 2835)

Revision 2734 - (view) (annotate) - [select for diffs]
Modified Thu Mar 1 12:42:59 2007 UTC (18 years ago) by bramz
File length: 28811 byte(s)
Diff to previous 2688
made a copy

Revision 2688 - (view) (annotate) - [select for diffs]
Modified Fri Jun 30 12:27:20 2006 UTC (18 years, 8 months ago) by frank
Original Path: trunk/thuban/Thuban/Model/load.py
File length: 28811 byte(s)
Diff to previous 2658
New Classification "Pattern": Classify text attributes by regexp.

Revision 2658 - (view) (annotate) - [select for diffs]
Modified Wed Jul 27 21:50:30 2005 UTC (19 years, 7 months ago) by jan
Original Path: trunk/thuban/Thuban/Model/load.py
File length: 28221 byte(s)
Diff to previous 2642
(SessionLoader.start_classification): Change attribute 'field' and
'field_type' from obligatory to optional to allow empty classes
(ie.  only with a default=clnull).


Revision 2642 - (view) (annotate) - [select for diffs]
Modified Fri Jul 1 20:49:04 2005 UTC (19 years, 8 months ago) by bh
Original Path: trunk/thuban/Thuban/Model/load.py
File length: 28038 byte(s)
Diff to previous 2615
First step towards unicode.  With this roughly we're at step 1
string_representation.txt

* Doc/technotes/string_representation.txt: New.  Document how
strings are represented in Thuban and how to get to a Unicode
Thuban.

* Thuban/__init__.py (set_internal_encoding)
(unicode_from_internal, internal_from_unicode): New. The first few
functions for the internal string representation

* Thuban/UI/about.py (unicodeToLocale): Removed.  Use
internal_from_unicode instead.

* Thuban/UI/__init__.py (install_wx_translation): Determine the
encoding to use for the internal string representation.  Also,
change the translation function to return strings in internal
representation even on unicode builds of wxPython

* Thuban/Model/load.py (SessionLoader.check_attrs): Decode
filenames too.
(SessionLoader.start_clrange): Use check_attrs to decode and check
the attributes.

* Thuban/Model/xmlreader.py (XMLReader.encode): Use
internal_from_unicode to convert unicode strings.

* Thuban/Model/xmlwriter.py (XMLWriter.encode): Use
unicode_from_internal when applicable

* test/runtests.py (main): New command line option:
internal-encoding to specify the internal string encoding to use
in the tests.

* test/support.py (initthuban): Set the internal encoding to
latin-1

* test/test_load.py (TestSingleLayer.test, TestClassification.test)
(TestLabelLayer.test): Use the internal string representation when
dealing with non-ascii characters

* test/test_load_1_0.py (TestSingleLayer.test)
(TestClassification.test, TestLabelLayer.test): Use the internal
string representation when dealing with non-ascii characters

* test/test_load_0_9.py (TestSingleLayer.test)
(TestClassification.test): Use the internal string representation
when dealing with non-ascii characters

* test/test_load_0_8.py (TestUnicodeStrings.test): Use the
internal string representation when dealing with non-ascii
characters

* test/test_save.py (XMLWriterTest.testEncode)
(SaveSessionTest.testClassifiedLayer): Use the internal string
representation when dealing with non-ascii characters where
applicable


Revision 2615 - (view) (annotate) - [select for diffs]
Modified Fri May 6 14:17:03 2005 UTC (19 years, 10 months ago) by jonathan
Original Path: trunk/thuban/Thuban/Model/load.py
File length: 27832 byte(s)
Diff to previous 2552
(SessionLoader.start_rasterlayer): Added code to read the opacity and mask
type of the layer and construct a new layer with the additional parameters.


Revision 2552 - (view) (annotate) - [select for diffs]
Modified Fri Jan 28 15:54:00 2005 UTC (20 years, 1 month ago) by jonathan
Original Path: trunk/thuban/Thuban/Model/load.py
File length: 27399 byte(s)
Diff to previous 2551
Make layer's use_mask flag default to true. Support a bit array describing
the mask to use. Improve error handling in ProjectRasterFile (also addresses
RT #2947).


Revision 2551 - (view) (annotate) - [select for diffs]
Modified Thu Jan 27 14:19:41 2005 UTC (20 years, 1 month ago) by jonathan
Original Path: trunk/thuban/Thuban/Model/load.py
File length: 27521 byte(s)
Diff to previous 2451
Add a new dialog box for raster layers. The dialog box allows
the user to toggle a mask that is generated by ProjectRasterFile
and is used to only draw the real parts of the projected image.


Revision 2451 - (view) (annotate) - [select for diffs]
Modified Mon Dec 13 17:51:11 2004 UTC (20 years, 2 months ago) by bh
Original Path: trunk/thuban/Thuban/Model/load.py
File length: 27399 byte(s)
Diff to previous 2449
* test/test_load.py (TestAltPath.test_01_single_path_error_fix)
(TestAltPath.test_02_path_error_fix_from_list)
(TestAltPath.test_05_path_error_fix_from_list_changed)
(TestAltPath.test_06_path_error_fix_from_list_fails): self.session
is destroyed in tearDown, so there's no need to do it in a test
case.

* Thuban/Model/load.py (SessionLoader.open_shapefile): Remove a
debug print


Revision 2449 - (view) (annotate) - [select for diffs]
Modified Mon Dec 13 13:37:40 2004 UTC (20 years, 2 months ago) by frank
Original Path: trunk/thuban/Thuban/Model/load.py
File length: 27434 byte(s)
Diff to previous 2446
Updated docstring for SessionLoader.open_shapefile


Revision 2446 - (view) (annotate) - [select for diffs]
Modified Mon Dec 13 11:52:34 2004 UTC (20 years, 2 months ago) by frank
Original Path: trunk/thuban/Thuban/Model/load.py
File length: 26937 byte(s)
Diff to previous 2375
Alternative Path feature:
	* test/test_load.py (TestAltPath): New, tests for alternative path feature
	in load_session()
	(Shapefile_CallBack): Helper, implements controllable callback.

	* Thuban/UI/application.py (ThubanApplication.OnInit):
	Added "alt_path" to self.path
	(ThubanApplication.OpenSession): Added shapefile_callback as second
	callback similar to db_connection_callback.
	(ThubanApplication.run_alt_path_dialog): New, implementaion of
	shapefile_callback. In addition to raising the dialog the control of
	self.path('alt_path') is implemented here.

	* Thuban/Model/load.py (SessionLoader.__init__): Added shapefile_callback.
	(SessionLoader.open_shapefile): Open shapefile, eventually with
	alternative path. This wrapps the "theSession.OpenShapefile(filename)"
	formerly used in start_fileshapesource()/start_layer().
	(SessionLoader.start_fileshapesource): Call open_shapefile().
	(SessionLoader.start_layer): Call open_shapefile().
	(load_session): Added shapefile_callback.

	* Thuban/UI/altpathdialog.py: New, implements dialogs for alternative path
	feature (search / check).


Revision 2375 - (view) (annotate) - [select for diffs]
Modified Sun Oct 3 21:05:30 2004 UTC (20 years, 5 months ago) by jan
Original Path: trunk/thuban/Thuban/Model/load.py
File length: 25237 byte(s)
Diff to previous 2104
(SessionLoader.start_cldata): Also parse the size attribute.


Revision 2104 - (view) (annotate) - [select for diffs]
Modified Fri Mar 12 12:19:15 2004 UTC (20 years, 11 months ago) by bh
Original Path: trunk/thuban/Thuban/Model/load.py
File length: 25171 byte(s)
Diff to previous 2036
Final step for explicit id/geometry columns: Loading and saving

* Resources/XML/thuban-1.1.dtd: New.  Derived from thuban-1.0.dtd
with the following changes:
(dbshapesource): Two new attributes id_column and geometry_column

* Thuban/Model/save.py (SessionSaver.write): Use the new dtd
(SessionSaver.write_session): Use the new namespace
(SessionSaver.write_data_containers): Write the new dbshapesource
parameters

* Thuban/Model/load.py (SessionLoader.__init__): New namespace for
the new file format version
(SessionLoader.start_dbshapesource): Handle the new db parameters

* test/test_save.py: Update to the new dtd and namespace
(SaveSessionTest.test_save_postgis): Update the NonConnectionStore
mock object to provide a working IDColumn method.

* test/test_load_1_0.py: New.  Copy of the test_load.py before
today's changes but with the round-trip tests removed.

* test/test_load_0_9.py: Update doc-string.

* test/test_load.py: Update all .thuban files to the new dtd and
namespace.
(TestPostGISLayer.file_contents): Add the new dbshapesource
paramters


Revision 2036 - (view) (annotate) - [select for diffs]
Modified Mon Dec 22 17:49:43 2003 UTC (21 years, 2 months ago) by bh
Original Path: trunk/thuban/Thuban/Model/load.py
File length: 24075 byte(s)
Diff to previous 2034
* setup.py (setup call): 1.0.0, yeah!

* Thuban/version.py (longversion): 1.0.0, yeah!

* Thuban/Model/load.py (SessionLoader.__init__): Accept the
1.0.0 namespace too

* Thuban/Model/save.py (SessionSaver.write_session): Save with
1.0.0 namespace

* test/test_load.py (LoadSessionTest.dtd)
(TestSingleLayer.file_contents)
(TestNonAsciiColumnName.file_contents)
(TestLayerVisibility.file_contents)
(TestClassification.file_contents, TestLabels.file_contents)
(TestLayerProjection.file_contents)
(TestRasterLayer.file_contents, TestJoinedTable.file_contents)
(TestLabelLayer.file_contents, TestPostGISLayer.file_contents)
(TestPostGISLayerPassword.file_contents)
(TestLoadError.file_contents, TestLoadError.test): Update for
1.0.0 namespace

* test/test_save.py (SaveSessionTest.dtd)
(SaveSessionTest.testEmptySession)
(SaveSessionTest.testSingleLayer)
(SaveSessionTest.testLayerProjection)
(SaveSessionTest.testRasterLayer)
(SaveSessionTest.testClassifiedLayer)
(SaveSessionTest.test_dbf_table)
(SaveSessionTest.test_joined_table)
(SaveSessionTest.test_save_postgis): Update for 1.0.0 namespace


Revision 2034 - (view) (annotate) - [select for diffs]
Modified Mon Dec 22 16:35:16 2003 UTC (21 years, 2 months ago) by bh
Original Path: trunk/thuban/Thuban/Model/load.py
File length: 23999 byte(s)
Diff to previous 2004
* Thuban/Model/load.py (SessionLoader.start_label): Make sure the
alignment flags are byte strings not unicode and that they have
valid values

* test/test_load.py (TestLabelLayer): New. Test loading (and
indirectly saving) of maps with labels.


Revision 2004 - (view) (annotate) - [select for diffs]
Modified Tue Dec 2 13:25:55 2003 UTC (21 years, 3 months ago) by bh
Original Path: trunk/thuban/Thuban/Model/load.py
File length: 23317 byte(s)
Diff to previous 1970
* Thuban/Model/save.py (SessionSaver.write_session): Save files
with the thuban-1.0rc1

* Thuban/Model/load.py (SessionLoader.__init__): Recognize the
thuban-1.0rc1 namespace too

* test/test_save.py (SaveSessionTest.dtd)
(SaveSessionTest.testEmptySession)
(SaveSessionTest.testSingleLayer)
(SaveSessionTest.testLayerProjection)
(SaveSessionTest.testRasterLayer)
(SaveSessionTest.testClassifiedLayer)
(SaveSessionTest.test_dbf_table)
(SaveSessionTest.test_joined_table)
(SaveSessionTest.test_save_postgis): Update to thuban-1.0rc1
namespace

* test/test_load.py (LoadSessionTest.dtd): Update to thuban-1.0rc1
namespace
(TestSingleLayer.file_contents)
(TestNonAsciiColumnName.file_contents)
(TestLayerVisibility.file_contents)
(TestClassification.file_contents, TestLabels.file_contents)
(TestLayerProjection.file_contents)
(TestRasterLayer.file_contents, TestJoinedTable.file_contents)
(TestPostGISLayer.file_contents)
(TestPostGISLayerPassword.file_contents)
(TestLoadError.file_contents, TestLoadError.test): Update to
thuban-1.0rc1 namespace


Revision 1970 - (view) (annotate) - [select for diffs]
Modified Mon Nov 24 18:36:00 2003 UTC (21 years, 3 months ago) by bh
Original Path: trunk/thuban/Thuban/Model/load.py
File length: 23240 byte(s)
Diff to previous 1930
* Thuban/Model/load.py (SessionLoader.check_attrs): If no
converter is specified for an attribute assume it's a string
containing only Latin1 characters. Update doc-string accordingly.
This change should fix many places where unicode objects might
accidentally enter Thuban.

* test/test_load.py (TestNonAsciiColumnName): New test to check
what happens with column names in DBF files that contain non-ascii
characters


Revision 1930 - (view) (annotate) - [select for diffs]
Modified Tue Nov 11 13:24:41 2003 UTC (21 years, 3 months ago) by bh
Original Path: trunk/thuban/Thuban/Model/load.py
File length: 22983 byte(s)
Diff to previous 1844
(SessionLoader.Destroy): New. Clear all
instance variables to cut cyclic references. The GC would have
collected the loader eventually but it can happen that it doesn't
run at all until thuban is closed (2.3 but not 2.2 tries a bit
harder and forces a collection when the interpreter terminates)
(load_session): Call the handler's Destroy method to make sure
that it gets garbage collected early. Otherwise it will be
collected very late if at all and it holds some references to e.g.
shapestores and the session which can lead to leaks (of e.g. the
temporary files)


Revision 1844 - (view) (annotate) - [select for diffs]
Modified Tue Oct 21 10:49:44 2003 UTC (21 years, 4 months ago) by bh
Original Path: trunk/thuban/Thuban/Model/load.py
File length: 22605 byte(s)
Diff to previous 1664
(SessionLoader.__init__): Also accept the
thuban-1.0-dev.dtd namespace
(SessionLoader.check_attrs): Allow a callable object as conversion
too
(SessionLoader.start_projection, SessionLoader.end_projection)
(SessionLoader.start_parameter): Handle the epsg attribute and
rename a few instance variables to lower case


Revision 1664 - (view) (annotate) - [select for diffs]
Modified Wed Aug 27 15:20:54 2003 UTC (21 years, 6 months ago) by bh
Original Path: trunk/thuban/Thuban/Model/load.py
File length: 22045 byte(s)
Diff to previous 1646
As preparation for the 0.9 release, switch thuban files to a
non-dev namespace

* Thuban/Model/save.py (SessionSaver.write_session): Write files
with the http://thuban.intevation.org/dtds/thuban-0.9.dtd
namespace

* Thuban/Model/load.py (SessionLoader.__init__): Accept the
http://thuban.intevation.org/dtds/thuban-0.9.dtd namespace too

* test/test_save.py (SaveSessionTest.dtd)
(SaveSessionTest.testEmptySession)
(SaveSessionTest.testSingleLayer)
(SaveSessionTest.testLayerProjection)
(SaveSessionTest.testRasterLayer)
(SaveSessionTest.testClassifiedLayer)
(SaveSessionTest.test_dbf_table)
(SaveSessionTest.test_joined_table)
(SaveSessionTest.test_save_postgis): Update for new namespace

* test/test_load.py (LoadSessionTest.dtd, TestSingleLayer)
(TestLayerVisibility.file_contents, TestLabels.file_contents)
(TestLayerProjection.file_contents)
(TestRasterLayer.file_contents, TestJoinedTable.file_contents)
(TestPostGISLayer.file_contents)
(TestPostGISLayerPassword.file_contents)
(TestLoadError.file_contents, TestLoadError.test): Update for new
namespace


Revision 1646 - (view) (annotate) - [select for diffs]
Modified Mon Aug 25 13:43:56 2003 UTC (21 years, 6 months ago) by bh
Original Path: trunk/thuban/Thuban/Model/load.py
File length: 21971 byte(s)
Diff to previous 1642
Basic loading of sessions containing postgis connections:

* Thuban/Model/load.py (LoadError): Add doc-string
(LoadCancelled): New exception class to indicate a cancelled load
(SessionLoader.__init__): Add the db_connection_callback parameter
which will be used by the loader to get updated parameters and a
password for a database connection
(SessionLoader.__init__): Add the new XML elements to the
dispatchers dictionary
(SessionLoader.check_attrs): Two new conversions, ascii to convert
to a byte-string object and idref as a generic id reference
(SessionLoader.start_dbconnection)
(SessionLoader.start_dbshapesource): New. Handlers for the new XML
elements
(load_session): Add the db_connection_callback to pass through the
SessionLoader

* test/test_load.py (TestPostGISLayer, TestPostGISLayerPassword):
New classes to test loading of sessions with postgis database
connections.


Revision 1642 - (view) (annotate) - [select for diffs]
Modified Mon Aug 25 10:54:31 2003 UTC (21 years, 6 months ago) by bh
Original Path: trunk/thuban/Thuban/Model/load.py
File length: 18219 byte(s)
Diff to previous 1452
* Thuban/Model/load.py (SessionLoader.check_attrs): Raise a
LoadError when a required attribute is missing. The code used to
be commented out for some reason, but probably should have been
active.

* test/test_load.py (TestLoadError.test): Test the message in the
LoadError too to make sure it really is about the missing
attribute


Revision 1452 - (view) (annotate) - [select for diffs]
Modified Fri Jul 18 12:57:59 2003 UTC (21 years, 7 months ago) by bh
Original Path: trunk/thuban/Thuban/Model/load.py
File length: 18238 byte(s)
Diff to previous 1428
* Thuban/Model/layer.py (Layer.__init__): Rename
classificationField to classificatin_column and init it here so
that it can be used in SetClassificationColumn
(Layer.GetClassificationColumn, Layer.GetClassificationField):
Rename to GetClassificationColumn.
(Layer.SetClassificationColumn, Layer.SetClassificationField):
Rename to SetClassificationColumn and issue a LAYER_CHANGED
message if the column changes.
(Layer._classification_changed, Layer.ClassChanged): Rename to
_classification_changed. Update the callers.
(Layer.SetShapeStore): Further field->column renames.

* Thuban/Model/load.py (SessionLoader.start_classification)
(SessionLoader.start_clpoint): Updates because of
field->column method name changes in the Layer class

* Thuban/Model/save.py (SessionSaver.write_classification): Updates
because of field->column method name changes in the Layer class

* Thuban/UI/classifier.py (Classifier.__init__)
(Classifier._OnTry, Classifier._OnRevert): Updates because of
field->column method name changes in the Layer class

* Thuban/UI/renderer.py (MapRenderer.draw_shape_layer): Updates
because of field->column method name changes in the Layer class

* Thuban/UI/viewport.py (ViewPort.find_shape_at): Updates because
of field->column method name changes in the Layer class

* test/test_save.py (SaveSessionTest.testClassifiedLayer)
(SaveSessionTest.testClassifiedLayer): Update because of
field->column method name changes in the Layer class

* test/test_layer.py (SetShapeStoreTests.setUp)
(SetShapeStoreTests.test_sanity): Update because of field->column
method name changes in the Layer class
(TestLayerModification.setUp): Subscribe to LAYER_CHANGED as well
(TestLayerModification.test_sanity)
(TestLayerModification.test_initial_settings): remove unsued code
and rename to test_sanity.
(TestLayerModification.test_set_classification): New test for
SetClassification and SetClassificationField.


Revision 1428 - (view) (annotate) - [select for diffs]
Modified Wed Jul 16 13:23:01 2003 UTC (21 years, 7 months ago) by jonathan
Original Path: trunk/thuban/Thuban/Model/load.py
File length: 18236 byte(s)
Diff to previous 1417
(SessionLoader.start_classification):
        Set the field name on the layer, not the classification.


Revision 1417 - (view) (annotate) - [select for diffs]
Modified Tue Jul 15 08:43:53 2003 UTC (21 years, 7 months ago) by bh
Original Path: trunk/thuban/Thuban/Model/load.py
File length: 18219 byte(s)
Diff to previous 1408
* Thuban/Model/save.py (SessionSaver.write_classification): Encode
string values (in addition to the labels) as UTF 8

* Thuban/Model/load.py (SessionLoader.start_clpoint): Decode the
values if the field type is string

* test/test_save.py (SaveSessionTest.testClassifiedLayer): Test
saving a session with non-ascii string classification values.

* test/test_load.py (TestClassification.file_contents)
(TestClassification.test): Check for non-ascii values in string
classifications


Revision 1408 - (view) (annotate) - [select for diffs]
Modified Mon Jul 14 09:38:29 2003 UTC (21 years, 7 months ago) by frank
Original Path: trunk/thuban/Thuban/Model/load.py
File length: 18077 byte(s)
Diff to previous 1375
(SessionLoader.start_map): Encode map
	title to latin1.  Fixes https://intevation.de/rt/webrt?serial_num=2013


Revision 1375 - (view) (annotate) - [select for diffs]
Modified Tue Jul 8 10:53:05 2003 UTC (21 years, 8 months ago) by bh
Original Path: trunk/thuban/Thuban/Model/load.py
File length: 18064 byte(s)
Diff to previous 1354
* Resources/XML/thuban-0.9.dtd: New. This will become the DTD for
0.9.

* Thuban/Model/transientdb.py (TransientJoinedTable.JoinType):
New. Return the join type

* Thuban/Model/save.py (SessionSaver.write_session): Use new 0.9
DTD
(SessionSaver.write_data_containers): Save the join type for
joined tables

* Thuban/Model/load.py (SessionLoader.__init__): Add the new 0.9
namespace
(SessionLoader.start_jointable): Handle the jointype attribute

* test/test_load_0_8.py: New. Effectively a copy of test_load.py
as of Thuban 0.8. These are now tests to determine whether Thuban
can still read files generated by Thuban 0.8

* test/test_load.py (LoadSessionTest.dtd)
(TestSingleLayer.file_contents)
(TestLayerVisibility.file_contents, TestLabels.file_contents)
(TestLayerProjection.file_contents)
(TestRasterLayer.file_contents, TestJoinedTable.file_contents)
(TestJoinedTable.file_contents)
(TestLoadError.file_contents): Update for new DTD
(TestJoinedTable.file_contents, TestJoinedTable.setUp): Add test
for new join type attribute

* test/test_save.py (SaveSessionTest.dtd)
(SaveSessionTest.testEmptySession)
(SaveSessionTest.testSingleLayer)
(SaveSessionTest.testLayerProjection)
(SaveSessionTest.testRasterLayer)
(SaveSessionTest.testClassifiedLayer)
(SaveSessionTest.test_dbf_table)
(SaveSessionTest.test_joined_table): Update for new DTD
(SaveSessionTest.test_joined_table): Add test for new join type
attribute


Revision 1354 - (view) (annotate) - [select for diffs]
Modified Wed Jul 2 09:37:07 2003 UTC (21 years, 8 months ago) by jonathan
Original Path: trunk/thuban/Thuban/Model/load.py
File length: 17102 byte(s)
Diff to previous 1339
(SessionLoader.start_clrange): Fix
        call to ClassGroupRange constructor to use a tuple.


Revision 1339 - (view) (annotate) - [select for diffs]
Modified Tue Jul 1 16:10:14 2003 UTC (21 years, 8 months ago) by jonathan
Original Path: trunk/thuban/Thuban/Model/load.py
File length: 17050 byte(s)
Diff to previous 1282
Fixes RTbug #1971.
(SessionLoader.start_classification): Call
        Classification.SetFieldInfo().


Revision 1282 - (view) (annotate) - [select for diffs]
Modified Mon Jun 23 09:47:18 2003 UTC (21 years, 8 months ago) by bh
Original Path: trunk/thuban/Thuban/Model/load.py
File length: 17027 byte(s)
Diff to previous 1268
Bug fix for RT #1961:

* Thuban/Model/load.py (SessionLoader.start_derivedshapesource):
Register DerivedShapestores with the session

* Thuban/Model/session.py (Session.Tables): Make sure each table
is only listed once.

* test/test_load.py (TestJoinedTable.test): Add check_format call.
Update file contents to match the one written out.


Revision 1268 - (view) (annotate) - [select for diffs]
Modified Fri Jun 20 16:10:12 2003 UTC (21 years, 8 months ago) by bh
Original Path: trunk/thuban/Thuban/Model/load.py
File length: 17012 byte(s)
Diff to previous 1159
* Resources/XML/thuban-0.8.dtd: New DTD for the new file format
version.

* Thuban/Model/save.py (sort_data_stores): New. Make topological
sort of the data sources so they can be written with sources that
data sources that depend on other data sources come after the
sources they depend on.
(SessionSaver.__init__): Add idmap instance variable to map from
objects to the ids used in the file.
(SessionSaver.get_id, SessionSaver.define_id)
(SessionSaver.has_id): New. Methods to manage the idmap
(SessionSaver.write): Use thuban-0.8.dtd
(SessionSaver.write_session): Add a namespace on the session and
write out the data sources before the maps.
(SessionSaver.write_data_containers): New. Write the data
containers.
(SessionSaver.write_layer): Layer elements now refer to a
shapestore and don't contain filenames anymore.

* Thuban/Model/load.py (LoadError): Exception class to raise when
errors in the files are discovered
(SessionLoader.__init__): Define dispatchers for elements with a
thuban-0.8 namespace too.
(SessionLoader.check_attrs): New helper method to check and
convert attributes
(AttrDesc): New. Helper class for SessionLoader.check_attrs
(SessionLoader.start_fileshapesource)
(SessionLoader.start_derivedshapesource)
(SessionLoader.start_filetable, SessionLoader.start_jointable):
Handlers for the new elements in the new fileformat
(SessionLoader.start_layer): Handle the shapestore attribute in
addition to filename.
(SessionLoader.start_table, SessionLoader.end_table): Removed.
They were never used in the old formats and aren't needed for the
new.

* Thuban/Model/session.py (Session.DataContainers): New method to
return all "data containers", i.e. shapestores and tables

* test/xmlsupport.py (SaxEventLister.__init__)
(SaxEventLister.startElementNS, sax_eventlist): Add support to
normalize IDs.

* test/test_xmlsupport.py
(TestEventList.test_even_list_id_normalization): New test case for
id normalization

* test/test_load.py (LoadSessionTest.check_format): Use ID
normalization
(LoadSessionTest.thubanids, LoadSessionTest.thubanidrefs): New
class atrributes used for ID normalization
(TestSingleLayer, TestLayerVisibility, TestLabels.test)
(TestLayerProjection.test, TestRasterLayer.test): Adapt to new
file format
(TestJoinedTable): New test for loading sessions with joined
tables.
(TestLoadError): New. Test whether missing required attributes
cause a LoadError.

* test/test_save.py (SaveSessionTest.thubanids)
(SaveSessionTest.thubanidrefs): New class attributes for ID
normalization in .thuban files.
(SaveSessionTest.compare_xml): Use id-normalization.
(SaveSessionTest.testEmptySession)
(SaveSessionTest.testLayerProjection)
(SaveSessionTest.testRasterLayer)
(SaveSessionTest.testClassifiedLayer): Adapt to new file format.
(SaveSessionTest.testLayerProjection): The filename used was the
same as for testSingleLayer. Use a different one.
(SaveSessionTest.test_dbf_table)
(SaveSessionTest.test_joined_table): New test cases for saving the
new data sources structures.
(TestStoreSort, MockDataStore): Classes to test the sorting of the
data stores for writing.


Revision 1159 - (view) (annotate) - [select for diffs]
Modified Thu Jun 12 12:40:27 2003 UTC (21 years, 8 months ago) by jonathan
Original Path: trunk/thuban/Thuban/Model/load.py
File length: 9931 byte(s)
Diff to previous 930
(XMLReader): Moved into seperate file xmlreader.py.


Revision 930 - (view) (annotate) - [select for diffs]
Modified Tue May 20 15:23:03 2003 UTC (21 years, 9 months ago) by jonathan
Original Path: trunk/thuban/Thuban/Model/load.py
File length: 14049 byte(s)
Diff to previous 874
(SessionLoader.__init__): Add rasterlayer tag handler.
(SessionLoader.start_layer): Encode the filename.
(SessionLoader.start_rasterlayer, SessionLoader.end_rasterlayer):
        New. Supports reading a rasterlayer tag.


Revision 874 - (view) (annotate) - [select for diffs]
Modified Fri May 9 16:31:12 2003 UTC (21 years, 10 months ago) by jonathan
Original Path: trunk/thuban/Thuban/Model/load.py
File length: 13345 byte(s)
Diff to previous 784
(XMLReader.encode): New. Encodes the given
        string appropriately for use in Thuban. Fixes RTbug #1851.
(SessionLoader.end_projection): Handle the context of the
        projection tag a bit better by looking at what objects are not
        None. There was an assumption that a projection tag for a map
        could occur before any layers.
(SessionLoader.start_clrange): Provide backward compatibility for
        reading min/max values as well as the new range parameter.


Revision 784 - (view) (annotate) - [select for diffs]
Modified Tue Apr 29 17:30:18 2003 UTC (21 years, 10 months ago) by jonathan
Original Path: trunk/thuban/Thuban/Model/load.py
File length: 12521 byte(s)
Diff to previous 772
Remove Thuban.common import and commented code that used Str2Num.


Revision 772 - (view) (annotate) - [select for diffs]
Modified Tue Apr 29 14:34:11 2003 UTC (21 years, 10 months ago) by jonathan
Original Path: trunk/thuban/Thuban/Model/load.py
File length: 12776 byte(s)
Diff to previous 763
(SessionLoader.start_layer): Read visible parameter.


Revision 763 - (view) (annotate) - [select for diffs]
Modified Tue Apr 29 10:55:26 2003 UTC (21 years, 10 months ago) by bh
Original Path: trunk/thuban/Thuban/Model/load.py
File length: 12656 byte(s)
Diff to previous 744
(XMLReader.__init__, XMLReader.read): Turn
the __parser instance variable into a normal local variable in
read. It's only used there and read will never be called more than
once. Plus it introduces a reference cycle that keeps can keep the
session object alive for a long time.


Revision 744 - (view) (annotate) - [select for diffs]
Modified Fri Apr 25 10:26:35 2003 UTC (21 years, 10 months ago) by jonathan
Original Path: trunk/thuban/Thuban/Model/load.py
File length: 12859 byte(s)
Diff to previous 737
(SessionLoader.start_projection): Remember the projection name and use it
        when constructing the Projection object.


Revision 737 - (view) (annotate) - [select for diffs]
Modified Fri Apr 25 09:12:17 2003 UTC (21 years, 10 months ago) by jonathan
Original Path: trunk/thuban/Thuban/Model/load.py
File length: 12763 byte(s)
Diff to previous 723
(XMLReader.GetFilename): Renamed from XMLReader.GetFileName.
(SessionLoader): Added support for loading projection tags that
        appear inside a layer.


Revision 723 - (view) (annotate) - [select for diffs]
Modified Thu Apr 24 15:31:53 2003 UTC (21 years, 10 months ago) by bh
Original Path: trunk/thuban/Thuban/Model/load.py
File length: 12600 byte(s)
Diff to previous 722
First step towards table management. Introduce a simple data
abstraction so that we replace the data a layer uses more easily
in the next step.

* Thuban/Model/data.py: New file with a simple data abstraction
that bundles shapefile and dbffile into one object.

* Thuban/Model/session.py (Session.OpenShapefile): New method to
open shapefiles and return a shape store object

* Thuban/Model/layer.py (Layer.__init__): Pass the data as a store
object instead of a shapefile filename. This introduces a new
instance variable store holding the datastore. For intermediate
backwards compatibility keep the old instance variables.
(open_shapefile): Removed. No longer needed with the shape store.
(Layer.SetShapeStore, Layer.ShapeStore): New methods to set and
get the shape store used by a layer.
(Layer.Destroy): No need to explicitly destroy the shapefile or
table anymore.

* Thuban/UI/mainwindow.py (MainWindow.AddLayer)
(MainWindow.AddLayer): Use the session's OpenShapefile method to
open shapefiles

* Thuban/Model/load.py (ProcessSession.start_layer): Use the
session's OpenShapefile method to open shapefiles

* test/test_classification.py
(TestClassification.test_classification): Use the session's
OpenShapefile method to open shapefiles and build the filename in
a more platform independed way

* test/test_layer.py (TestLayer.setUp, TestLayer.tearDown):
Implement to have a session to use in the tests
(TestLayer.test_arc_layer, TestLayer.test_polygon_layer)
(TestLayer.test_point_layer, TestLayer.test_empty_layer): Use the
session's OpenShapefile method to open shapefiles
(TestLayerLegend.setUp): Instantiate a session so that we can use
it to open shapefiles.
(TestLayerLegend.tearDown): Make sure that all references to
layers and session are removed otherwise we may get a resource
leak

* test/test_map.py (TestMapAddLayer.test_add_layer)
(TestMapWithContents.setUp): Instantiate a session so that we can
use it to open shapefiles.
(TestMapWithContents.tearDown): Make sure that all references to
layers, maps and sessions are removed otherwise we may get a
resource leak
("__main__"): use support.run_tests() so that more info about
uncollected garbage is printed

* test/test_save.py (SaveSessionTest.testSingleLayer): Use the
session's OpenShapefile method to open shapefiles
("__main__"): use support.run_tests() so that more info about
uncollected garbage is printed

* test/test_selection.py (TestSelection.tearDown): Make sure that
all references to the session and the selection are removed
otherwise we may get a resource leak
(TestSelection.get_layer): Instantiate a session so that we can
use it to open shapefiles.
("__main__"): use support.run_tests() so that more info about
uncollected garbage is printed

* test/test_session.py (TestSessionBase.tearDown)
(TestSessionWithContent.tearDown): Make sure that all references
to the session and layers are removed otherwise we may get a
resource leak
(TestSessionWithContent.setUp): Use the session's OpenShapefile
method to open shapefiles


Revision 722 - (view) (annotate) - [select for diffs]
Modified Thu Apr 24 10:12:29 2003 UTC (21 years, 10 months ago) by jonathan
Original Path: trunk/thuban/Thuban/Model/load.py
File length: 12500 byte(s)
Diff to previous 706
(XMLReader.read): Should have been checking if the file_or_filename object
        had the 'read' attribute.


Revision 706 - (view) (annotate) - [select for diffs]
Modified Wed Apr 23 08:44:21 2003 UTC (21 years, 10 months ago) by jonathan
Original Path: trunk/thuban/Thuban/Model/load.py
File length: 12328 byte(s)
Diff to previous 694
(XMLReader): Renamed from XMLProcessor to
        promote symmetry. There now exists XMLReader and XMLWriter.
(XMLReader.read): New. Call to read the given file descriptor or
        filename.
(XMLReader.close): New. Make sure the file is closed.
(XMLReader.GetFileName): New. Return just the file name that is being read from.
(XMLReader.GetDirectory): New. Return just the directory of the file
        that is being read.
(XMLReader.AddDispatchers): New. Take a dictionary which contains
        the names of functions to call as the XML tree is parsed.
(XMLReader.startElementNS): Updated to use new dispatcher dictionary.
(XMLReader.endElementNS): Updated to use new dispatcher dictionary.
(SessionLoader): Removed class variables start_dispatcher and
        end_dispatcher since this functionality is now part of a class
        instance. Fixes RTbug #1808.
(SessionLoader.__init__): Add dispatcher functions.
(load_xmlfile): Code was moved into the XMLReader.read().
(load_session): Use modified SessionLoader.


Revision 694 - (view) (annotate) - [select for diffs]
Modified Wed Apr 16 16:39:18 2003 UTC (21 years, 10 months ago) by jonathan
Original Path: trunk/thuban/Thuban/Model/load.py
File length: 11806 byte(s)
Diff to previous 614
(XMLProcessor): New. Contains all the general XML reading methods that
        were part of ProcessSession.


Revision 614 - (view) (annotate) - [select for diffs]
Modified Mon Apr 7 08:56:38 2003 UTC (21 years, 11 months ago) by jonathan
Original Path: trunk/thuban/Thuban/Model/load.py
File length: 11204 byte(s)
Diff to previous 610
Use Classification.AppendGroup(), not AddGroup()


Revision 610 - (view) (annotate) - [select for diffs]
Modified Fri Apr 4 13:56:59 2003 UTC (21 years, 11 months ago) by jonathan
Original Path: trunk/thuban/Thuban/Model/load.py
File length: 11198 byte(s)
Diff to previous 526
Rename Color.None to Color.Transparent.


Revision 526 - (view) (annotate) - [select for diffs]
Modified Wed Mar 12 19:17:49 2003 UTC (21 years, 11 months ago) by jonathan
Original Path: trunk/thuban/Thuban/Model/load.py
File length: 11191 byte(s)
Diff to previous 525
Comments, and an extra import.


Revision 525 - (view) (annotate) - [select for diffs]
Modified Wed Mar 12 19:12:30 2003 UTC (21 years, 11 months ago) by jonathan
Original Path: trunk/thuban/Thuban/Model/load.py
File length: 10993 byte(s)
Diff to previous 524
Testing fix for xml reader exceptions.


Revision 524 - (view) (annotate) - [select for diffs]
Modified Wed Mar 12 18:26:55 2003 UTC (21 years, 11 months ago) by jonathan
Original Path: trunk/thuban/Thuban/Model/load.py
File length: 10607 byte(s)
Diff to previous 493
Fixed external entity problem.


Revision 493 - (view) (annotate) - [select for diffs]
Modified Mon Mar 10 10:45:10 2003 UTC (22 years ago) by jonathan
Original Path: trunk/thuban/Thuban/Model/load.py
File length: 10420 byte(s)
Diff to previous 473
Comment out print statement


Revision 473 - (view) (annotate) - [select for diffs]
Modified Wed Mar 5 18:39:45 2003 UTC (22 years ago) by jonathan
Original Path: trunk/thuban/Thuban/Model/load.py
File length: 10406 byte(s)
Diff to previous 465
import FIELDTYPE constants from table


Revision 465 - (view) (annotate) - [select for diffs]
Modified Wed Mar 5 18:18:06 2003 UTC (22 years ago) by jonathan
Original Path: trunk/thuban/Thuban/Model/load.py
File length: 10317 byte(s)
Diff to previous 439
(ProcessSession): Use proper string conversion function; fixes RTbug #1713.


Revision 439 - (view) (annotate) - [select for diffs]
Modified Thu Feb 27 15:54:05 2003 UTC (22 years ago) by jonathan
Original Path: trunk/thuban/Thuban/Model/load.py
File length: 9569 byte(s)
Diff to previous 413
Use new Classification and Group functions.


Revision 413 - (view) (annotate) - [select for diffs]
Modified Wed Feb 19 16:52:04 2003 UTC (22 years ago) by jonathan
Original Path: trunk/thuban/Thuban/Model/load.py
File length: 9191 byte(s)
Diff to previous 390
(ProcessSession): Use new methods on Layer
        to get the classifcation and use the new ClassData* classes to
        hold the classification data. Use Str2Num to convert numbers
        properly.


Revision 390 - (view) (annotate) - [select for diffs]
Modified Mon Feb 10 15:25:49 2003 UTC (22 years ago) by jonathan
Original Path: trunk/thuban/Thuban/Model/load.py
File length: 8915 byte(s)
Diff to previous 374
* Thuban/Model/load.py (ProcessSession): Use the new ClassData
        object instead of a dictionary.


Revision 374 - (view) (annotate) - [select for diffs]
Modified Mon Jan 27 14:20:02 2003 UTC (22 years, 1 month ago) by jan
Original Path: trunk/thuban/Thuban/Model/load.py
File length: 8963 byte(s)
Diff to previous 365
Replace user string by _() for i18n.


Revision 365 - (view) (annotate) - [select for diffs]
Modified Mon Jan 27 11:47:53 2003 UTC (22 years, 1 month ago) by jonathan
Original Path: trunk/thuban/Thuban/Model/load.py
File length: 8933 byte(s)
Diff to previous 267
added support to load classification information


Revision 267 - (view) (annotate) - [select for diffs]
Modified Thu Aug 22 10:25:30 2002 UTC (22 years, 6 months ago) by bh
Original Path: trunk/thuban/Thuban/Model/load.py
File length: 6628 byte(s)
Diff to previous 105
Get rid of the Python 1.5.2 compatibility
code. Remove the little test code which would be executed when the
module is run as a script which didn't work anymore since it can't
import the other Thuban modules.
(ProcessSession, load_session): Refactor the ProcessSession to
have one method for each element start and end tag so that derived
classes can easily override the processing of individual tags.
Also, always parse with namespaces enabled because applications
built on top of Thuban will likely use namespaces if they extend
the session file format.


Revision 105 - (view) (annotate) - [select for diffs]
Modified Fri Apr 19 15:36:57 2002 UTC (22 years, 10 months ago) by jan
Original Path: trunk/thuban/Thuban/Model/load.py
File length: 5759 byte(s)
Diff to previous 75
convert projection parameters from unicode to regular string


Revision 75 - (view) (annotate) - [select for diffs]
Modified Mon Feb 4 19:22:22 2002 UTC (23 years, 1 month ago) by bh
Original Path: trunk/thuban/Thuban/Model/load.py
File length: 5690 byte(s)
Diff to previous 6
	* Thuban/Model/load.py (ProcessSession.startElement): Read the
	stroke_width attribute


Revision 6 - (view) (annotate) - [select for diffs]
Added Tue Aug 28 15:41:52 2001 UTC (23 years, 6 months ago) by bh
Original Path: trunk/thuban/Thuban/Model/load.py
File length: 5561 byte(s)
import all the source files


This form allows you to request diffs between any two revisions of this file. For each of the two "sides" of the diff, enter a numeric revision.

  Diffs between and
  Type of Diff should be a

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26