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
77525bb0
Commit
77525bb0
authored
Aug 01, 2010
by
Hanno Schlichting
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move IProgressHandler to interfaces module
parent
3641553d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
30 deletions
+30
-30
src/Products/ZCatalog/ProgressHandler.py
src/Products/ZCatalog/ProgressHandler.py
+2
-30
src/Products/ZCatalog/interfaces.py
src/Products/ZCatalog/interfaces.py
+28
-0
No files found.
src/Products/ZCatalog/ProgressHandler.py
View file @
77525bb0
...
...
@@ -16,39 +16,11 @@ import time
from
logging
import
getLogger
from
DateTime.DateTime
import
DateTime
from
zope.interface
import
Interface
from
zope.interface
import
implements
LOG
=
getLogger
(
'ProgressHandler'
)
class
IProgressHandler
(
Interface
):
""" A handler to log progress informations for long running
operations.
"""
def
init
(
ident
,
max
):
""" Called at the start of the long running process.
'ident' -- a string identifying the operation
'max' -- maximum number of objects to be processed (int)
"""
from
.interfaces
import
IProgressHandler
def
info
(
text
):
""" Log some 'text'"""
def
finish
():
""" Called up termination """
def
report
(
current
,
*
args
,
**
kw
):
""" Called for every iteration.
'current' -- an integer representing the number of objects
processed so far.
"""
def
output
(
text
):
""" Log 'text' to some output channel """
LOG
=
getLogger
(
'ProgressHandler'
)
class
StdoutHandler
:
...
...
src/Products/ZCatalog/interfaces.py
View file @
77525bb0
...
...
@@ -281,3 +281,31 @@ class ICatalogBrain(Interface):
def
getRID
():
"""Return the record ID for this object."""
class
IProgressHandler
(
Interface
):
""" A handler to log progress informations for long running
operations.
"""
def
init
(
ident
,
max
):
""" Called at the start of the long running process.
'ident' -- a string identifying the operation
'max' -- maximum number of objects to be processed (int)
"""
def
info
(
text
):
""" Log some 'text'"""
def
finish
():
""" Called up termination """
def
report
(
current
,
*
args
,
**
kw
):
""" Called for every iteration.
'current' -- an integer representing the number of objects
processed so far.
"""
def
output
(
text
):
""" Log 'text' to some output channel """
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