Commit 65aa2528 authored by Andreas Jung's avatar Andreas Jung

import cleanup

parent d2d5544a
...@@ -11,27 +11,27 @@ ...@@ -11,27 +11,27 @@
# #
############################################################################## ##############################################################################
from Persistence import Persistent import types
import logging
from bisect import bisect
from random import randint
import Acquisition import Acquisition
import ExtensionClass import ExtensionClass
from MultiMapping import MultiMapping
import Record
from Missing import MV from Missing import MV
import logging from Persistence import Persistent
from Lazy import LazyMap, LazyFilter, LazyCat, LazyValues import BTrees.Length
from CatalogBrains import AbstractCatalogBrain, NoBrainer
from BTrees.IIBTree import intersection, weightedIntersection, IISet from BTrees.IIBTree import intersection, weightedIntersection, IISet
from BTrees.OIBTree import OIBTree from BTrees.OIBTree import OIBTree
from BTrees.IOBTree import IOBTree from BTrees.IOBTree import IOBTree
import BTrees.Length from Lazy import LazyMap, LazyCat, LazyValues
from CatalogBrains import AbstractCatalogBrain, NoBrainer
import time, sys, types
from bisect import bisect
from random import randint
LOG = logging.getLogger('Zope.ZCatalog') LOG = logging.getLogger('Zope.ZCatalog')
try: try:
from DocumentTemplate.cDocumentTemplate import safe_callable from DocumentTemplate.cDocumentTemplate import safe_callable
except ImportError: except ImportError:
...@@ -278,7 +278,7 @@ class Catalog(Persistent, Acquisition.Implicit, ExtensionClass.Base): ...@@ -278,7 +278,7 @@ class Catalog(Persistent, Acquisition.Implicit, ExtensionClass.Base):
indexes = self.indexes indexes = self.indexes
if isinstance(index_type, types.StringType): if isinstance(index_type, 'str'):
raise TypeError,"""Catalog addIndex now requires the index type to raise TypeError,"""Catalog addIndex now requires the index type to
be resolved prior to adding; create the proper index in the caller.""" be resolved prior to adding; create the proper index in the caller."""
...@@ -755,7 +755,7 @@ class Catalog(Persistent, Acquisition.Implicit, ExtensionClass.Base): ...@@ -755,7 +755,7 @@ class Catalog(Persistent, Acquisition.Implicit, ExtensionClass.Base):
reverse = 0 reverse = 0
if sort_index is not None: if sort_index is not None:
order = self._get_sort_attr("order", args) order = self._get_sort_attr("order", args)
if (isinstance(order, types.StringType) and if (isinstance(order, 'str') and
order.lower() in ('reverse', 'descending')): order.lower() in ('reverse', 'descending')):
reverse = 1 reverse = 1
# Perform searches with indexes and sort_index # Perform searches with indexes and sort_index
......
...@@ -13,7 +13,6 @@ ...@@ -13,7 +13,6 @@
"""ZCatalog Findable class""" """ZCatalog Findable class"""
import urllib
from Globals import DTMLFile from Globals import DTMLFile
from Acquisition import aq_base from Acquisition import aq_base
......
...@@ -26,14 +26,14 @@ class IProgressHandler(Interface): ...@@ -26,14 +26,14 @@ class IProgressHandler(Interface):
""" """
def init(ident, max): def init(ident, max):
""" Called add the start of the long running process. """ Called at the start of the long running process.
'ident' -- a string identifying the operation 'ident' -- a string identifying the operation
'max' -- maximum number of objects to be processed 'max' -- maximum number of objects to be processed (int)
""" """
def finish(): def finish():
""" Called up terminiation """ """ Called up termination """
def report(current, *args, **kw): def report(current, *args, **kw):
""" Called for every iteration. """ Called for every iteration.
...@@ -59,7 +59,7 @@ class StdoutHandler: ...@@ -59,7 +59,7 @@ class StdoutHandler:
self._max = max self._max = max
self._start = time.time() self._start = time.time()
self.fp = sys.stdout self.fp = sys.stdout
self.output('Process started') self.output('Process started (%d objects to go)' % self._max)
def finish(self): def finish(self):
self.output('Process terminated. Duration: %0.2f seconds' % \ self.output('Process terminated. Duration: %0.2f seconds' % \
......
...@@ -15,6 +15,8 @@ ...@@ -15,6 +15,8 @@
$Id$ $Id$
""" """
import urllib, time, sys, string,logging
from Globals import DTMLFile, MessageDialog from Globals import DTMLFile, MessageDialog
import Globals import Globals
...@@ -35,8 +37,6 @@ from ZODB.POSException import ConflictError ...@@ -35,8 +37,6 @@ from ZODB.POSException import ConflictError
from Products.PluginIndexes.common.PluggableIndex \ from Products.PluginIndexes.common.PluggableIndex \
import PluggableIndexInterface import PluggableIndexInterface
from Products.PluginIndexes.TextIndex import Splitter from Products.PluginIndexes.TextIndex import Splitter
import urllib, time, sys
import string,logging
from IZCatalog import IZCatalog from IZCatalog import IZCatalog
from ProgressHandler import ZLogHandler from ProgressHandler import ZLogHandler
......
...@@ -14,20 +14,15 @@ ...@@ -14,20 +14,15 @@
"""$Id$ """$Id$
""" """
from Globals import DTMLFile, InitializeClass
from AccessControl.SecurityInfo import ClassSecurityInfo
from AccessControl.Permissions import delete_objects, manage_zcatalog_indexes
import Globals
from OFS.Folder import Folder
from OFS.FindSupport import FindSupport
from OFS.History import Historical
from OFS.SimpleItem import SimpleItem
from OFS.ObjectManager import ObjectManager, IFAwareObjectManager
import os, sys, time
from Acquisition import Implicit from Acquisition import Implicit
from Persistence import Persistent from Persistence import Persistent
from Globals import DTMLFile, InitializeClass
from AccessControl.SecurityInfo import ClassSecurityInfo
from AccessControl.Permissions import manage_zcatalog_indexes
from OFS.Folder import Folder
from OFS.SimpleItem import SimpleItem
from OFS.ObjectManager import IFAwareObjectManager
from Products.PluginIndexes.common.PluggableIndex import PluggableIndexInterface from Products.PluginIndexes.common.PluggableIndex import PluggableIndexInterface
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
"""ZCatalog product""" """ZCatalog product"""
import ZCatalog, Catalog, CatalogAwareness, CatalogPathAwareness, ZClasses import ZCatalog, CatalogAwareness, CatalogPathAwareness
from Products.PluginIndexes.TextIndex import Vocabulary from Products.PluginIndexes.TextIndex import Vocabulary
from ZClasses import createZClassForBase from ZClasses import createZClassForBase
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment