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
9994410b
Commit
9994410b
authored
May 14, 1998
by
Jim Fulton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added machinery to avoid undoing transaction that started before the last pack.
parent
939998bd
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
7 deletions
+30
-7
lib/python/App/ApplicationManager.py
lib/python/App/ApplicationManager.py
+18
-3
lib/python/App/Undo.py
lib/python/App/Undo.py
+12
-4
No files found.
lib/python/App/ApplicationManager.py
View file @
9994410b
__doc__
=
"""System management components"""
__version__
=
'$Revision: 1.
29
$'
[
11
:
-
2
]
__version__
=
'$Revision: 1.
30
$'
[
11
:
-
2
]
import
sys
,
os
,
time
,
string
,
Globals
from
Globals
import
HTMLFile
from
OFS.ObjectManager
import
ObjectManager
from
CacheManager
import
CacheManager
from
OFS
import
SimpleItem
from
OFS
import
SimpleItem
,
Folder
from
App.Dialogs
import
MessageDialog
...
...
@@ -42,6 +42,11 @@ class ApplicationManager(ObjectManager,SimpleItem.Item,CacheManager):
manage_delProperties
=
None
isPrincipiaFolderish
=
0
def
__init__
(
self
):
self
.
Factories
=
f
=
Folder
.
Folder
()
f
.
id
=
'Factories'
f
.
title
=
'User-defined addable objects'
def
copyToClipboard
(
self
,
REQUEST
):
return
Globals
.
MessageDialog
(
title
=
'Not Supported'
,
message
=
'This item cannot be copied'
,
...
...
@@ -100,7 +105,17 @@ class ApplicationManager(ObjectManager,SimpleItem.Item,CacheManager):
raise
'Session Error'
,
(
'''You may not pack the application database while
working in a <em>session</em>'''
)
Globals
.
Bobobase
.
_jar
.
db
.
pack
(
time
.
time
()
-
days
*
86400
,
0
)
t
=
time
.
time
()
-
days
*
86400
if
Globals
.
Bobobase
.
has_key
(
'_pack_time'
):
since
=
Globals
.
Bobobase
[
'_pack_time'
]
if
t
<=
since
:
if
REQUEST
:
return
self
.
manage_main
(
self
,
REQUEST
)
return
Globals
.
Bobobase
[
'_pack_time'
]
=
t
get_transaction
().
note
(
''
)
get_transaction
().
commit
()
Globals
.
Bobobase
.
_jar
.
db
.
pack
(
t
,
0
)
if
REQUEST
:
return
self
.
manage_main
(
self
,
REQUEST
)
def
revert_points
(
self
):
return
()
...
...
lib/python/App/Undo.py
View file @
9994410b
...
...
@@ -11,8 +11,8 @@
__doc__
=
'''short description
$Id: Undo.py,v 1.
8 1998/01/12 17:58:39
jim Exp $'''
__version__
=
'$Revision: 1.
8
$'
[
11
:
-
2
]
$Id: Undo.py,v 1.
9 1998/05/14 23:21:38
jim Exp $'''
__version__
=
'$Revision: 1.
9
$'
[
11
:
-
2
]
import
Globals
from
DateTime
import
DateTime
...
...
@@ -67,8 +67,13 @@ class UndoSupport:
r
=
[]
add
=
r
.
append
h
=
[
''
,
''
]
try
:
trans_info
=
db
.
transaction_info
(
first_transaction
,
last_transaction
,
path
)
try
:
if
Globals
.
Bobobase
.
has_key
(
'_pack_time'
):
since
=
Globals
.
Bobobase
[
'_pack_time'
]
else
:
since
=
0
trans_info
=
db
.
transaction_info
(
first_transaction
,
last_transaction
,
path
,
since
=
since
)
except
:
trans_info
=
[]
for
info
in
trans_info
:
...
...
@@ -112,6 +117,9 @@ Globals.default__class_init__(UndoSupport)
##############################################################################
#
# $Log: Undo.py,v $
# Revision 1.9 1998/05/14 23:21:38 jim
# Added machinery to avoid undoing transaction that started before the last pack.
#
# Revision 1.8 1998/01/12 17:58:39 jim
# Additional changes to support supplying batch size as a parameter.
#
...
...
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