[Checkins] SVN: zc.sourcefactory/trunk/ - added bootstrap
Christian Theune
ct at gocept.com
Sun May 6 05:02:17 EDT 2007
Log message for revision 75520:
- added bootstrap
- added compatibility for Zope 3.2 and Five 1.3
Changed:
A zc.sourcefactory/trunk/bootstrap.py
A zc.sourcefactory/trunk/src/zc/sourcefactory/configure-z2.zcml
U zc.sourcefactory/trunk/src/zc/sourcefactory/policies.py
-=-
Added: zc.sourcefactory/trunk/bootstrap.py
===================================================================
--- zc.sourcefactory/trunk/bootstrap.py 2007-05-06 09:01:33 UTC (rev 75519)
+++ zc.sourcefactory/trunk/bootstrap.py 2007-05-06 09:02:17 UTC (rev 75520)
@@ -0,0 +1,52 @@
+##############################################################################
+#
+# Copyright (c) 2006 Zope Corporation and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+"""Bootstrap a buildout-based project
+
+Simply run this script in a directory containing a buildout.cfg.
+The script accepts buildout command-line options, so you can
+use the -c option to specify an alternate configuration file.
+
+$Id: bootstrap.py 72703 2007-02-20 11:49:26Z jim $
+"""
+
+import os, shutil, sys, tempfile, urllib2
+
+tmpeggs = tempfile.mkdtemp()
+
+ez = {}
+exec urllib2.urlopen('http://peak.telecommunity.com/dist/ez_setup.py'
+ ).read() in ez
+ez['use_setuptools'](to_dir=tmpeggs, download_delay=0)
+
+import pkg_resources
+
+cmd = 'from setuptools.command.easy_install import main; main()'
+if sys.platform == 'win32':
+ cmd = '"%s"' % cmd # work around spawn lamosity on windows
+
+ws = pkg_resources.working_set
+assert os.spawnle(
+ os.P_WAIT, sys.executable, sys.executable,
+ '-c', cmd, '-mqNxd', tmpeggs, 'zc.buildout',
+ dict(os.environ,
+ PYTHONPATH=
+ ws.find(pkg_resources.Requirement.parse('setuptools')).location
+ ),
+ ) == 0
+
+ws.add_entry(tmpeggs)
+ws.require('zc.buildout')
+import zc.buildout.buildout
+zc.buildout.buildout.main(sys.argv[1:] + ['bootstrap'])
+shutil.rmtree(tmpeggs)
Property changes on: zc.sourcefactory/trunk/bootstrap.py
___________________________________________________________________
Name: svn:eol-style
+ native
Added: zc.sourcefactory/trunk/src/zc/sourcefactory/configure-z2.zcml
===================================================================
--- zc.sourcefactory/trunk/src/zc/sourcefactory/configure-z2.zcml 2007-05-06 09:01:33 UTC (rev 75519)
+++ zc.sourcefactory/trunk/src/zc/sourcefactory/configure-z2.zcml 2007-05-06 09:02:17 UTC (rev 75520)
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="utf-8"?>
+<configure
+ xmlns="http://namespaces.zope.org/zope"
+ >
+ <!-- Configuration for usage with Zope 2/Five -->
+
+ <class class=".source.FactoredSource">
+ <require
+ interface=".interfaces.IFactoredSource"
+ permission="zope2.View"
+ />
+ </class>
+
+ <class class=".source.FactoredContextualSource">
+ <require
+ interface=".interfaces.IContextualSource"
+ permission="zope2.View"
+ />
+ </class>
+
+ <adapter factory=".adapters.getSourceQueriables"/>
+
+ <include package=".browser"/>
+
+</configure>
Modified: zc.sourcefactory/trunk/src/zc/sourcefactory/policies.py
===================================================================
--- zc.sourcefactory/trunk/src/zc/sourcefactory/policies.py 2007-05-06 09:01:33 UTC (rev 75519)
+++ zc.sourcefactory/trunk/src/zc/sourcefactory/policies.py 2007-05-06 09:02:17 UTC (rev 75520)
@@ -19,7 +19,11 @@
import zope.app.intid.interfaces
import zope.component
-import zope.dublincore.interfaces
+try:
+ from zope.dublincore import interfaces as dublincoreinterfaces
+except ImportError:
+ # XXX Need to support Zope 3.2
+ from zope.app.dublincore import interfaces as dublincoreinterfaces
import zc.sourcefactory.browser.source
import zc.sourcefactory.interfaces
@@ -44,7 +48,7 @@
def getTitle(self, value):
try:
- md = zope.dublincore.interfaces.IDCDescriptiveProperties(value)
+ md = dublincoreinterfaces.IDCDescriptiveProperties(value)
except TypeError:
md = None
More information about the Checkins
mailing list