Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
Acquisition
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
Acquisition
Commits
8a77d12c
Commit
8a77d12c
authored
Mar 30, 2015
by
Tres Seaver
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'pypy-py3k' of
git://github.com/NextThought/Acquisition
into NextThought-pypy-py3k
parents
2667b34d
ba35cf6f
Changes
6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
1435 additions
and
100 deletions
+1435
-100
.travis.yml
.travis.yml
+2
-0
CHANGES.rst
CHANGES.rst
+7
-2
README.rst
README.rst
+7
-7
setup.py
setup.py
+24
-8
src/Acquisition/__init__.py
src/Acquisition/__init__.py
+830
-3
src/Acquisition/tests.py
src/Acquisition/tests.py
+565
-80
No files found.
.travis.yml
View file @
8a77d12c
...
...
@@ -3,6 +3,8 @@ sudo: false
python
:
-
2.6
-
2.7
-
3.4
-
pypy
install
:
-
python bootstrap.py
-
bin/buildout
...
...
CHANGES.rst
View file @
8a77d12c
Changelog
=========
4.2 (unreleased)
----------------
- Add support for PyPy and Python 3.
4.1 (2014-12-18)
----------------
...
...
@@ -62,7 +67,7 @@ Changelog
- Add ``aq_explicit`` to ``IAcquisitionWrapper``.
- Fixed bug: ``unicode(wrapped)`` was not calling a ``__unicode__``
- Fixed bug: ``unicode(wrapped)`` was not calling a ``__unicode__``
method on wrapped objects.
2.13.5 (2010-09-29)
...
...
@@ -133,7 +138,7 @@ Changelog
2.12.2 (2009-08-02)
-------------------
- Fixed 64-bit compatibility issues for Python 2.5.x / 2.6.x. See
- Fixed 64-bit compatibility issues for Python 2.5.x / 2.6.x. See
http://www.python.org/dev/peps/pep-0353/ for details.
2.12.1 (2009-04-15)
...
...
README.rst
View file @
8a77d12c
...
...
@@ -34,7 +34,7 @@ class. For example::
>>> class A(Acquisition.Implicit):
... def report(self):
... print
self.color
... print
(self.color)
...
>>> a = A()
>>> c = C()
...
...
@@ -107,7 +107,7 @@ When explicit acquisition is used, attributes are not automatically
obtained from the environment. Instead, the method aq_acquire must be
used. For example::
>>> print
c.a.aq_acquire('color'
)
>>> print
(c.a.aq_acquire('color')
)
red
To support explicit acquisition, your class should inherit from the
...
...
@@ -178,7 +178,7 @@ Here's an example::
>>> class E(Explicit, HandyForTesting): pass
...
>>> class Nice(HandyForTesting):
... isNice = 1
... isNice = 1
... def __str__(self):
... return HandyForTesting.__str__(self)+' and I am nice!'
... __repr__ = __str__
...
...
@@ -192,7 +192,7 @@ Here's an example::
>>> def find_nice(self, ancestor, name, object, extra):
... return hasattr(object,'isNice') and object.isNice
>>> print
a.b.c.aq_acquire('p', find_nice
)
>>> print
(a.b.c.aq_acquire('p', find_nice)
)
spam(Nice) and I am nice!
The filtered acquisition in the last line skips over the first
...
...
@@ -221,7 +221,7 @@ method. For example::
>>> a = C()
>>> b = C()
>>> a.color = "red"
>>> print
b.__of__(a).color
>>> print
(b.__of__(a).color)
red
In this case, ``a`` does not contain ``b``, but it is put in ``b``'s
...
...
@@ -241,7 +241,7 @@ acquisition context that includes non-container objects::
>>> a.b.color = "red"
>>> a.x = C("x")
>>> print
a.b.x.color
>>> print
(a.b.x.color)
red
Even though ``b`` does not contain ``x``, ``x`` can acquire the color
...
...
@@ -262,7 +262,7 @@ If in the example above suppose both a and b have an color attribute::
>>> a.b.color = "red"
>>> a.x = C("x")
>>> print
a.b.x.color
>>> print
(a.b.x.color)
green
Why does ``a.b.x.color`` acquire color from ``a`` and not from ``b``?
...
...
setup.py
View file @
8a77d12c
...
...
@@ -14,6 +14,8 @@
"""Setup for the Acquisition distribution
"""
import
os
import
platform
import
sys
from
setuptools
import
setup
,
find_packages
,
Extension
with
open
(
'README.rst'
)
as
f
:
...
...
@@ -22,9 +24,24 @@ with open('README.rst') as f:
with
open
(
'CHANGES.rst'
)
as
f
:
CHANGES
=
f
.
read
()
# PyPy won't build the extension.
py_impl
=
getattr
(
platform
,
'python_implementation'
,
lambda
:
None
)
is_pypy
=
py_impl
()
==
'PyPy'
is_pure
=
'PURE_PYTHON'
in
os
.
environ
py3k
=
sys
.
version_info
>=
(
3
,
)
if
is_pypy
or
is_pure
or
py3k
:
ext_modules
=
[]
else
:
ext_modules
=
[
Extension
(
"Acquisition._Acquisition"
,
[
os
.
path
.
join
(
'src'
,
'Acquisition'
,
'_Acquisition.c'
)],
include_dirs
=
[
'include'
,
'src'
]),
]
setup
(
name
=
'Acquisition'
,
version
=
'4.
1
'
,
version
=
'4.
2.dev0
'
,
url
=
'https://github.com/zopefoundation/Acquisition'
,
license
=
'ZPL 2.1'
,
description
=
"Acquisition is a mechanism that allows objects to obtain "
...
...
@@ -41,18 +58,17 @@ setup(
"License :: OSI Approved :: Zope Public License"
,
"Operating System :: OS Independent"
,
"Programming Language :: Python"
,
"Programming Language :: Python :: 2
:: Only
"
,
"Programming Language :: Python :: 2"
,
"Programming Language :: Python :: 2.6"
,
"Programming Language :: Python :: 2.7"
,
"Programming Language :: Python :: 3"
,
"Programming Language :: Python :: 3.4"
,
"Programming Language :: Python :: Implementation :: CPython"
,
"Programming Language :: Python :: Implementation :: PyPy"
,
],
ext_modules
=
[
Extension
(
"Acquisition._Acquisition"
,
[
os
.
path
.
join
(
'src'
,
'Acquisition'
,
'_Acquisition.c'
)],
include_dirs
=
[
'include'
,
'src'
]),
],
ext_modules
=
ext_modules
,
install_requires
=
[
'ExtensionClass >= 4.1
a
1'
,
'ExtensionClass >= 4.1
.
1'
,
'zope.interface'
,
],
include_package_data
=
True
,
...
...
src/Acquisition/__init__.py
View file @
8a77d12c
This diff is collapsed.
Click to expand it.
src/Acquisition/tests.py
View file @
8a77d12c
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment