Commit fd4de8f4 authored by Andreas Jung's avatar Andreas Jung

merging Zope211-3.4-integration branch

parent 8de2ccb2
......@@ -4,6 +4,10 @@ Zope Changes
Change information for previous versions of Zope can be found in the
file HISTORY.txt.
Todo
- Fix ZClasses (once again)
Trunk (unreleased)
Restructuring
......@@ -51,6 +55,10 @@ Zope Changes
Features added
- integrated ZODB 3.8
- integraed Zope 3.4
- Support for using zopectl on Windows has been added. All commands are
supported and there are two Windows specific ones: install and remove,
which install or remove the Windows service. The start, stop and
......@@ -97,6 +105,7 @@ Zope Changes
Bugs Fixed
<<<<<<< .working
- Five.browser.metaconfigure.page didn't protect names from interface
superclasses (http://www.zope.org/Collectors/Zope/2333)
......@@ -139,6 +148,8 @@ Zope Changes
XML representation for that property to show a namespace of
xmlns="None". Fixed within OFS.PropertySheets.dav__propstat.
- integrated theuni's additional test from 2.11 (see r73132)
- Relaxed requirements for context of
Products.Five.browser.pagetemplatefile.ZopeTwoPageTemplateFile,
to reduce barriers for testing renderability of views which
......
<configure xmlns="http://namespaces.zope.org/zope">
<!-- Enable object event dispatcher -->
<include package="zope.app.event" />
<include package="zope.component" />
<!-- Adapter giving sublocations for ObjectManagers, used
by dispatchToSublocations -->
......
......@@ -34,7 +34,7 @@ An unprotected form can be accessed with anonymously:
>>> browser.open("http://localhost/test_folder_1_/ftf/+/addfieldcontent.html")
>>> 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:
......@@ -49,7 +49,7 @@ For a protected one we need a manager account:
>>> browser.addHeader('Authorization', 'Basic manager:r00t')
>>> browser.open("http://localhost/test_folder_1_/ftf/+/protectedaddform.html")
>>> 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:
>>> browser.open("http://localhost/test_folder_1_/ftf/edittest")
>>> print browser.headers
Status: 200 OK
Status: 200 ...
...
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:
>>> ctl.value = 'BarDescription'
>>> browser.getControl(name="UPDATE_SUBMIT").click()
>>> print browser.headers
Status: 200 OK
Status: 200 ...
...
>>> print browser.contents
<html>
......@@ -129,7 +129,7 @@ However, when we specify the correct fields:
>>> ctl.value = 'FooDescription'
>>> browser.getControl(name="UPDATE_SUBMIT").click()
>>> print browser.headers
Status: 200 OK
Status: 200 ...
...
We will see that something has changed:
......
......@@ -20,8 +20,8 @@
factory="zope.publisher.http.HTTPCharsets"
/>
<configure package="zope.app">
<i18n:registerTranslations directory="locales"/>
<configure package="zope.app.locales">
<i18n:registerTranslations directory="."/>
</configure>
</configure>
......@@ -75,20 +75,6 @@
</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
name="securityPolicy"
schema="zope.security.zcml.ISecurityPolicyDirective"
......
......@@ -51,7 +51,7 @@
<pre tal:content="python:'\n'.join(errors)">errors</pre>
</td>
</tr>
<!--
<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" style="background-color: #FFEEDD"
......@@ -59,7 +59,7 @@
<pre tal:content="python:'\n'.join(warnings)">errors</pre>
</td>
</tr>
-->
<tr>
<td align="left" valign="top" colspan="4"
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 @@
__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 BaseRequest import BaseRequest, quote
from HTTPResponse import HTTPResponse
......@@ -395,7 +395,7 @@ class HTTPRequest(BaseRequest):
taintedform=self.taintedform
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:
# Hm, maybe it's an XML-RPC
if (fs.headers.has_key('content-type') and
......@@ -1418,6 +1418,10 @@ def sane_environment(env):
except: pass
return dict
class ZopeFieldStorage(FieldStorage):
def make_file(self, binary=None):
return tempfile.NamedTemporaryFile("w+b")
class FileUpload:
'''\
......@@ -1443,7 +1447,7 @@ class FileUpload:
else: methods= ['close', 'fileno', 'flush', 'isatty',
'read', 'readline', 'readlines', 'seek',
'tell', 'truncate', 'write', 'writelines',
'__iter__','next'] # see Collector 1837
'__iter__','next', 'name'] # see Collector 1837
d=self.__dict__
for m in methods:
......
import unittest
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 ):
......@@ -684,6 +693,17 @@ class RequestTests( unittest.TestCase ):
req.close()
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):
# checks fileupload object supports the iterator protocol
# collector entry 1837
......
......@@ -56,7 +56,7 @@ class TemporaryStorageTests(
def doreadconflict(self, db, mvcc):
tm1 = transaction.TransactionManager()
conn = db.open(mvcc=mvcc, transaction_manager=tm1)
conn = db.open(transaction_manager=tm1)
r1 = conn.root()
obj = MinPO('root')
r1["p"] = obj
......@@ -66,7 +66,7 @@ class TemporaryStorageTests(
# start a new transaction with a new connection
tm2 = transaction.TransactionManager()
cn2 = db.open(mvcc=mvcc, transaction_manager=tm2)
cn2 = db.open(transaction_manager=tm2)
r2 = cn2.root()
self.assertEqual(r1._p_serial, r2._p_serial)
......@@ -85,10 +85,6 @@ class TemporaryStorageTests(
obj.child1
return obj
def checkWithoutMVCCRaisesReadConflict(self):
db = DB(self._storage)
self.assertRaises(ReadConflictError, self.doreadconflict, db, False)
def checkWithMVCCDoesntRaiseReadConflict(self):
db = DB(self._storage)
ob = self.doreadconflict(db, True)
......
......@@ -307,29 +307,6 @@ ext_modules = [
'ExtensionClass/pickle/pickle.c',
'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
Extension(name='DocumentTemplate.cDocumentTemplate',
......@@ -413,9 +390,6 @@ ext_modules = [
Extension(name = 'persistent.TimeStamp',
sources= ['persistent/TimeStamp.c']
),
Extension(name = 'ZODB.winlock',
sources = ['ZODB/winlock.c']
),
#zope
Extension("zope.proxy._zope_proxy_proxy",
......@@ -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.
doclines = __doc__.split("\n")
......@@ -509,16 +528,12 @@ setup(
"utilities/requestprofiler.py", "utilities/zpasswd.py",
"utilities/copyzopeskel.py", "utilities/reindex_catalog.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/fsrefs.py" , "utilities/ZODBTools/fstail.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/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"],
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