Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
Zope
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
Zope
Commits
a84477cc
Commit
a84477cc
authored
Nov 18, 1998
by
Jim Fulton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
*** empty log message ***
parent
656beed4
Changes
8
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
285 additions
and
672 deletions
+285
-672
lib/Components/ExtensionClass/doc/Acquisition.stx
lib/Components/ExtensionClass/doc/Acquisition.stx
+6
-2
lib/Components/ExtensionClass/doc/ExtensionClass.stx
lib/Components/ExtensionClass/doc/ExtensionClass.stx
+134
-668
lib/Components/ExtensionClass/release.fl
lib/Components/ExtensionClass/release.fl
+10
-1
lib/Components/ExtensionClass/src/release.sh
lib/Components/ExtensionClass/src/release.sh
+4
-1
lib/Components/ExtensionClass/test/test_MultiMapping.py
lib/Components/ExtensionClass/test/test_MultiMapping.py
+22
-0
lib/Components/ExtensionClass/test/test_Sync.py
lib/Components/ExtensionClass/test/test_Sync.py
+36
-0
lib/Components/ExtensionClass/test/test_ThreadLock.py
lib/Components/ExtensionClass/test/test_ThreadLock.py
+54
-0
lib/Components/ExtensionClass/test/test_acquisition.py
lib/Components/ExtensionClass/test/test_acquisition.py
+19
-0
No files found.
lib/Components/ExtensionClass/doc/Acquisition.stx
View file @
a84477cc
...
...
@@ -53,8 +53,8 @@ Acquisition
cannot be found in 'a'.
Aquisition wrappers provide access to the wrapped objects
through the attributes 'aq_parent'
and 'aq_self'. In the
example above, the expressions::
through the attributes 'aq_parent'
, 'aq_self', 'aq_base'.
In the
example above, the expressions::
'c.a.aq_parent is c'
...
...
@@ -69,6 +69,10 @@ Acquisition
evaluates to false, because the expression 'c.a' evaluates
to an acquisition wrapper around 'c' and 'a', not 'a' itself.
The attribute 'aq_base' is similar to 'aq_self'. Wrappers may be
nested and 'aq_self' may be a wrapped object. The 'aq_base'
attribute is the underlying object with all wrappers removed.
Acquisition Control
Two styles of acquisition are supported in the current
...
...
lib/Components/ExtensionClass/doc/ExtensionClass.stx
View file @
a84477cc
This diff is collapsed.
Click to expand it.
lib/Components/ExtensionClass/release.fl
View file @
a84477cc
ExtensionClass.stx
ExtensionClass.html
Installation
Installation.html
Acquisition.stx
Acquisition.html
MultiMapping.stx
MultiMapping.html
release.notes
release.html
README
Makefile.pre.in
Makefile.pre.in-1.4
Makefile.pre.in-1.5
Setup
ExtensionClass.c
ExtensionClass.h
...
...
lib/Components/ExtensionClass/src/release.sh
View file @
a84477cc
...
...
@@ -6,5 +6,8 @@ M=ExtensionClass
StructuredText <
$M
.stx
>
$M
.html
rm
-rf
"
$M
-
$R
"
mkdir
"
$M
-
$R
"
tar
-c
-R
release.fl
-f
- |
(
cd
"
$M
-
$R
"
;
tar
xvf -
)
for
f
in
`
cat
release.fl
`
;
do
cp
$f
"
$M
-
$R
/"
done
tar
cvf -
"
$M
-
$R
"
|
gzip
>
"
$M
-
$R
.tar.gz"
lib/Components/ExtensionClass/test/test_MultiMapping.py
0 → 100644
View file @
a84477cc
from
MultiMapping
import
*
m
=
MultiMapping
()
m
.
push
({
'spam'
:
1
,
'eggs'
:
2
})
print
m
[
'spam'
]
print
m
[
'eggs'
]
m
.
push
({
'spam'
:
3
})
print
m
[
'spam'
]
print
m
[
'eggs'
]
print
m
.
pop
()
print
m
.
pop
()
try
:
print
m
.
pop
()
raise
"That
\
'
s odd"
,
"This last pop should have failed!"
except
:
# I should probably raise a specific error in this case.
pass
lib/Components/ExtensionClass/test/test_Sync.py
0 → 100644
View file @
a84477cc
from
Sync
import
Synchronized
import
thread
from
rand
import
rand
from
time
import
sleep
class
P
(
Synchronized
):
def
__init__
(
self
,
*
args
,
**
kw
):
self
.
count
=
0
def
inc
(
self
):
c
=
self
.
count
sleep
(
rand
()
/
327680.0
)
self
.
count
=
self
.
count
+
1
return
c
,
self
.
count
def
incn
(
self
,
n
):
c
=
self
.
count
for
i
in
range
(
n
):
self
.
inc
()
return
c
,
self
.
count
p
=
P
(
1
,
2
,
spam
=
3
)
def
test
():
for
i
in
range
(
10
):
n
=
3
old
,
new
=
p
.
incn
(
n
)
print
old
,
new
if
old
+
n
!=
new
:
print
'oops'
for
i
in
range
(
10
):
thread
.
start_new_thread
(
test
,())
sleep
(
50
)
lib/Components/ExtensionClass/test/test_ThreadLock.py
0 → 100644
View file @
a84477cc
import
ThreadLock
,
thread
from
rand
import
rand
from
time
import
sleep
from
ExtensionClass
import
Base
with_lock
=
1
class
P
(
Base
):
def
__oldcall_method__
(
self
,
f
,
a
,
k
=
{}):
if
with_lock
:
try
:
lock
=
self
.
lock
except
AttributeError
:
return
apply
(
f
,
a
,
k
)
else
:
return
apply
(
f
,
a
,
k
)
try
:
lock
.
acquire
()
return
apply
(
f
,
a
,
k
)
finally
:
lock
.
release
()
__call_method__
=
apply
def
__init__
(
self
,
*
args
,
**
kw
):
self
.
count
=
0
if
with_lock
:
self
.
lock
=
lock
=
ThreadLock
.
allocate_lock
()
self
.
__call_method__
=
lock
.
guarded_apply
def
inc
(
self
):
c
=
self
.
count
sleep
(
rand
()
/
32768.0
)
self
.
count
=
self
.
count
+
1
return
c
,
self
.
count
def
incn
(
self
,
n
):
c
=
self
.
count
for
i
in
range
(
n
):
self
.
inc
()
return
c
,
self
.
count
p
=
P
(
1
,
2
,
spam
=
3
)
def
test
():
for
i
in
range
(
10
):
n
=
3
old
,
new
=
p
.
incn
(
n
)
print
old
,
new
if
old
+
n
!=
new
:
print
'oops'
for
i
in
range
(
10
):
thread
.
start_new_thread
(
test
,())
sleep
(
50
)
lib/Components/ExtensionClass/test/test_acquisition.py
0 → 100644
View file @
a84477cc
from
ExtensionClass
import
Base
import
Acquisition
class
B
(
Base
):
color
=
'red'
class
A
(
Acquisition
.
Implicit
):
def
hi
(
self
):
print
self
,
self
.
color
b
=
B
()
b
.
a
=
A
()
b
.
a
.
hi
()
b
.
a
.
color
=
'green'
b
.
a
.
hi
()
try
:
A
().
hi
()
raise
'Program error'
,
'spam'
except
AttributeError
:
pass
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