Create site extension profile and add dependencies
Stefan Bund [Tue, 20 Oct 2009 17:22:06 +0000 (19:22 +0200)]
src/koehsel.policy/koehsel.policy.egg-info/SOURCES.txt
src/koehsel.policy/koehsel/policy/configure.zcml
src/koehsel.policy/koehsel/policy/profiles/default/README.txt [new file with mode: 0644]
src/koehsel.policy/koehsel/policy/profiles/default/metadata.xml [new file with mode: 0644]
src/koehsel.policy/koehsel/policy/setuphandlers.py [new file with mode: 0644]

index d27dbe8..06f823e 100644 (file)
@@ -12,4 +12,5 @@ koehsel.policy.egg-info/paster_plugins.txt
 koehsel.policy.egg-info/requires.txt
 koehsel.policy.egg-info/top_level.txt
 koehsel/policy/__init__.py
+koehsel/policy/setuphandlers.py
 koehsel/policy/tests.py
\ No newline at end of file
index 600a528..56160c0 100644 (file)
@@ -1,8 +1,24 @@
 <configure
     xmlns="http://namespaces.zope.org/zope"
     xmlns:five="http://namespaces.zope.org/five"
+    xmlns:genericsetup="http://namespaces.zope.org/genericsetup"
     i18n_domain="koehsel.policy">
 
   <five:registerPackage package="." initialize=".initialize" />
 
+  <genericsetup:registerProfile
+      name="default"
+      title="Koehsel Site"
+      directory="profiles/default"
+      description='Extension profile for the Koehsel Site.'
+      provides="Products.GenericSetup.interfaces.EXTENSION"
+      />
+
+  <genericsetup:importStep
+      name="koehsel.policy.various"
+      title="Koehsel Theme: miscellaneous import steps"
+      description="Various import steps that are not handled by GS import/export handlers."
+      handler="koehsel.policy.setuphandlers.setupVarious">
+  </genericsetup:importStep>
+
 </configure>
diff --git a/src/koehsel.policy/koehsel/policy/profiles/default/README.txt b/src/koehsel.policy/koehsel/policy/profiles/default/README.txt
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/src/koehsel.policy/koehsel/policy/profiles/default/metadata.xml b/src/koehsel.policy/koehsel/policy/profiles/default/metadata.xml
new file mode 100644 (file)
index 0000000..ade50ca
--- /dev/null
@@ -0,0 +1,8 @@
+<?xml version="1.0"?>
+<metadata>
+  <version>1</version>
+  <dependencies>
+    <dependency>profile-easyshop.core:default</dependency>
+    <dependency>profile-koehsel.theme:default</dependency>
+  </dependencies>
+</metadata>
diff --git a/src/koehsel.policy/koehsel/policy/setuphandlers.py b/src/koehsel.policy/koehsel/policy/setuphandlers.py
new file mode 100644 (file)
index 0000000..5140789
--- /dev/null
@@ -0,0 +1,11 @@
+def setupVarious(context):
+
+    # Ordinarily, GenericSetup handlers check for the existence of XML files.
+    # Here, we are not parsing an XML file, but we use this text file as a
+    # flag to check that we actually meant for this import step to be run.
+    # The file is found in profiles/default.
+
+    if context.readDataFile('koehsel.theme_various.txt') is None:
+        return
+
+    # Add additional setup code here