[Thuban-devel] Re: RfD: Support for layer specific resources
Martin Schulze
joey at infodrom.org
Tue Jul 27 12:45:03 CEST 2004
Bernhard Herzog wrote:
> Martin Schulze <joey at infodrom.org> writes:
>
> > Are the attached files better?
>
> Yes. Only nit: Please don't use "object" as identifier in new code.
> It's a Python builtin.
Oh, sorry. I wonder why Python didn't complain, though. Changed and
committed, properly documented as well.
> > If so, where should it be placed? Thuban.UI sounds a bit weird as
> > location. Thuban.Lib sounds more appropriate.
>
> Yes. Thuban.Lib is better.
Done.
In order to use the new ClassMapper I'd assume that we'll need
something like the following:
from Thuban.Lib.classmapper import ClassMapper
_properties_dialogs = ClassMapper()
def add_properties_dialog(layer_class, dialog_class):
_properties_dialogs.add(layer_class, dialog_class)
def get_properties_dialog_class(layer):
return _properties_dialogs.get(layer)
And for Thuban.UI.classifier:
add_properties_dialog(Layer, Classifier)
add_properties_dialog(RasterLayer, Classifier)
as well as for Thuban.UI.mainwindow:
def OpenLayerProperties(self, layer, group = None):
dialog_class = get_properties_dialog_class(layer)
if dialog_class is not None:
name = "layer_properties" + str(id(layer))
self.OpenOrRaiseDialog(name, dialog_class, layer, group = group)
Right?
If so, where should add_properties_dialog and get_properties_dialog_class
be placed? Maybe in Thuban.Lib.dialogs? Also, are the names ok?
Regards,
Joey
--
WARNING: Do not execute! This call violates patent DE10108564.
http://www.elug.de/projekte/patent-party/patente/DE10108564
wget -O patinfo-`date +"%Y%m%d"`.html http://patinfo.ffii.org/
More information about the Thuban-devel
mailing list
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)