Commit fd4de8f4 authored by Andreas Jung's avatar Andreas Jung

merging Zope211-3.4-integration branch

parent 8de2ccb2
...@@ -4,6 +4,10 @@ Zope Changes ...@@ -4,6 +4,10 @@ Zope Changes
Change information for previous versions of Zope can be found in the Change information for previous versions of Zope can be found in the
file HISTORY.txt. file HISTORY.txt.
Todo
- Fix ZClasses (once again)
Trunk (unreleased) Trunk (unreleased)
Restructuring Restructuring
...@@ -51,6 +55,10 @@ Zope Changes ...@@ -51,6 +55,10 @@ Zope Changes
Features added Features added
- integrated ZODB 3.8
- integraed Zope 3.4
- Support for using zopectl on Windows has been added. All commands are - Support for using zopectl on Windows has been added. All commands are
supported and there are two Windows specific ones: install and remove, supported and there are two Windows specific ones: install and remove,
which install or remove the Windows service. The start, stop and which install or remove the Windows service. The start, stop and
...@@ -97,6 +105,7 @@ Zope Changes ...@@ -97,6 +105,7 @@ Zope Changes
Bugs Fixed Bugs Fixed
<<<<<<< .working
- Five.browser.metaconfigure.page didn't protect names from interface - Five.browser.metaconfigure.page didn't protect names from interface
superclasses (http://www.zope.org/Collectors/Zope/2333) superclasses (http://www.zope.org/Collectors/Zope/2333)
...@@ -139,6 +148,8 @@ Zope Changes ...@@ -139,6 +148,8 @@ Zope Changes
XML representation for that property to show a namespace of XML representation for that property to show a namespace of
xmlns="None". Fixed within OFS.PropertySheets.dav__propstat. xmlns="None". Fixed within OFS.PropertySheets.dav__propstat.
- integrated theuni's additional test from 2.11 (see r73132)
- Relaxed requirements for context of - Relaxed requirements for context of
Products.Five.browser.pagetemplatefile.ZopeTwoPageTemplateFile, Products.Five.browser.pagetemplatefile.ZopeTwoPageTemplateFile,
to reduce barriers for testing renderability of views which to reduce barriers for testing renderability of views which
......
<configure xmlns="http://namespaces.zope.org/zope"> <configure xmlns="http://namespaces.zope.org/zope">
<!-- Enable object event dispatcher --> <!-- Enable object event dispatcher -->
<include package="zope.app.event" /> <include package="zope.component" />
<!-- Adapter giving sublocations for ObjectManagers, used <!-- Adapter giving sublocations for ObjectManagers, used
by dispatchToSublocations --> by dispatchToSublocations -->
......
...@@ -34,7 +34,7 @@ An unprotected form can be accessed with anonymously: ...@@ -34,7 +34,7 @@ An unprotected form can be accessed with anonymously:
>>> browser.open("http://localhost/test_folder_1_/ftf/+/addfieldcontent.html") >>> browser.open("http://localhost/test_folder_1_/ftf/+/addfieldcontent.html")
>>> print browser.headers >>> print browser.headers
Status: 200 OK Status: 200 ...
... ...
We don't have access, we will not be able to get to the protected add form: We don't have access, we will not be able to get to the protected add form:
...@@ -49,7 +49,7 @@ For a protected one we need a manager account: ...@@ -49,7 +49,7 @@ For a protected one we need a manager account:
>>> browser.addHeader('Authorization', 'Basic manager:r00t') >>> browser.addHeader('Authorization', 'Basic manager:r00t')
>>> browser.open("http://localhost/test_folder_1_/ftf/+/protectedaddform.html") >>> browser.open("http://localhost/test_folder_1_/ftf/+/protectedaddform.html")
>>> print browser.headers >>> print browser.headers
Status: 200 OK Status: 200 ...
... ...
...@@ -66,7 +66,7 @@ Having added this piece of content, we can access it under its URL: ...@@ -66,7 +66,7 @@ Having added this piece of content, we can access it under its URL:
>>> browser.open("http://localhost/test_folder_1_/ftf/edittest") >>> browser.open("http://localhost/test_folder_1_/ftf/edittest")
>>> print browser.headers >>> print browser.headers
Status: 200 OK Status: 200 ...
... ...
We can also verify that the title was set correctly, and the not We can also verify that the title was set correctly, and the not
...@@ -104,7 +104,7 @@ Therefore, if we specify invalid data, our object won't change: ...@@ -104,7 +104,7 @@ Therefore, if we specify invalid data, our object won't change:
>>> ctl.value = 'BarDescription' >>> ctl.value = 'BarDescription'
>>> browser.getControl(name="UPDATE_SUBMIT").click() >>> browser.getControl(name="UPDATE_SUBMIT").click()
>>> print browser.headers >>> print browser.headers
Status: 200 OK Status: 200 ...
... ...
>>> print browser.contents >>> print browser.contents
<html> <html>
...@@ -129,7 +129,7 @@ However, when we specify the correct fields: ...@@ -129,7 +129,7 @@ However, when we specify the correct fields:
>>> ctl.value = 'FooDescription' >>> ctl.value = 'FooDescription'
>>> browser.getControl(name="UPDATE_SUBMIT").click() >>> browser.getControl(name="UPDATE_SUBMIT").click()
>>> print browser.headers >>> print browser.headers
Status: 200 OK Status: 200 ...
... ...
We will see that something has changed: We will see that something has changed:
......
...@@ -20,8 +20,8 @@ ...@@ -20,8 +20,8 @@
factory="zope.publisher.http.HTTPCharsets" factory="zope.publisher.http.HTTPCharsets"
/> />
<configure package="zope.app"> <configure package="zope.app.locales">
<i18n:registerTranslations directory="locales"/> <i18n:registerTranslations directory="."/>
</configure> </configure>
</configure> </configure>
...@@ -75,20 +75,6 @@ ...@@ -75,20 +75,6 @@
</meta:complexDirective> </meta:complexDirective>
<!-- BBB 2006/02/24, to be removed after 12 months -->
<meta:directive
name="vocabulary"
schema="zope.app.schema.metadirectives.IVocabularyDirective"
handler="zope.app.schema.metaconfigure.vocabulary"
/>
<!-- BBB 2006/02/24, to be removed after 12 months -->
<meta:directive
name="defaultLayer"
schema="zope.app.component.metadirectives.IDefaultLayerDirective"
handler="zope.app.component.metaconfigure.defaultLayer"
/>
<meta:directive <meta:directive
name="securityPolicy" name="securityPolicy"
schema="zope.security.zcml.ISecurityPolicyDirective" schema="zope.security.zcml.ISecurityPolicyDirective"
......
...@@ -51,7 +51,7 @@ ...@@ -51,7 +51,7 @@
<pre tal:content="python:'\n'.join(errors)">errors</pre> <pre tal:content="python:'\n'.join(errors)">errors</pre>
</td> </td>
</tr> </tr>
<!--
<tr tal:define="warnings context/pt_warnings" tal:condition="warnings"> <tr tal:define="warnings context/pt_warnings" tal:condition="warnings">
<td align="left" valign="middle" class="form-label">Warnings</td> <td align="left" valign="middle" class="form-label">Warnings</td>
<td align="left" valign="middle" style="background-color: #FFEEDD" <td align="left" valign="middle" style="background-color: #FFEEDD"
...@@ -59,7 +59,7 @@ ...@@ -59,7 +59,7 @@
<pre tal:content="python:'\n'.join(warnings)">errors</pre> <pre tal:content="python:'\n'.join(warnings)">errors</pre>
</td> </td>
</tr> </tr>
-->
<tr> <tr>
<td align="left" valign="top" colspan="4" <td align="left" valign="top" colspan="4"
tal:define="width request/dtpref_cols | string:100%; tal:define="width request/dtpref_cols | string:100%;
......
##############################################################################
#
# Copyright (c) 2001, 2002 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
#
##############################################################################
import os
from unittest import TestCase, TestSuite, makeSuite
from ZODB.POSException import ConflictError
from ZODB.FileStorage import FileStorage
from ZODB.DB import DB
import transaction
from Products.Transience.Transience import Length2, Increaser
# Test pattern is copied from BTrees/tests/testConflict.py
class Base(TestCase):
storage = None
def setUp(self):
pass
def tearDown(self):
transaction.abort()
if self.storage is not None:
self.storage.close()
self.storage.cleanup()
def openDB(self):
n = 'fs_tmp__%s' % os.getpid()
self.storage = FileStorage(n)
self.db = DB(self.storage)
class TestLength2(Base):
def testConflict(self):
# Set up database connections to provoke conflict.
self.openDB()
length = Length2(0)
r1 = self.db.open().root()
r1['ob'] = length
transaction.commit()
r2 = self.db.open(synch=False).root()
copy = r2['ob']
# The following ensures that copy is loaded.
self.assertEqual(copy(),0)
# First transaction.
length.increment(10)
length.decrement(1)
transaction.commit()
# Second transaction.
length = copy
length.increment(20)
length.decrement(2)
transaction.commit()
self.assertEqual(length(), 10+20-max(1,2))
class TestIncreaser(Base):
def testConflict(self):
# Set up database connections to provoke conflict.
self.openDB()
increaser = Increaser(0)
r1 = self.db.open().root()
r1['ob'] = increaser
transaction.commit()
r2 = self.db.open(synch=False).root()
copy = r2['ob']
# The following ensures that copy is loaded.
self.assertEqual(copy(),0)
# First transaction.
increaser.set(10)
transaction.commit()
# Second transaction.
increaser = copy
increaser.set(20)
transaction.commit()
self.assertEqual(increaser(), 20)
def test_suite():
suite = TestSuite()
suite.addTest(makeSuite(TestLength2))
suite.addTest(makeSuite(TestIncreaser))
return suite
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
__version__='$Revision: 1.96 $'[11:-2] __version__='$Revision: 1.96 $'[11:-2]
import re, sys, os, time, random, codecs, inspect import re, sys, os, time, random, codecs, inspect, tempfile
from types import StringType, UnicodeType from types import StringType, UnicodeType
from BaseRequest import BaseRequest, quote from BaseRequest import BaseRequest, quote
from HTTPResponse import HTTPResponse from HTTPResponse import HTTPResponse
...@@ -395,7 +395,7 @@ class HTTPRequest(BaseRequest): ...@@ -395,7 +395,7 @@ class HTTPRequest(BaseRequest):
taintedform=self.taintedform taintedform=self.taintedform
meth=None meth=None
fs=FieldStorage(fp=fp,environ=environ,keep_blank_values=1) fs=ZopeFieldStorage(fp=fp,environ=environ,keep_blank_values=1)
if not hasattr(fs,'list') or fs.list is None: if not hasattr(fs,'list') or fs.list is None:
# Hm, maybe it's an XML-RPC # Hm, maybe it's an XML-RPC
if (fs.headers.has_key('content-type') and if (fs.headers.has_key('content-type') and
...@@ -1418,6 +1418,10 @@ def sane_environment(env): ...@@ -1418,6 +1418,10 @@ def sane_environment(env):
except: pass except: pass
return dict return dict
class ZopeFieldStorage(FieldStorage):
def make_file(self, binary=None):
return tempfile.NamedTemporaryFile("w+b")
class FileUpload: class FileUpload:
'''\ '''\
...@@ -1443,7 +1447,7 @@ class FileUpload: ...@@ -1443,7 +1447,7 @@ class FileUpload:
else: methods= ['close', 'fileno', 'flush', 'isatty', else: methods= ['close', 'fileno', 'flush', 'isatty',
'read', 'readline', 'readlines', 'seek', 'read', 'readline', 'readlines', 'seek',
'tell', 'truncate', 'write', 'writelines', 'tell', 'truncate', 'write', 'writelines',
'__iter__','next'] # see Collector 1837 '__iter__','next', 'name'] # see Collector 1837
d=self.__dict__ d=self.__dict__
for m in methods: for m in methods:
......
import unittest import unittest
from urllib import quote_plus from urllib import quote_plus
TEST_LARGEFILE_DATA = '''
--12345
Content-Disposition: form-data; name="file"; filename="file"
Content-Type: application/octet-stream
test %s
''' % ('test' * 1000)
class AuthCredentialsTests( unittest.TestCase ): class AuthCredentialsTests( unittest.TestCase ):
def _getTargetClass(self): def _getTargetClass(self):
...@@ -684,6 +693,17 @@ class RequestTests( unittest.TestCase ): ...@@ -684,6 +693,17 @@ class RequestTests( unittest.TestCase ):
req.close() req.close()
self.assertEqual(start_count, sys.getrefcount(s)) # The test self.assertEqual(start_count, sys.getrefcount(s)) # The test
def testFileName(self):
# checks fileupload object supports the filename
from StringIO import StringIO
s = StringIO(TEST_LARGEFILE_DATA)
env = TEST_ENVIRON.copy()
from ZPublisher.HTTPRequest import HTTPRequest
req = HTTPRequest(s, env, None)
req.processInputs()
f = req.form.get('file')
self.assert_(f.name)
def testFileIterator(self): def testFileIterator(self):
# checks fileupload object supports the iterator protocol # checks fileupload object supports the iterator protocol
# collector entry 1837 # collector entry 1837
......
...@@ -56,7 +56,7 @@ class TemporaryStorageTests( ...@@ -56,7 +56,7 @@ class TemporaryStorageTests(
def doreadconflict(self, db, mvcc): def doreadconflict(self, db, mvcc):
tm1 = transaction.TransactionManager() tm1 = transaction.TransactionManager()
conn = db.open(mvcc=mvcc, transaction_manager=tm1) conn = db.open(transaction_manager=tm1)
r1 = conn.root() r1 = conn.root()
obj = MinPO('root') obj = MinPO('root')
r1["p"] = obj r1["p"] = obj
...@@ -66,7 +66,7 @@ class TemporaryStorageTests( ...@@ -66,7 +66,7 @@ class TemporaryStorageTests(
# start a new transaction with a new connection # start a new transaction with a new connection
tm2 = transaction.TransactionManager() tm2 = transaction.TransactionManager()
cn2 = db.open(mvcc=mvcc, transaction_manager=tm2) cn2 = db.open(transaction_manager=tm2)
r2 = cn2.root() r2 = cn2.root()
self.assertEqual(r1._p_serial, r2._p_serial) self.assertEqual(r1._p_serial, r2._p_serial)
...@@ -85,10 +85,6 @@ class TemporaryStorageTests( ...@@ -85,10 +85,6 @@ class TemporaryStorageTests(
obj.child1 obj.child1
return obj return obj
def checkWithoutMVCCRaisesReadConflict(self):
db = DB(self._storage)
self.assertRaises(ReadConflictError, self.doreadconflict, db, False)
def checkWithMVCCDoesntRaiseReadConflict(self): def checkWithMVCCDoesntRaiseReadConflict(self):
db = DB(self._storage) db = DB(self._storage)
ob = self.doreadconflict(db, True) ob = self.doreadconflict(db, True)
......
...@@ -307,29 +307,6 @@ ext_modules = [ ...@@ -307,29 +307,6 @@ ext_modules = [
'ExtensionClass/pickle/pickle.c', 'ExtensionClass/pickle/pickle.c',
'Acquisition/Acquisition.h']), 'Acquisition/Acquisition.h']),
# BTrees
Extension(name='BTrees._OOBTree',
include_dirs=EXTENSIONCLASS_INCLUDEDIRS+['persistent'],
sources=['BTrees/_OOBTree.c']),
Extension(name='BTrees._OIBTree',
include_dirs=EXTENSIONCLASS_INCLUDEDIRS+['persistent'],
sources=['BTrees/_OIBTree.c']),
Extension(name='BTrees._IIBTree',
include_dirs=EXTENSIONCLASS_INCLUDEDIRS+['persistent'],
define_macros=[('EXCLUDE_INTSET_SUPPORT', None)],
sources=['BTrees/_IIBTree.c']),
Extension(name='BTrees._IOBTree',
include_dirs=EXTENSIONCLASS_INCLUDEDIRS+['persistent'],
define_macros=[('EXCLUDE_INTSET_SUPPORT', None)],
sources=['BTrees/_IOBTree.c']),
Extension(name='BTrees._IFBTree',
include_dirs=EXTENSIONCLASS_INCLUDEDIRS+['persistent'],
define_macros=[('EXCLUDE_INTSET_SUPPORT', None)],
sources=['BTrees/_IFBTree.c']),
Extension(name='BTrees._fsBTree',
include_dirs=EXTENSIONCLASS_INCLUDEDIRS+['persistent'],
define_macros=[('EXCLUDE_INTSET_SUPPORT', None)],
sources=['BTrees/_fsBTree.c']),
# DocumentTemplate # DocumentTemplate
Extension(name='DocumentTemplate.cDocumentTemplate', Extension(name='DocumentTemplate.cDocumentTemplate',
...@@ -413,9 +390,6 @@ ext_modules = [ ...@@ -413,9 +390,6 @@ ext_modules = [
Extension(name = 'persistent.TimeStamp', Extension(name = 'persistent.TimeStamp',
sources= ['persistent/TimeStamp.c'] sources= ['persistent/TimeStamp.c']
), ),
Extension(name = 'ZODB.winlock',
sources = ['ZODB/winlock.c']
),
#zope #zope
Extension("zope.proxy._zope_proxy_proxy", Extension("zope.proxy._zope_proxy_proxy",
...@@ -457,6 +431,51 @@ ext_modules = [ ...@@ -457,6 +431,51 @@ ext_modules = [
] ]
# BTree extension modules (code borrowed from ZODB/setup.py)
# Include directories for C extensions
include = ['.']
# Set up dependencies for the BTrees package
base_btrees_depends = [
"BTrees/BTreeItemsTemplate.c",
"BTrees/BTreeModuleTemplate.c",
"BTrees/BTreeTemplate.c",
"BTrees/BucketTemplate.c",
"BTrees/MergeTemplate.c",
"BTrees/SetOpTemplate.c",
"BTrees/SetTemplate.c",
"BTrees/TreeSetTemplate.c",
"BTrees/sorters.c",
"persistent/cPersistence.h",
]
_flavors = {"O": "object", "I": "int", "F": "float", 'L': 'int'}
KEY_H = "BTrees/%skeymacros.h"
VALUE_H = "BTrees/%svaluemacros.h"
def BTreeExtension(flavor):
key = flavor[0]
value = flavor[1]
name = "BTrees._%sBTree" % flavor
sources = ["BTrees/_%sBTree.c" % flavor]
kwargs = {"include_dirs": include}
if flavor != "fs":
kwargs["depends"] = (base_btrees_depends + [KEY_H % _flavors[key],
VALUE_H % _flavors[value]])
else:
kwargs["depends"] = base_btrees_depends
if key != "O":
kwargs["define_macros"] = [('EXCLUDE_INTSET_SUPPORT', None)]
return Extension(name, sources, **kwargs)
ext_modules += [BTreeExtension(flavor)
for flavor in ("OO", "IO", "OI", "II", "IF",
"fs", "LO", "OL", "LL", "LF",
)]
# We're using the module docstring as the distutils descriptions. # We're using the module docstring as the distutils descriptions.
doclines = __doc__.split("\n") doclines = __doc__.split("\n")
...@@ -509,16 +528,12 @@ setup( ...@@ -509,16 +528,12 @@ setup(
"utilities/requestprofiler.py", "utilities/zpasswd.py", "utilities/requestprofiler.py", "utilities/zpasswd.py",
"utilities/copyzopeskel.py", "utilities/reindex_catalog.py", "utilities/copyzopeskel.py", "utilities/reindex_catalog.py",
"utilities/compilezpy.py", "utilities/decompilezpy.py", "utilities/compilezpy.py", "utilities/decompilezpy.py",
"utilities/ZODBTools/timeout.py", "utilities/ZODBTools/analyze.py", "utilities/ZODBTools/analyze.py",
"utilities/ZODBTools/checkbtrees.py", "utilities/ZODBTools/fsdump.py", "utilities/ZODBTools/checkbtrees.py", "utilities/ZODBTools/fsdump.py",
"utilities/ZODBTools/fsrefs.py" , "utilities/ZODBTools/fstail.py", "utilities/ZODBTools/fsrefs.py" , "utilities/ZODBTools/fstail.py",
"utilities/ZODBTools/fstest.py", "utilities/ZODBTools/migrate.py", "utilities/ZODBTools/fstest.py", "utilities/ZODBTools/migrate.py",
"utilities/ZODBTools/netspace.py", "utilities/ZODBTools/parsezeolog.py", "utilities/ZODBTools/netspace.py", "utilities/ZODBTools/zodbload.py",
"utilities/ZODBTools/repozo.py", "utilities/ZODBTools/space.py", "utilities/ZODBTools/repozo.py", "utilities/ZODBTools/space.py",
"utilities/ZODBTools/timeout.py", "utilities/ZODBTools/zeopack.py",
"utilities/ZODBTools/zeoqueue.py", "utilities/ZODBTools/zeoreplay.py",
"utilities/ZODBTools/zeoserverlog.py", "utilities/ZODBTools/zeoup.py",
"utilities/ZODBTools/zodbload.py",
"test.py"], "test.py"],
distclass=ZopeDistribution, distclass=ZopeDistribution,
) )
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment