[CMF-checkins] CVS: CMF/CMFCore - ActionInformation.py:1.8
Tres Seaver
tseaver@zope.com
Wed, 3 Jul 2002 14:31:28 -0400
Update of /cvs-repository/CMF/CMFCore
In directory cvs.zope.org:/tmp/cvs-serv23492/CMFCore
Modified Files:
ActionInformation.py
Log Message:
- Removed unintentional sharing of ActionInformation data between
class defaults and persistent instances derived from
ActionProviderBase. Likewise for TypeInformation instances.
=== CMF/CMFCore/ActionInformation.py 1.7 => 1.8 ===
from OFS.SimpleItem import SimpleItem
+from Expression import Expression
from CMFCorePermissions import View
from CMFCorePermissions import ManagePortal
from utils import _dtmldir
@@ -49,18 +50,23 @@
, visible=1
, action=''
):
- """ Set up an instance.
- """
- self.id = id
- self.title = title
- self.description = description
- self.category = category
- self.condition = condition
- self.permissions = permissions
- self.priority = priority
- self.visible = visible
- self.action = action
+ """ Set up an instance.
+ """
+ if condition and type( condition ) == type( '' ):
+ condition = Expression( condition )
+
+ if action and type( action ) == type( '' ):
+ action = Expression( action )
+ self.id = id
+ self.title = title
+ self.description = description
+ self.category = category
+ self.condition = condition
+ self.permissions = permissions
+ self.priority = priority
+ self.visible = visible
+ self.action = action
security.declareProtected( View, 'Title' )
def Title(self):
@@ -147,11 +153,11 @@
, title=self.title
, description=self.description
, category =self.category
- , condition=self.condition
+ , condition=self.getCondition()
, permissions=self.permissions
, priority =self.priority
, visible=self.visible
- , action=self.action
+ , action=self.getActionExpression()
)
InitializeClass( ActionInformation )