Author: jmorliaguet
Date: Sat May  6 17:29:26 2006
New Revision: 3056

Modified:
   cpsskins/branches/paris-sprint-2006/perspectives/configure.zcml
   cpsskins/branches/paris-sprint-2006/perspectives/perspective.py
   cpsskins/branches/paris-sprint-2006/profiles/default/__init__.py
   cpsskins/branches/paris-sprint-2006/profiles/default/color.xml
   cpsskins/branches/paris-sprint-2006/profiles/default/perspectives.xml
   cpsskins/branches/paris-sprint-2006/setup/README.txt
   cpsskins/branches/paris-sprint-2006/setup/registration.py

Log:

- fixed the import of file-system settings



Modified: cpsskins/branches/paris-sprint-2006/perspectives/configure.zcml
==============================================================================
--- cpsskins/branches/paris-sprint-2006/perspectives/configure.zcml     
(original)
+++ cpsskins/branches/paris-sprint-2006/perspectives/configure.zcml     Sat May 
 6 17:29:26 2006
@@ -55,5 +55,11 @@
       class=".perspective.Perspective"
   />
 
+  <utility
+      name="cpsskins.perspective"
+      component="cpsskins.perspectives.perspective.PerspectiveFactory"
+      provides="zope.component.interfaces.IFactory"
+  />
+
 
 </configure>

Modified: cpsskins/branches/paris-sprint-2006/perspectives/perspective.py
==============================================================================
--- cpsskins/branches/paris-sprint-2006/perspectives/perspective.py     
(original)
+++ cpsskins/branches/paris-sprint-2006/perspectives/perspective.py     Sat May 
 6 17:29:26 2006
@@ -20,6 +20,7 @@
 from xml.dom.minidom import parseString
 
 from zope.component import adapts
+from zope.component.factory import Factory
 from zope.interface import implements, implementedBy
 
 from cpsskins.perspectives.interfaces import IPerspective
@@ -48,6 +49,8 @@
     def __eq__(self, other):
         return str(self) == other
 
+PerspectiveFactory = Factory(Perspective)
+
 class Relatable(object):
     """This adapter makes perspectives relatable.
     """

Modified: cpsskins/branches/paris-sprint-2006/profiles/default/__init__.py
==============================================================================
--- cpsskins/branches/paris-sprint-2006/profiles/default/__init__.py    
(original)
+++ cpsskins/branches/paris-sprint-2006/profiles/default/__init__.py    Sat May 
 6 17:29:26 2006
@@ -19,8 +19,8 @@
 
 from cpsskins.setup.registration import registerSite, registerSettings
 
-#registerSite('cpsskins.profiles.default', 'site-2006-05-06-10.24.15.tgz')
+registerSite('cpsskins.profiles.default', 'site-2006-05-06-10.24.15.tgz')
 
-#registerSettings('cpsskins.profiles.default', 'perspectives.xml')
-#registerSettings('cpsskins.profiles.default', 'color.xml')
+registerSettings('cpsskins.profiles.default', 'perspectives.xml')
+registerSettings('cpsskins.profiles.default', 'color.xml')
 

Modified: cpsskins/branches/paris-sprint-2006/profiles/default/color.xml
==============================================================================
--- cpsskins/branches/paris-sprint-2006/profiles/default/color.xml      
(original)
+++ cpsskins/branches/paris-sprint-2006/profiles/default/color.xml      Sat May 
 6 17:29:26 2006
@@ -1,9 +1,9 @@
 <?xml version="1.0" encoding="utf-8" ?>
 <settings>
-  <setting name="redcolor" title="Red color" type="field-color">
+  <setting name="redcolor" title="Red color" type="cpsskins.field.color">
     <color value="#ff0000" />
   </setting>
-  <setting name="greencolor" title="Green color" type="field-color">
+  <setting name="greencolor" title="Green color" type="cpsskins.field.color">
     <color value="#00ff00" />
   </setting>
 </settings>

Modified: cpsskins/branches/paris-sprint-2006/profiles/default/perspectives.xml
==============================================================================
--- cpsskins/branches/paris-sprint-2006/profiles/default/perspectives.xml       
(original)
+++ cpsskins/branches/paris-sprint-2006/profiles/default/perspectives.xml       
Sat May  6 17:29:26 2006
@@ -1,9 +1,9 @@
 <?xml version="1.0" encoding="utf-8" ?>
 <settings>
-  <setting name="global" title="Global perspective" type="perspective">
+  <setting name="global" title="Global perspective" 
type="cpsskins.perspective">
     <perspective uri="cpsskins://perspective:global" title="Global 
perspective" />
   </setting>
-  <setting name="global2" title="Global perspective 2" type="perspective">
+  <setting name="global2" title="Global perspective 2" 
type="cpsskins.perspective">
     <perspective uri="cpsskins://perspective:global2" title="Global 
perspective 2" />
   </setting>
 </settings>

Modified: cpsskins/branches/paris-sprint-2006/setup/README.txt
==============================================================================
--- cpsskins/branches/paris-sprint-2006/setup/README.txt        (original)
+++ cpsskins/branches/paris-sprint-2006/setup/README.txt        Sat May  6 
17:29:26 2006
@@ -250,9 +250,9 @@
 Global settings can also be stored on the filesystem, they can be defined in
 XML and registered in python:
 
-    >>> from cpsskins.setup.registration import register, loadSettings
+    >>> from cpsskins.setup.registration import registerSettings, loadSettings
 
-    >>> register(u'cpsskins.setup.test', u'resource4.xml')
+    >>> registerSettings(u'cpsskins.setup.test', u'resource4.xml')
     >>> loadSettings()
 
     >>> resources.resolve(u'cpsskins://[EMAIL PROTECTED]')
@@ -494,7 +494,7 @@
     >>> from xml.dom.minidom import DOMImplementation
     >>> dom = DOMImplementation()
 
-    >>> from cpsskins.setup.interfaces import IDOMAdapter
+    >>> from cpsskins.setup.io.interfaces import IDOMAdapter
 
     >>> def toXML(obj, title=u'resources', attributes=(), ignored=(),
     ...           archive=None):

Modified: cpsskins/branches/paris-sprint-2006/setup/registration.py
==============================================================================
--- cpsskins/branches/paris-sprint-2006/setup/registration.py   (original)
+++ cpsskins/branches/paris-sprint-2006/setup/registration.py   Sat May  6 
17:29:26 2006
@@ -28,7 +28,8 @@
 from zope.component import getUtility, createObject, getMultiAdapter
 from zope.component import getGlobalSiteManager
 
-from cpsskins.setup.interfaces import IResourceManager, IResource, IDOMAdapter
+from cpsskins.setup.interfaces import IResourceManager, IResource
+from cpsskins.setup.io.interfaces import IDOMAdapter
 from cpsskins.setup.io.utils import importSite
 from cpsskins.thememanager import ThemeManagementFolder, IThemeManagementFolder
 
@@ -51,8 +52,8 @@
 
 def loadEvent(event):
     registerGlobalThemeManager()
-    loadSettings(settings_files)
-    loadSites(site_files)
+    loadSettings()
+    loadSites()
 
 def registerGlobalThemeManager():
     gsm = getGlobalSiteManager()
@@ -62,10 +63,10 @@
 
 ### Sites  ############################################################
 
-def loadSites(files):
+def loadSites():
     """Load all registered sites.
     """
-    for site_file in files:
+    for site_file in site_files:
         filename = site_file['filename']
         file = open(filename)
         importSite(file)
@@ -77,12 +78,12 @@
 def refreshSettingsEvent(event):
     refreshSettings()
 
-def loadSettings(files):
+def loadSettings():
     """Load all registered settings.
     """
     resources = getUtility(IResourceManager)
 
-    for file in files:
+    for file in settings_files:
         filename = file['filename']
         dom = parse(filename)
         for setting_def in dom.getElementsByTagName('setting'):
@@ -125,7 +126,7 @@
         logger.debug("reloaded setting %s in %s", name, filename)
 
     # load the data
-    getMultiAdapter(IDOMAdapter, (resource, resource_def)).load()
+    getMultiAdapter((resource, resource_def), IDOMAdapter).load()
     return resource
 
 def refreshSettings():
-- 
http://lists.nuxeo.com/mailman/listinfo/z3lab-checkins

Reply via email to