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
41c8944d
Commit
41c8944d
authored
Aug 14, 2016
by
Hanno Schlichting
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Drop ZopeUndo dependency and move undo management to the control panel.
parent
c4c1b4ac
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
15 additions
and
89 deletions
+15
-89
CHANGES.rst
CHANGES.rst
+2
-0
buildout.cfg
buildout.cfg
+0
-1
setup.py
setup.py
+0
-1
sources.cfg
sources.cfg
+1
-1
src/App/ApplicationManager.py
src/App/ApplicationManager.py
+4
-3
src/App/Undo.py
src/App/Undo.py
+5
-37
src/App/dtml/undo.dtml
src/App/dtml/undo.dtml
+0
-1
src/App/interfaces.py
src/App/interfaces.py
+0
-22
src/App/tests/testUndo.py
src/App/tests/testUndo.py
+0
-11
src/OFS/SimpleItem.py
src/OFS/SimpleItem.py
+1
-9
src/OFS/interfaces.py
src/OFS/interfaces.py
+1
-2
versions-prod.cfg
versions-prod.cfg
+1
-1
No files found.
CHANGES.rst
View file @
41c8944d
...
...
@@ -28,6 +28,8 @@ Features Added
Restructuring
+++++++++++++
- Drop ZopeUndo dependency and move undo management to the control panel.
- Simplify ZMI control panel and globally available management screens.
- Move ZServer related testing support into ZServer.Testing.
...
...
buildout.cfg
View file @
41c8944d
...
...
@@ -64,7 +64,6 @@ eggs =
# tests with DateTime being available
RestrictedPython
zExceptions
ZopeUndo
# Test optional dependencies.
Missing
Products.BTreeFolder2
...
...
setup.py
View file @
41c8944d
...
...
@@ -61,7 +61,6 @@ setup(
'RestrictedPython'
,
'ZConfig >= 2.9.2'
,
'ZODB'
,
'ZopeUndo'
,
'five.globalrequest'
,
'repoze.retry'
,
'setuptools'
,
...
...
sources.cfg
View file @
41c8944d
...
...
@@ -15,7 +15,6 @@ MultiMapping = git ${remotes:github}/MultiMapping pushurl=${remotes:github_push}
Persistence = git ${remotes:github}/Persistence pushurl=${remotes:github_push}/Persistence
zExceptions = git ${remotes:github}/zExceptions pushurl=${remotes:github_push}/zExceptions
zope.globalrequest = git ${remotes:github}/zope.globalrequest pushurl=${remotes:github_push}/zope.globalrequest
ZopeUndo = git ${remotes:github}/ZopeUndo pushurl=${remotes:github_push}/ZopeUndo
# Optional dependencies
initgroups = git ${remotes:github}/initgroups pushurl=${remotes:github_push}/initgroups
...
...
@@ -33,6 +32,7 @@ Products.ZCTextIndex = git ${remotes:github}/Products.ZCTextIndex pushurl=${remo
Record = git ${remotes:github}/Record pushurl=${remotes:github_push}/Record
tempstorage = git ${remotes:github}/tempstorage pushurl=${remotes:github_push}/tempstorage
zLOG = git ${remotes:github}/zLOG pushurl=${remotes:github_push}/zLOG
ZopeUndo = git ${remotes:github}/ZopeUndo pushurl=${remotes:github_push}/ZopeUndo
ZServer = git ${remotes:github}/ZServer pushurl=${remotes:github_push}/ZServer
# ZTK
...
...
src/App/ApplicationManager.py
View file @
41c8944d
...
...
@@ -21,6 +21,7 @@ from Acquisition import Implicit
from
App.config
import
getConfiguration
from
App.Management
import
Tabs
from
App.special_dtml
import
DTMLFile
from
App.Undo
import
UndoSupport
from
App.version_txt
import
version_txt
from
OFS.Traversable
import
Traversable
from
Products.PageTemplates.PageTemplateFile
import
PageTemplateFile
...
...
@@ -123,7 +124,7 @@ class ApplicationManager(Tabs, Traversable, Implicit):
return
getConfiguration
().
clienthome
class
AltDatabaseManager
(
T
abs
,
Implici
t
):
class
AltDatabaseManager
(
T
raversable
,
UndoSuppor
t
):
""" Database management DBTab-style
"""
id
=
'DatabaseManagement'
...
...
@@ -132,11 +133,11 @@ class AltDatabaseManager(Tabs, Implicit):
manage
=
manage_main
=
DTMLFile
(
'dtml/dbMain'
,
globals
())
manage_main
.
_setName
(
'manage_main'
)
manage_options
=
(
(
manage_options
=
(
{
'label'
:
'Control Panel'
,
'action'
:
'../../manage_main'
},
{
'label'
:
'Databases'
,
'action'
:
'../manage_main'
},
{
'label'
:
'Database'
,
'action'
:
'manage_main'
},
)
)
)
+
UndoSupport
.
manage_options
MANAGE_TABS_NO_BANNER
=
True
def
_getDB
(
self
):
...
...
src/App/Undo.py
View file @
41c8944d
...
...
@@ -15,24 +15,18 @@
import
binascii
from
Acquisition
import
aq_inner
from
Acquisition
import
aq_parent
from
AccessControl
import
getSecurityManager
from
Acquisition
import
Implicit
from
AccessControl
import
ClassSecurityInfo
from
AccessControl.class_init
import
InitializeClass
from
AccessControl.Permissions
import
undo_changes
from
App.interfaces
import
IUndoSupport
from
App.special_dtml
import
DTMLFile
from
DateTime.DateTime
import
DateTime
import
ExtensionClass
import
transaction
from
ZopeUndo.Prefix
import
Prefix
from
zope.interface
import
implements
from
App.Management
import
Tabs
from
App.special_dtml
import
DTMLFile
class
UndoSupport
(
ExtensionClass
.
Base
):
implements
(
IUndoSupport
)
class
UndoSupport
(
Tabs
,
Implicit
):
security
=
ClassSecurityInfo
()
...
...
@@ -85,33 +79,7 @@ class UndoSupport(ExtensionClass.Base):
'last_transaction'
,
first_transaction
+
PrincipiaUndoBatchSize
)
spec
=
{}
# A user is allowed to undo transactions that were initiated
# by any member of a user folder in the place where the user
# is defined.
user
=
getSecurityManager
().
getUser
()
user_parent
=
aq_parent
(
user
)
if
user_parent
is
not
None
:
path
=
'/'
.
join
(
user_parent
.
getPhysicalPath
()[
1
:
-
1
])
else
:
path
=
''
if
path
:
spec
[
'user_name'
]
=
Prefix
(
path
)
if
getattr
(
aq_parent
(
aq_inner
(
self
)),
'_p_jar'
,
None
)
==
self
.
_p_jar
:
# We only want to undo things done here (and not in mounted
# databases)
opath
=
'/'
.
join
(
self
.
getPhysicalPath
())
else
:
# Special case: at the root of a database,
# allow undo of any path.
opath
=
None
if
opath
:
spec
[
'description'
]
=
Prefix
(
opath
)
r
=
self
.
_p_jar
.
db
().
undoInfo
(
first_transaction
,
last_transaction
,
spec
)
r
=
self
.
_p_jar
.
db
().
undoInfo
(
first_transaction
,
last_transaction
)
for
d
in
r
:
d
[
'time'
]
=
t
=
DateTime
(
d
[
'time'
])
...
...
src/App/dtml/undo.dtml
View file @
41c8944d
...
...
@@ -22,7 +22,6 @@ modified objects that were modified by a selected transaction.
<dtml-call "REQUEST.set('first_transaction', _.None)">
</dtml-unless>
<a name="t_list" />
<table width="100%" cellspacing="0" cellpadding="2" border="0">
<tr class="list-header">
<td align="left" valign="top">
...
...
src/App/interfaces.py
View file @
41c8944d
...
...
@@ -17,11 +17,7 @@ from zope.interface import Attribute
from
zope.interface
import
Interface
# XXX: might contain non-API methods and outdated comments;
# not synced with ZopeBook API Reference;
# based on App.Management.Navigation
class
INavigation
(
Interface
):
"""Basic navigation UI support"""
manage
=
Attribute
(
""" """
)
...
...
@@ -34,21 +30,3 @@ class INavigation(Interface):
"""Logout current user"""
INavigation
.
setTaggedValue
(
'manage_page_style.css'
,
Attribute
(
""" """
))
# XXX: might contain non-API methods and outdated comments;
# not synced with ZopeBook API Reference;
# based on App.Undo.UndoSupport
class
IUndoSupport
(
Interface
):
manage_UndoForm
=
Attribute
(
"""Manage Undo form"""
)
def
undoable_transactions
(
first_transaction
=
None
,
last_transaction
=
None
,
PrincipiaUndoBatchSize
=
None
):
"""
"""
def
manage_undo_transactions
(
transaction_info
=
(),
REQUEST
=
None
):
"""
"""
src/App/tests/testUndo.py
deleted
100644 → 0
View file @
c4c1b4ac
import
unittest
class
TestUndoSupport
(
unittest
.
TestCase
):
def
test_interfaces
(
self
):
from
App.interfaces
import
IUndoSupport
from
App.Undo
import
UndoSupport
from
zope.interface.verify
import
verifyClass
verifyClass
(
IUndoSupport
,
UndoSupport
)
src/OFS/SimpleItem.py
View file @
41c8944d
...
...
@@ -40,7 +40,6 @@ from Acquisition import Implicit
from
App.Management
import
Tabs
from
App.special_dtml
import
HTML
from
App.special_dtml
import
DTMLFile
from
App.Undo
import
UndoSupport
from
ComputedAttribute
import
ComputedAttribute
from
DateTime
import
DateTime
from
DocumentTemplate.html_quote
import
html_quote
...
...
@@ -75,9 +74,7 @@ class Item(Base,
CopySource
,
Tabs
,
Traversable
,
Owned
,
UndoSupport
,
):
Owned
):
"""A common base class for simple, non-container objects."""
implements
(
IItem
)
...
...
@@ -126,11 +123,6 @@ class Item(Base,
# Default propertysheet info:
__propsets__
=
()
manage_options
=
(
UndoSupport
.
manage_options
+
Owned
.
manage_options
)
# Attributes that must be acquired
REQUEST
=
Acquired
...
...
src/OFS/interfaces.py
View file @
41c8944d
...
...
@@ -25,7 +25,6 @@ from AccessControl.interfaces import IOwned
from
AccessControl.interfaces
import
IRoleManager
from
Acquisition.interfaces
import
IAcquirer
from
App.interfaces
import
INavigation
from
App.interfaces
import
IUndoSupport
from
persistent.interfaces
import
IPersistent
...
...
@@ -522,7 +521,7 @@ class ILockItem(Interface):
# not synced with ZopeBook API Reference;
# based on OFS.SimpleItem.Item
class
IItem
(
IZopeObject
,
IManageable
,
IFTPAccess
,
ICopySource
,
ITraversable
,
IOwned
,
IUndoSupport
):
ICopySource
,
ITraversable
,
IOwned
):
__name__
=
BytesLine
(
title
=
u"Name"
...
...
versions-prod.cfg
View file @
41c8944d
...
...
@@ -45,6 +45,7 @@ zExceptions = 3.3
zLOG = 3.0
ZODB = 4.4.2
zodbpickle = 0.6.0
ZopeUndo = 4.1
zope.annotation = 4.4.1
zope.browser = 2.1.0
zope.browsermenu = 4.1.1
...
...
@@ -90,5 +91,4 @@ zope.testing = 4.5.0
zope.testrunner = 4.5.1
zope.traversing = 4.0.0
zope.viewlet = 4.0.0
ZopeUndo = 4.1
ZServer =
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