jan: thuban/Thuban/Model map.py,1.19,1.20 label.py,1.3,1.4
cvs@intevation.de
cvs at intevation.de
Thu Feb 17 12:02:30 CET 2005
Author: jan
Update of /thubanrepository/thuban/Thuban/Model
In directory doto:/tmp/cvs-serv18360
Modified Files:
map.py label.py
Log Message:
Fixed doc-strings to comply with coding_guidelines.
Index: map.py
===================================================================
RCS file: /thubanrepository/thuban/Thuban/Model/map.py,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -d -r1.19 -r1.20
--- map.py 16 Feb 2005 23:14:35 -0000 1.19
+++ map.py 17 Feb 2005 11:02:28 -0000 1.20
@@ -22,7 +22,9 @@
class Map(TitledObject, Modifiable):
- """Represent a map. A map is a list of layers. Additionally
+ """Represent a map.
+
+ A map is a list of layers. Additionally
there is a special label layer containing all labels that
are defined for the map.
@@ -53,10 +55,9 @@
self.projection = projection
def Destroy(self):
- """Destroys the map object with all layers including
- the label layer.
+ """Destroys the map object with all layers including the label layer.
- Calls Modifiable.Destroy first since it will call
+ Calls Modifiable. Destroy first since it will call
Publisher.Destroy which removes all subscriptions. Otherwise
clearing the layers results in messages to be sent which can
cause problems.
@@ -75,6 +76,7 @@
def RemoveLayer(self, layer):
"""Remove layer from the map.
+
This can not be applied for the label layer of the map.
"""
self.unsubscribe_layer_channels(layer)
@@ -93,8 +95,7 @@
return 1
def ClearLayers(self):
- """Delete all layers and also remove all labels from the
- label layer.
+ """Delete all layers and also remove all labels from the label layer.
"""
for layer in self.layers:
self.unsubscribe_layer_channels(layer)
@@ -126,13 +127,16 @@
return self.layers
def HasLayers(self):
- """Return true if the map has at least one layer other
+ """Information whether this map has layers.
+
+ Returns true if the map has at least one layer other
than the label layer."""
return len(self.layers) > 0
def MoveLayerToTop(self, layer):
- """Put the layer on top of the layer stack. This can not
- be applied to the label layer.
+ """Put the layer on top of the layer stack.
+
+ This can not be applied to the label layer.
If the layer is already at the top do nothing. If the stacking
order has been changed, issue a MAP_LAYERS_CHANGED message.
@@ -145,8 +149,9 @@
self.changed(MAP_STACKING_CHANGED, self)
def RaiseLayer(self, layer):
- """Swap the layer with the one above it. This does
- not apply to the label layer.
+ """Swap the layer with the one above it.
+
+ This does not apply to the label layer.
If the layer is already at the top do nothing. If the stacking
order has been changed, issue a MAP_LAYERS_CHANGED message.
@@ -159,8 +164,9 @@
self.changed(MAP_STACKING_CHANGED, self)
def LowerLayer(self, layer):
- """Swap the layer with the one below it. This does
- not apply to the label layer.
+ """Swap the layer with the one below it.
+
+ This does not apply to the label layer.
If the layer is already at the bottom do nothing. If the
stacking order has been changed, issue a MAP_LAYERS_CHANGED message.
@@ -173,8 +179,9 @@
self.changed(MAP_STACKING_CHANGED, self)
def MoveLayerToBottom(self, layer):
- """Put the layer at the bottom of the stack. This does
- not apply to the label layer.
+ """Put the layer at the bottom of the stack.
+
+ This does not apply to the label layer.
If the layer is already at the bottom do nothing. If the
stacking order has been changed, issue a MAP_LAYERS_CHANGED message.
@@ -188,6 +195,7 @@
def BoundingBox(self):
"""Return the bounding box of the map in Lat/Lon coordinates.
+
The label layer is not considered for the computation of the
bounding box.
@@ -218,6 +226,7 @@
def ProjectedBoundingBox(self):
"""Return the bounding box of the map in projected coordinates.
+
The label layer is not considered for the computation of the
bounding box.
@@ -238,7 +247,8 @@
def SetProjection(self, projection):
"""Set the projection of the map.
- Issue a MAP_PROJECTION_CHANGED message."""
+ Issue a MAP_PROJECTION_CHANGED message.
+ """
old_proj = self.projection
self.projection = projection
self.changed(MAP_PROJECTION_CHANGED, self, old_proj)
@@ -267,8 +277,10 @@
self.label_layer.UnsetModified()
def TreeInfo(self):
- """Return a tuple of (title, tupel) describing the contents
- of the object in a tree-structure.
+ """Return a description of the object.
+
+ A tuple of (title, tupel) describing the contents
+ of the object in a tree-structure is returned.
"""
items = []
if self.BoundingBox() != None:
Index: label.py
===================================================================
RCS file: /thubanrepository/thuban/Thuban/Model/label.py,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- label.py 16 Feb 2005 23:13:19 -0000 1.3
+++ label.py 17 Feb 2005 11:02:28 -0000 1.4
@@ -22,10 +22,12 @@
class Label:
- """This class repesents a single label that is
- defined by its coordinate, the text as well
+ """This class repesents a single label.
+
+ The label is defined by its coordinate, the text as well
as vertical and horizontal alignment concerning
- the coordinate."""
+ the coordinate.
+ """
def __init__(self, x, y, text, halign, valign):
"""Initialize the label with the given parameters."""
@@ -41,7 +43,9 @@
"""This represent a layer holding a number of labels."""
def __init__(self, title):
- """Initialize the LabeleLayer with an empty
+ """Initialize the LabeleLayer.
+
+ Initialization is done with an empty
list of labels and set the title to "title".
"""
TitledObject.__init__(self, title)
@@ -78,8 +82,10 @@
self.changed(CHANGED)
def TreeInfo(self):
- """Return a tuple of (title, tupel) describing the contents
- of the object in a tree-structure.
+ """Return a description of the object.
+
+ A tuple of (title, tupel) describing the contents
+ of the object in a tree-structure is returned.
"""
items = []
items.append(_("Number of labels: %d") % len(self.labels))
More information about the Thuban-devel
mailing list
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)