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

Annotation of /branches/WIP-pyshapelib-bramz/Thuban/Model/base.py

Parent Directory Parent Directory | Revision Log Revision Log


Revision 240 - (hide annotations)
Wed Jul 24 17:16:09 2002 UTC (22 years, 7 months ago) by bh
Original Path: trunk/thuban/Thuban/Model/base.py
File MIME type: text/x-python
File size: 1383 byte(s)
(Modifiable.changed): Apply the args tuple,
don't pass it as a parameter

1 bh 127 # Copyright (c) 2001, 2002 by Intevation GmbH
2 bh 6 # Authors:
3     # Bernhard Herzog <[email protected]>
4     #
5     # This program is free software under the GPL (>=v2)
6     # Read the file COPYING coming with Thuban for details.
7    
8     """
9     Various base classes that didn't fir elsewhere
10     """
11    
12     __version__ = "$Revision$"
13    
14     from Thuban.Lib.connector import Publisher
15    
16     from messages import TITLE_CHANGED
17    
18     class TitledObject:
19    
20     """Mix-in class for objects that have titles"""
21    
22     def __init__(self, title):
23     self.title = title
24    
25     def Title(self):
26     return self.title
27    
28     def SetTitle(self, title):
29     self.title = title
30     self.issue(TITLE_CHANGED, self)
31    
32    
33     class Modifiable(Publisher):
34    
35     """Class for objects maintaining a modified flag."""
36    
37     def __init__(self):
38     self.modified = 0
39    
40     def WasModified(self):
41     """Return true if the layer was modified"""
42     return self.modified
43    
44     def UnsetModified(self):
45     """Unset the modified flag"""
46     self.modified = 0
47    
48     def changed(self, channel = None, *args):
49 bh 127 """Set the modified flag and issue a message
50    
51     The message is issued on the channel given by channel with args
52     as the arguments.
53    
54     Subclasses should call this method whenever anything has
55     changed.
56     """
57 bh 6 self.modified = 1
58     if channel is not None:
59 bh 240 self.issue(channel, *args)

Properties

Name Value
svn:eol-style native
svn:keywords Author Date Id Revision

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26