[Zope-Checkins] SVN: Zope/trunk/src/Products/ZCatalog/ Move IProgressHandler to interfaces module
Hanno Schlichting
hannosch at hannosch.eu
Sun Aug 1 06:14:17 EDT 2010
Log message for revision 115306:
Move IProgressHandler to interfaces module
Changed:
U Zope/trunk/src/Products/ZCatalog/ProgressHandler.py
U Zope/trunk/src/Products/ZCatalog/interfaces.py
-=-
Modified: Zope/trunk/src/Products/ZCatalog/ProgressHandler.py
===================================================================
--- Zope/trunk/src/Products/ZCatalog/ProgressHandler.py 2010-08-01 10:13:20 UTC (rev 115305)
+++ Zope/trunk/src/Products/ZCatalog/ProgressHandler.py 2010-08-01 10:14:16 UTC (rev 115306)
@@ -16,41 +16,13 @@
from logging import getLogger
from DateTime.DateTime import DateTime
-from zope.interface import Interface
from zope.interface import implements
+from .interfaces import IProgressHandler
+
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)
- """
-
- 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 """
-
-
class StdoutHandler:
""" A simple progress handler """
Modified: Zope/trunk/src/Products/ZCatalog/interfaces.py
===================================================================
--- Zope/trunk/src/Products/ZCatalog/interfaces.py 2010-08-01 10:13:20 UTC (rev 115305)
+++ Zope/trunk/src/Products/ZCatalog/interfaces.py 2010-08-01 10:14:16 UTC (rev 115306)
@@ -281,3 +281,31 @@
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 """
More information about the Zope-Checkins
mailing list