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
2b79103c
Commit
2b79103c
authored
Jul 16, 2004
by
Andreas Jung
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added logging of subtransaction commits
parent
5a285eb4
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
4 deletions
+12
-4
lib/python/Products/ZCatalog/ProgressHandler.py
lib/python/Products/ZCatalog/ProgressHandler.py
+6
-0
lib/python/Products/ZCatalog/ZCatalog.py
lib/python/Products/ZCatalog/ZCatalog.py
+6
-4
No files found.
lib/python/Products/ZCatalog/ProgressHandler.py
View file @
2b79103c
...
...
@@ -32,6 +32,9 @@ class IProgressHandler(Interface):
'max' -- maximum number of objects to be processed (int)
"""
def
info
(
text
):
""" Log some 'text'"""
def
finish
():
""" Called up termination """
...
...
@@ -61,6 +64,9 @@ class StdoutHandler:
self
.
fp
=
sys
.
stdout
self
.
output
(
'Process started (%d objects to go)'
%
self
.
_max
)
def
info
(
self
,
text
):
self
.
output
(
text
)
def
finish
(
self
):
self
.
output
(
'Process terminated. Duration: %0.2f seconds'
%
\
(
time
.
time
()
-
self
.
_start
))
...
...
lib/python/Products/ZCatalog/ZCatalog.py
View file @
2b79103c
...
...
@@ -289,7 +289,7 @@ class ZCatalog(Folder, Persistent, Implicit):
obj
=
self
.
resolve_url
(
p
,
self
.
REQUEST
)
if
obj
is
not
None
:
try
:
self
.
catalog_object
(
obj
,
p
)
self
.
catalog_object
(
obj
,
p
,
pghandler
=
pghandler
)
except
ConflictError
:
raise
except
:
...
...
@@ -491,7 +491,7 @@ class ZCatalog(Folder, Persistent, Implicit):
# index via the UI
try
:
self
.
catalog_object
(
obj
,
p
,
idxs
=
name
,
update_metadata
=
0
)
update_metadata
=
0
,
pghandler
=
pghandler
)
except
TypeError
:
# Fall back to Zope 2.6.2 interface. This is necessary for
# products like CMF 1.4.2 and earlier that subclass from
...
...
@@ -501,7 +501,7 @@ class ZCatalog(Folder, Persistent, Implicit):
warn
(
'catalog_object interface of %s not up to date'
%
self
.
__class__
.
__name__
,
DeprecationWarning
)
self
.
catalog_object
(
obj
,
p
,
idxs
=
name
)
self
.
catalog_object
(
obj
,
p
,
idxs
=
name
,
pghandler
=
pghandler
)
if
pghandler
:
pghandler
.
finish
()
...
...
@@ -530,7 +530,7 @@ class ZCatalog(Folder, Persistent, Implicit):
return
Splitter
.
availableSplitters
def
catalog_object
(
self
,
obj
,
uid
=
None
,
idxs
=
None
,
update_metadata
=
1
):
def
catalog_object
(
self
,
obj
,
uid
=
None
,
idxs
=
None
,
update_metadata
=
1
,
pghandler
=
None
):
""" wrapper around catalog """
if
uid
is
None
:
...
...
@@ -572,6 +572,8 @@ class ZCatalog(Folder, Persistent, Implicit):
get_transaction
().
commit
(
1
)
self
.
_p_jar
.
cacheGC
()
self
.
_v_total
=
0
if
pghandler
:
pghandler
.
info
(
'commiting subtransaction'
)
def
uncatalog_object
(
self
,
uid
):
"""Wrapper around catalog """
...
...
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