[CMF-checkins] CVS: CMF/CMFSetup - PROFILES.txt:1.1.2.2
actions.py:1.13.2.5 typeinfo.py:1.12.2.8
Yvo Schubbe
y.2005- at wcm-solutions.de
Wed Apr 13 09:05:32 EDT 2005
Update of /cvs-repository/CMF/CMFSetup
In directory cvs.zope.org:/tmp/cvs-serv14280/CMFSetup
Modified Files:
Tag: CMF-1_5-branch
PROFILES.txt actions.py typeinfo.py
Log Message:
more improvements for extension profiles:
- implemented 'remove' for action providers
- refactored typeinfo imports to allow modifying existing typeinfos (doesn't work for single type actions)
=== CMF/CMFSetup/PROFILES.txt 1.1.2.1 => 1.1.2.2 ===
--- CMF/CMFSetup/PROFILES.txt:1.1.2.1 Mon Apr 11 07:32:31 2005
+++ CMF/CMFSetup/PROFILES.txt Wed Apr 13 09:05:01 2005
@@ -32,3 +32,9 @@
applies to: skin-path (skins.xml)
Updates all existing items in the container with the same settings.
+
+ 'remove'
+
+ applies to: action-provider (actions.xml)
+
+ Removes the specified item if it exists.
=== CMF/CMFSetup/actions.py 1.13.2.4 => 1.13.2.5 ===
--- CMF/CMFSetup/actions.py:1.13.2.4 Mon Apr 11 07:32:31 2005
+++ CMF/CMFSetup/actions.py Wed Apr 13 09:05:01 2005
@@ -81,6 +81,11 @@
for p_info in tool_info['providers']:
+ if 'remove' in p_info:
+ if p_info['id'] in actions_tool.listActionProviders():
+ actions_tool.deleteActionProvider(p_info['id'])
+ continue
+
if p_info['id'] not in actions_tool.listActionProviders():
actions_tool.addActionProvider(p_info['id'])
@@ -169,6 +174,7 @@
{ 'action-provider': {KEY: 'providers', DEFAULT: ()} },
'action-provider':
{ 'id': {},
+ 'remove': {},
'action': {KEY: 'actions', DEFAULT: ()} },
'action':
{ 'action_id': {KEY: 'id'},
=== CMF/CMFSetup/typeinfo.py 1.12.2.7 => 1.12.2.8 ===
--- CMF/CMFSetup/typeinfo.py:1.12.2.7 Sun Apr 3 16:20:20 2005
+++ CMF/CMFSetup/typeinfo.py Wed Apr 13 09:05:01 2005
@@ -67,16 +67,38 @@
text = context.readDataFile( filename[sep+1:], filename[:sep] )
info = tic.parseXML( text )
- klass_info = [ x for x in typeClasses
- if x[ 'name' ] == info[ 'kind' ] ][ 0 ]
-
- type_info = klass_info[ 'class' ]( **info )
+ type_id = str(info['id'])
+ if 'kind' in info:
+ klass_info = [ x for x in typeClasses
+ if x[ 'name' ] == info[ 'kind' ] ][ 0 ]
+
+ type_info = klass_info['class'](type_id)
+
+ if type_id in types_tool.objectIds():
+ types_tool._delObject(type_id)
+
+ types_tool._setObject(type_id, type_info)
+ type_info = types_tool._getOb(type_id)
+ type_info._updateProperty('title', info['id'])
+ type_info._updateProperty('content_meta_type', info['id'])
+ type_info._updateProperty('content_icon', '%s.png' % info['id'])
+ type_info._updateProperty('immediate_view',
+ '%s_edit' % info['id'])
+ else:
+ type_info = types_tool._getOb(type_id)
- if info['id'] in types_tool.objectIds():
- types_tool._delObject(info['id'])
+ type_info.manage_changeProperties(**info)
- types_tool._setObject( str( info[ 'id' ] ), type_info )
+ if 'actions' in info:
+ type_info._actions = info['actions']
+ if 'aliases' in info:
+ if not getattr(type_info, '_aliases', False):
+ aliases = info['aliases']
+ else:
+ aliases = type_info.getMethodAliases()
+ aliases.update(info['aliases'])
+ type_info.setMethodAliases(aliases)
# XXX: YAGNI?
# importScriptsToContainer(types_tool, ('typestool_scripts',),
@@ -236,18 +258,15 @@
'type-info':
{ 'id': {},
'kind': {},
- 'title': {DEFAULT: '%(id)s'},
+ 'title': {},
'description': {CONVERTER: self._convertToUnique},
- 'meta_type': {DEFAULT: '%(id)s'},
- 'icon': {DEFAULT: '%(id)s.png'},
- 'immediate_view': {DEFAULT: '%(id)s_edit'},
- 'global_allow': {DEFAULT: True,
- CONVERTER: self._convertToBoolean},
- 'filter_content_types': {DEFAULT: False,
- CONVERTER: self._convertToBoolean},
+ 'meta_type': {KEY: 'content_meta_type'},
+ 'icon': {KEY: 'content_icon'},
+ 'immediate_view': {},
+ 'global_allow': {CONVERTER: self._convertToBoolean},
+ 'filter_content_types': {CONVERTER: self._convertToBoolean},
'allowed_content_type': {KEY: 'allowed_content_types'},
- 'allow_discussion': {DEFAULT: False,
- CONVERTER: self._convertToBoolean},
+ 'allow_discussion': {CONVERTER: self._convertToBoolean},
'aliases': {CONVERTER: self._convertAliases},
'action': {KEY: 'actions'},
'product': {},
More information about the CMF-checkins
mailing list