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
67a8e6fa
Commit
67a8e6fa
authored
Apr 05, 2010
by
Hanno Schlichting
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Merged r110504 from 2.12 branch
parent
6ff963e8
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
3 additions
and
122 deletions
+3
-122
buildout.cfg
buildout.cfg
+1
-0
setup.py
setup.py
+1
-0
src/ZopeUndo/Prefix.py
src/ZopeUndo/Prefix.py
+0
-50
src/ZopeUndo/__init__.py
src/ZopeUndo/__init__.py
+0
-13
src/ZopeUndo/tests/__init__.py
src/ZopeUndo/tests/__init__.py
+0
-13
src/ZopeUndo/tests/testPrefix.py
src/ZopeUndo/tests/testPrefix.py
+0
-46
versions.cfg
versions.cfg
+1
-0
No files found.
buildout.cfg
View file @
67a8e6fa
...
...
@@ -45,6 +45,7 @@ eggs =
ThreadLock
initgroups
tempstorage
ZopeUndo
zope.browser
zope.browsermenu
zope.browserpage
...
...
setup.py
View file @
67a8e6fa
...
...
@@ -70,6 +70,7 @@ setup(name='Zope2',
'ThreadLock'
,
'ZConfig'
,
'ZODB3'
,
'ZopeUndo'
,
'docutils'
,
'initgroups'
,
'pytz'
,
...
...
src/ZopeUndo/Prefix.py
deleted
100644 → 0
View file @
6ff963e8
##############################################################################
#
# Copyright (c) 2001, 2002 Zope Foundation 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
#
##############################################################################
"""ZODB undo support for Zope2.
This package is used to support the Prefix object that Zope uses for
undo. It is a separate package only to aid configuration management.
This package is included in Zope and ZODB3, so that ZODB3 is suitable
for running a ZEO server that handles Zope undo.
"""
class
Prefix
:
"""A Prefix() is equal to any path it is a prefix of.
This class can be compared to a string.
The comparison will return True if all path elements of the
Prefix are found at the beginning of the string being compared.
Two Prefixes can not be compared.
"""
__no_side_effects__
=
1
def
__init__
(
self
,
path
):
path_list
=
path
.
split
(
'/'
)
self
.
length
=
len
(
path_list
)
self
.
path
=
path_list
def
__cmp__
(
self
,
o
):
other_path
=
o
.
split
(
'/'
)
if
other_path
and
' '
in
other_path
[
-
1
]:
# don't include logged username in comparison
pos
=
other_path
[
-
1
].
rfind
(
' '
)
other_path
[
-
1
]
=
other_path
[
-
1
][:
pos
]
return
cmp
(
other_path
[:
self
.
length
],
self
.
path
)
def
__repr__
(
self
):
# makes failing tests easier to read
return
"Prefix('%s')"
%
'/'
.
join
(
self
.
path
)
src/ZopeUndo/__init__.py
deleted
100644 → 0
View file @
6ff963e8
##############################################################################
#
# Copyright (c) 2001, 2002 Zope Foundation 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
#
##############################################################################
src/ZopeUndo/tests/__init__.py
deleted
100644 → 0
View file @
6ff963e8
##############################################################################
#
# Copyright (c) 2001, 2002 Zope Foundation 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
#
##############################################################################
src/ZopeUndo/tests/testPrefix.py
deleted
100644 → 0
View file @
6ff963e8
##############################################################################
#
# Copyright (c) 2001, 2002 Zope Foundation 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
#
##############################################################################
from
ZopeUndo.Prefix
import
Prefix
import
unittest
class
PrefixTest
(
unittest
.
TestCase
):
def
test
(
self
):
p1
=
Prefix
(
"/a/b"
)
for
equal
in
(
"/a/b"
,
"/a/b/c"
,
"/a/b/c/d"
):
self
.
assertEqual
(
p1
,
equal
)
for
notEqual
in
(
""
,
"/a/c"
,
"/a/bbb"
,
"///"
):
self
.
assertNotEqual
(
p1
,
notEqual
)
p2
=
Prefix
(
""
)
for
equal
in
(
""
,
"/"
,
"/def"
,
"/a/b"
,
"/a/b/c"
,
"/a/b/c/d"
):
self
.
assertEqual
(
p2
,
equal
)
def
test_username_info
(
self
):
# Zope Collector 1810; user paths have username appended
p1
=
Prefix
(
'/a/b'
)
for
equal
in
(
'/a/b spam'
,
'/a/b/c spam'
,
'/a/b/c/b spam'
):
self
.
assertEqual
(
p1
,
equal
)
for
notEqual
in
(
" spam"
,
"/a/c spam"
,
"/a/bbb spam"
,
"/// spam"
):
self
.
assertNotEqual
(
p1
,
notEqual
)
p2
=
Prefix
(
""
)
for
equal
in
(
" eggs"
,
"/ eggs"
,
"/def eggs"
,
"/a/b eggs"
,
"/a/b/c eggs"
,
"/a/b/c/d eggs"
):
self
.
assertEqual
(
p2
,
equal
)
def
test_suite
():
return
unittest
.
makeSuite
(
PrefixTest
)
versions.cfg
View file @
67a8e6fa
...
...
@@ -33,6 +33,7 @@ zc.recipe.testrunner = 1.2.0
ZConfig = 2.7.1
zdaemon = 2.0.4
ZODB3 = 3.9.4
ZopeUndo = 2.12.0
zope.annotation = 3.5.0
zope.broken = 3.6.0
zope.browser = 1.2
...
...
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