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

import cleanup

parent d2d5544a
......@@ -11,27 +11,27 @@
#
##############################################################################
from Persistence import Persistent
import types
import logging
from bisect import bisect
from random import randint
import Acquisition
import ExtensionClass
from MultiMapping import MultiMapping
import Record
from Missing import MV
import logging
from Persistence import Persistent
from Lazy import LazyMap, LazyFilter, LazyCat, LazyValues
from CatalogBrains import AbstractCatalogBrain, NoBrainer
import BTrees.Length
from BTrees.IIBTree import intersection, weightedIntersection, IISet
from BTrees.OIBTree import OIBTree
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')
try:
from DocumentTemplate.cDocumentTemplate import safe_callable
except ImportError:
......@@ -278,7 +278,7 @@ class Catalog(Persistent, Acquisition.Implicit, ExtensionClass.Base):
indexes = self.indexes
if isinstance(index_type, types.StringType):
if isinstance(index_type, 'str'):
raise TypeError,"""Catalog addIndex now requires the index type to
be resolved prior to adding; create the proper index in the caller."""
......@@ -755,7 +755,7 @@ class Catalog(Persistent, Acquisition.Implicit, ExtensionClass.Base):
reverse = 0
if sort_index is not None:
order = self._get_sort_attr("order", args)
if (isinstance(order, types.StringType) and
if (isinstance(order, 'str') and
order.lower() in ('reverse', 'descending')):
reverse = 1
# Perform searches with indexes and sort_index
......
......@@ -13,7 +13,6 @@
"""ZCatalog Findable class"""
import urllib
from Globals import DTMLFile
from Acquisition import aq_base
......
......@@ -26,14 +26,14 @@ class IProgressHandler(Interface):
"""
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
'max' -- maximum number of objects to be processed
'max' -- maximum number of objects to be processed (int)
"""
def finish():
""" Called up terminiation """
""" Called up termination """
def report(current, *args, **kw):
""" Called for every iteration.
......@@ -59,7 +59,7 @@ class StdoutHandler:
self._max = max
self._start = time.time()
self.fp = sys.stdout
self.output('Process started')
self.output('Process started (%d objects to go)' % self._max)
def finish(self):
self.output('Process terminated. Duration: %0.2f seconds' % \
......
......@@ -15,6 +15,8 @@
$Id$
"""
import urllib, time, sys, string,logging
from Globals import DTMLFile, MessageDialog
import Globals
......@@ -35,8 +37,6 @@ from ZODB.POSException import ConflictError
from Products.PluginIndexes.common.PluggableIndex \
import PluggableIndexInterface
from Products.PluginIndexes.TextIndex import Splitter
import urllib, time, sys
import string,logging
from IZCatalog import IZCatalog
from ProgressHandler import ZLogHandler
......
......@@ -14,20 +14,15 @@
"""$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 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
......
......@@ -13,7 +13,7 @@
"""ZCatalog product"""
import ZCatalog, Catalog, CatalogAwareness, CatalogPathAwareness, ZClasses
import ZCatalog, CatalogAwareness, CatalogPathAwareness
from Products.PluginIndexes.TextIndex import Vocabulary
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