[CMF-checkins] CVS: CMF/CMFSetup - actions.py:1.13.2.3
properties.py:1.1.2.2 typeinfo.py:1.12.2.6
Yvo Schubbe
y.2005- at wcm-solutions.de
Sun Mar 13 11:22:56 EST 2005
Update of /cvs-repository/CMF/CMFSetup
In directory cvs.zope.org:/tmp/cvs-serv21829/CMFSetup
Modified Files:
Tag: CMF-1_5-branch
actions.py properties.py typeinfo.py
Log Message:
don't complain if there is nothing to import
=== CMF/CMFSetup/actions.py 1.13.2.2 => 1.13.2.3 ===
--- CMF/CMFSetup/actions.py:1.13.2.2 Wed Jan 12 05:56:50 2005
+++ CMF/CMFSetup/actions.py Sun Mar 13 11:22:55 2005
@@ -72,22 +72,22 @@
for provider_id in actions_tool.listActionProviders():
actions_tool.deleteActionProvider( provider_id )
- text = context.readDataFile( _FILENAME )
+ xml = context.readDataFile(_FILENAME)
+ if xml is None:
+ return 'Action providers: Nothing to import.'
- if text is not None:
+ apc = ActionProvidersConfigurator(site, encoding)
+ tool_info = apc.parseXML(xml)
- apc = ActionProvidersConfigurator( site, encoding )
- tool_info = apc.parseXML( text )
+ for p_info in tool_info['providers']:
- for p_info in tool_info[ 'providers' ]:
+ if p_info['id'] not in actions_tool.listActionProviders():
- if p_info[ 'id' ] not in actions_tool.listActionProviders():
+ actions_tool.addActionProvider(p_info['id'])
- actions_tool.addActionProvider( p_info[ 'id' ] )
-
- provider = getToolByName( site, p_info[ 'id' ] )
- provider._actions = [ ActionInformation(**a_info)
- for a_info in p_info[ 'actions' ] ]
+ provider = getToolByName(site, p_info['id'])
+ provider._actions = [ ActionInformation(**a_info)
+ for a_info in p_info[ 'actions' ] ]
return 'Action providers imported.'
=== CMF/CMFSetup/properties.py 1.1.2.1 => 1.1.2.2 ===
--- CMF/CMFSetup/properties.py:1.1.2.1 Fri Dec 17 12:49:40 2004
+++ CMF/CMFSetup/properties.py Sun Mar 13 11:22:55 2005
@@ -51,6 +51,9 @@
site._updateProperty(prop_id, prop_value)
xml = context.readDataFile(_FILENAME)
+ if xml is None:
+ return 'Site properties: Nothing to import.'
+
spc = SitePropertiesConfigurator(site, encoding)
site_info = spc.parseXML(xml)
=== CMF/CMFSetup/typeinfo.py 1.12.2.5 => 1.12.2.6 ===
--- CMF/CMFSetup/typeinfo.py:1.12.2.5 Thu Mar 10 09:46:09 2005
+++ CMF/CMFSetup/typeinfo.py Sun Mar 13 11:22:55 2005
@@ -52,9 +52,11 @@
types_tool._delObject(type)
ttc = TypesToolConfigurator( site, encoding )
- text = context.readDataFile( _TOOL_FILENAME )
- tool_info = ttc.parseXML( text )
+ xml = context.readDataFile( _TOOL_FILENAME )
+ if xml is None:
+ return 'Types tool: Nothing to import.'
+ tool_info = ttc.parseXML( xml )
tic = TypeInfoConfigurator( site, encoding )
for type_info in tool_info[ 'types' ]:
@@ -82,7 +84,7 @@
# importScriptsToContainer(types_tool, ('typestool_scripts',),
# context)
- return 'Type tool imported'
+ return 'Types tool imported.'
def exportTypesTool( context ):
More information about the CMF-checkins
mailing list