On the way to Zope 2.12, Reform imports, specially from Globals (replacing it...

On the way to Zope 2.12, Reform imports, specially from Globals (replacing it with Products.ERP5Type.Globals on the products that depend on ERP5Type), convert Interface uses to zope.interfaces, and remove CMFMailIn references with blessings from Jerome.

git-svn-id: https://svn.erp5.org/repos/public/erp5/sandbox/portal_types@29459 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 55c4072f
......@@ -26,7 +26,7 @@
#
##############################################################################
from Globals import InitializeClass, DTMLFile
from Products.ERP5Type.Globals import InitializeClass, DTMLFile
from AccessControl import ClassSecurityInfo
from Products.CMFCore import CMFCorePermissions
from Products.ERP5Type.Base import Base
......
......@@ -29,7 +29,7 @@
from Products.ERP5Type.Base import Base
from Products.ERP5Type.Utils import getPath
from zLOG import LOG
from Globals import InitializeClass, DTMLFile
from Products.ERP5Type.Globals import InitializeClass, DTMLFile
from Products.PythonScripts.Utility import allow_class
class ActiveResult:
......
......@@ -44,7 +44,7 @@ from AccessControl.SecurityManagement import noSecurityManager
from AccessControl.SecurityManagement import setSecurityManager
from AccessControl.SecurityManagement import getSecurityManager
from Products.CMFCore.utils import UniqueObject, _getAuthenticatedUser, getToolByName
from Globals import InitializeClass, DTMLFile
from Products.ERP5Type.Globals import InitializeClass, DTMLFile
from Acquisition import aq_base
from Acquisition import aq_inner
from ActivityBuffer import ActivityBuffer
......
......@@ -28,7 +28,7 @@
import string
from Globals import InitializeClass, DTMLFile
from Products.ERP5Type.Globals import InitializeClass, DTMLFile
from AccessControl import ClassSecurityInfo
from AccessControl import getSecurityManager
from Acquisition import aq_base, aq_inner, aq_parent
......
......@@ -32,7 +32,7 @@ ERP portal_categories tool.
from OFS.Folder import Folder
from Products.CMFCore.utils import UniqueObject
from Globals import InitializeClass, DTMLFile
from Products.ERP5Type.Globals import InitializeClass, DTMLFile
from AccessControl import ClassSecurityInfo
from AccessControl import Unauthorized, getSecurityManager
from Acquisition import aq_base, aq_inner
......
......@@ -30,7 +30,7 @@
from UserList import UserList
import zope.interface
from Globals import InitializeClass
from Products.ERP5Type.Globals import InitializeClass
from Products.PythonScripts.Utility import allow_class
from AccessControl import ClassSecurityInfo
......
......@@ -27,7 +27,7 @@
#
##############################################################################
from Globals import InitializeClass
from Products.ERP5Type.Globals import InitializeClass
from Products.PythonScripts.Utility import allow_class
from AccessControl import ClassSecurityInfo
from Persistence import Persistent
......
......@@ -26,7 +26,7 @@
#
##############################################################################
from Globals import InitializeClass, PersistentMapping
from Products.ERP5Type.Globals import InitializeClass, PersistentMapping
from AccessControl import ClassSecurityInfo
from Products.ERP5Type import Permissions, PropertySheet, Constraint, interfaces
......
......@@ -26,7 +26,7 @@
#
##############################################################################
#from Globals import InitializeClass, PersistentMapping
#from Products.ERP5Type.Globals import InitializeClass, PersistentMapping
#from Products.CMFCore.utils import getToolByName
from AccessControl import ClassSecurityInfo
from Products.ERP5Type import Permissions, PropertySheet, Constraint, interfaces
......
......@@ -26,7 +26,7 @@
#
##############################################################################
from Globals import InitializeClass
from Products.ERP5Type.Globals import InitializeClass
from AccessControl import ClassSecurityInfo
from Products.ERP5Type import Permissions, PropertySheet, Constraint, interfaces
from Products.CMFCore.utils import getToolByName
......
......@@ -28,7 +28,7 @@
##############################################################################
import zope.interface
from Globals import InitializeClass
from Products.ERP5Type.Globals import InitializeClass
from AccessControl import ClassSecurityInfo
from Products.ERP5.Variated import Variated
from Products.ERP5.VariationValue import VariationValue
......
......@@ -26,7 +26,7 @@
#
##############################################################################
from Globals import InitializeClass, PersistentMapping
from Products.ERP5Type.Globals import InitializeClass, PersistentMapping
from AccessControl import ClassSecurityInfo
from Products.ERP5Type import Permissions, PropertySheet, Constraint, interfaces
......
......@@ -26,7 +26,7 @@
#
##############################################################################
from Globals import InitializeClass, PersistentMapping
from Products.ERP5Type.Globals import InitializeClass, PersistentMapping
from AccessControl import ClassSecurityInfo
from Products.ERP5Type import Permissions, PropertySheet, Constraint, interfaces
......
......@@ -26,7 +26,7 @@
#
##############################################################################
from Globals import InitializeClass
from Products.ERP5Type.Globals import InitializeClass
from AccessControl import ClassSecurityInfo
from Products.ERP5Type import Permissions, PropertySheet, Constraint, interfaces
......
......@@ -26,7 +26,7 @@
#
##############################################################################
from Globals import InitializeClass
from Products.ERP5Type.Globals import InitializeClass
from AccessControl import ClassSecurityInfo
from Products.ERP5Type import Permissions, PropertySheet, Constraint, interfaces
......
......@@ -26,7 +26,7 @@
#
##############################################################################
from Globals import InitializeClass
from Products.ERP5Type.Globals import InitializeClass
from AccessControl import ClassSecurityInfo
from Products.ERP5Type import Permissions, PropertySheet, Constraint, interfaces
......
......@@ -28,7 +28,7 @@
#
##############################################################################
from Globals import InitializeClass, PersistentMapping
from Products.ERP5Type.Globals import InitializeClass, PersistentMapping
from AccessControl import ClassSecurityInfo
from Products.ERP5Type import Permissions, PropertySheet, Constraint, interfaces
......
......@@ -28,7 +28,7 @@
#
##############################################################################
from Globals import InitializeClass, PersistentMapping
from Products.ERP5Type.Globals import InitializeClass, PersistentMapping
from AccessControl import ClassSecurityInfo
from Products.ERP5Type import Permissions, PropertySheet, Constraint, interfaces
......
......@@ -29,7 +29,7 @@
import fnmatch, imp, os, re, shutil, sys
from Shared.DC.ZRDB.Connection import Connection as RDBConnection
from Globals import Persistent, PersistentMapping
from Products.ERP5Type.Globals import Persistent, PersistentMapping
from Acquisition import Implicit, aq_base
from AccessControl import ClassSecurityInfo
from Products.CMFCore.utils import getToolByName
......
......@@ -27,7 +27,7 @@
#
##############################################################################
from Globals import InitializeClass, PersistentMapping
from Products.ERP5Type.Globals import InitializeClass, PersistentMapping
from AccessControl import ClassSecurityInfo
from Products.ERP5Type import Permissions, PropertySheet, Constraint, interfaces
......
......@@ -28,7 +28,7 @@
#
##############################################################################
from Globals import InitializeClass, PersistentMapping
from Products.ERP5Type.Globals import InitializeClass, PersistentMapping
from AccessControl import ClassSecurityInfo
from Products.ERP5Type import Permissions, PropertySheet, Constraint, interfaces
......
......@@ -27,7 +27,7 @@
#
##############################################################################
from Globals import InitializeClass, PersistentMapping
from Products.ERP5Type.Globals import InitializeClass, PersistentMapping
from AccessControl import ClassSecurityInfo
from Products.ERP5Type import Permissions, PropertySheet, Constraint, interfaces
......
......@@ -27,7 +27,7 @@
#
##############################################################################
from Globals import InitializeClass, PersistentMapping
from Products.ERP5Type.Globals import InitializeClass, PersistentMapping
from AccessControl import ClassSecurityInfo
from Products.ERP5Type import Permissions, PropertySheet, Constraint, interfaces
......
......@@ -27,7 +27,7 @@
#
##############################################################################
from Globals import InitializeClass, PersistentMapping
from Products.ERP5Type.Globals import InitializeClass, PersistentMapping
from AccessControl import ClassSecurityInfo
from Products.ERP5Type import Permissions, PropertySheet, Constraint, interfaces
......
......@@ -27,7 +27,7 @@
#
##############################################################################
from Globals import InitializeClass, PersistentMapping
from Products.ERP5Type.Globals import InitializeClass, PersistentMapping
from AccessControl import ClassSecurityInfo
from Acquisition import aq_base
......
......@@ -26,7 +26,7 @@
#
##############################################################################
from Globals import InitializeClass, PersistentMapping
from Products.ERP5Type.Globals import InitializeClass, PersistentMapping
from AccessControl import ClassSecurityInfo
from Products.ERP5Type import Permissions, PropertySheet, Constraint, interfaces
......
......@@ -26,7 +26,7 @@
#
##############################################################################
from Globals import InitializeClass, PersistentMapping
from Products.ERP5Type.Globals import InitializeClass, PersistentMapping
from AccessControl import ClassSecurityInfo
from Products.ERP5Type import Permissions, PropertySheet, Constraint, interfaces
......
......@@ -26,7 +26,7 @@
#
##############################################################################
from Globals import InitializeClass, PersistentMapping
from Products.ERP5Type.Globals import InitializeClass, PersistentMapping
from AccessControl import ClassSecurityInfo
from Products.ERP5Type import Permissions, PropertySheet, Constraint, interfaces
......
......@@ -33,7 +33,7 @@ from zLOG import LOG
from AccessControl import ClassSecurityInfo, getSecurityManager
from AccessControl.SecurityManagement import newSecurityManager, setSecurityManager
from Acquisition import aq_base
from Globals import get_request
from Products.ERP5Type.Globals import get_request
from Products.CMFCore.utils import getToolByName, _checkPermission
from Products.ERP5Type import Permissions, PropertySheet, Constraint, interfaces
from Products.ERP5Type.XMLObject import XMLObject
......
......@@ -29,7 +29,7 @@
import re, types
from DateTime import DateTime
from Globals import get_request
from Products.ERP5Type.Globals import get_request
from AccessControl import ClassSecurityInfo, Unauthorized
from Products.ERP5Type.Base import WorkflowMethod
from Products.CMFCore.utils import getToolByName, _checkPermission
......
......@@ -34,7 +34,7 @@ from Products.ExtFile.ExtFile import ExtFile
from Products.ExtFile.ExtImage import ExtImage
import os
from App.config import getConfiguration
from Globals import package_home
from Products.ERP5Type.Globals import package_home
from Products.ERP5 import product_path
from Shared.DC.ZRDB.TM import TM
import shutil
......
......@@ -27,7 +27,7 @@
##############################################################################
import zope.interface
from Globals import InitializeClass, PersistentMapping
from Products.ERP5Type.Globals import InitializeClass, PersistentMapping
from AccessControl import ClassSecurityInfo
from DateTime import DateTime
......
......@@ -27,7 +27,7 @@
##############################################################################
import zope.interface
from Globals import InitializeClass
from Products.ERP5Type.Globals import InitializeClass
from AccessControl import ClassSecurityInfo
from Products.ERP5Type import Base, Permissions, PropertySheet, Constraint, interfaces
......
......@@ -26,7 +26,7 @@
#
##############################################################################
from Globals import InitializeClass
from Products.ERP5Type.Globals import InitializeClass
from AccessControl import ClassSecurityInfo
from Products.ERP5Type import Base, Permissions, PropertySheet, Constraint, interfaces
......
......@@ -26,7 +26,7 @@
#
##############################################################################
from Globals import InitializeClass, PersistentMapping
from Products.ERP5Type.Globals import InitializeClass, PersistentMapping
from AccessControl import ClassSecurityInfo
from DateTime import DateTime
......
......@@ -26,7 +26,7 @@
#
##############################################################################
from Globals import InitializeClass
from Products.ERP5Type.Globals import InitializeClass
from AccessControl import ClassSecurityInfo
from Products.ERP5Type import Base, Permissions, PropertySheet, Constraint, interfaces
......
......@@ -26,7 +26,7 @@
#
##############################################################################
from Globals import InitializeClass
from Products.ERP5Type.Globals import InitializeClass
from AccessControl import ClassSecurityInfo
from Products.ERP5Type import Base, Permissions, PropertySheet, Constraint, interfaces
......
......@@ -26,7 +26,7 @@
#
##############################################################################
from Globals import InitializeClass, PersistentMapping
from Products.ERP5Type.Globals import InitializeClass, PersistentMapping
from AccessControl import ClassSecurityInfo
from Products.ERP5Type import Permissions, PropertySheet, Constraint, interfaces
......
......@@ -26,7 +26,7 @@
#
##############################################################################
from Globals import InitializeClass, PersistentMapping
from Products.ERP5Type.Globals import InitializeClass, PersistentMapping
from AccessControl import ClassSecurityInfo
from Products.ERP5Type import Permissions, PropertySheet, Constraint, interfaces
......
......@@ -26,7 +26,7 @@
#
##############################################################################
from Globals import InitializeClass, PersistentMapping
from Products.ERP5Type.Globals import InitializeClass, PersistentMapping
from AccessControl import ClassSecurityInfo
from Products.ERP5Type import Permissions, PropertySheet, Constraint, interfaces
......
......@@ -27,7 +27,7 @@
#
##############################################################################
from Globals import InitializeClass, PersistentMapping
from Products.ERP5Type.Globals import InitializeClass, PersistentMapping
from AccessControl import ClassSecurityInfo
from DateTime import DateTime
......
......@@ -27,7 +27,7 @@
#
##############################################################################
from Globals import InitializeClass, PersistentMapping
from Products.ERP5Type.Globals import InitializeClass, PersistentMapping
from AccessControl import ClassSecurityInfo
from Products.ERP5Type import Permissions, PropertySheet, Constraint, interfaces
......
......@@ -27,7 +27,7 @@
#
##############################################################################
from Globals import InitializeClass
from Products.ERP5Type.Globals import InitializeClass
from AccessControl import ClassSecurityInfo
from Products.CMFMailIn.MailMessage import MailMessage as CMFMailInMessage
......@@ -40,7 +40,7 @@ from zLOG import LOG
_MARKER = []
class MailMessage(Event, CMFMailInMessage):
class MailMessage(Event):
"""
LEGACY
......
......@@ -26,7 +26,7 @@
#
##############################################################################
from Globals import InitializeClass
from Products.ERP5Type.Globals import InitializeClass
from AccessControl import ClassSecurityInfo
from Products.ERP5Type import Permissions, PropertySheet, Constraint, interfaces
......
......@@ -27,7 +27,7 @@
##############################################################################
import zope.interface
from Globals import InitializeClass, PersistentMapping
from Products.ERP5Type.Globals import InitializeClass, PersistentMapping
from AccessControl import ClassSecurityInfo
from Products.ERP5Type import Permissions, PropertySheet, Constraint, interfaces
......
......@@ -26,7 +26,7 @@
#
##############################################################################
from Globals import InitializeClass, PersistentMapping
from Products.ERP5Type.Globals import InitializeClass, PersistentMapping
from AccessControl import ClassSecurityInfo
from Products.ERP5Type import Permissions, PropertySheet, Constraint, interfaces
from Products.ERP5.Document.SupplyCell import SupplyCell
......
......@@ -27,7 +27,7 @@
#
##############################################################################
from Globals import InitializeClass, PersistentMapping
from Products.ERP5Type.Globals import InitializeClass, PersistentMapping
from AccessControl import ClassSecurityInfo
from Acquisition import aq_base
......
......@@ -26,7 +26,7 @@
#
##############################################################################
from Globals import InitializeClass, PersistentMapping
from Products.ERP5Type.Globals import InitializeClass, PersistentMapping
from AccessControl import ClassSecurityInfo
from Products.ERP5Type import Permissions, PropertySheet, Constraint, interfaces
......
......@@ -26,7 +26,7 @@
#
##############################################################################
from Globals import InitializeClass
from Products.ERP5Type.Globals import InitializeClass
from AccessControl import ClassSecurityInfo
from Products.ERP5Type import Permissions, PropertySheet, Constraint, interfaces
......
......@@ -26,7 +26,7 @@
#
##############################################################################
from Globals import InitializeClass, PersistentMapping
from Products.ERP5Type.Globals import InitializeClass, PersistentMapping
from AccessControl import ClassSecurityInfo
from Products.ERP5Type import Permissions, PropertySheet, Constraint, interfaces
......
......@@ -31,7 +31,7 @@ from AccessControl import ClassSecurityInfo
from Products.CMFCore.utils import getToolByName
from Products.CMFCore.utils import _checkPermission
from Products.CMFCore.exceptions import AccessControl_Unauthorized
from Globals import PersistentMapping
from Products.ERP5Type.Globals import PersistentMapping
from Acquisition import aq_base
#from Products.ERP5.Core.Node import Node
......
......@@ -26,7 +26,7 @@
#
##############################################################################
from Globals import InitializeClass, PersistentMapping
from Products.ERP5Type.Globals import InitializeClass, PersistentMapping
from AccessControl import ClassSecurityInfo
from Products.ERP5Type import Permissions, PropertySheet, Constraint, interfaces
......
......@@ -28,7 +28,7 @@
import zope.interface
from warnings import warn
from Globals import InitializeClass
from Products.ERP5Type.Globals import InitializeClass
from AccessControl import ClassSecurityInfo
from Acquisition import aq_base, aq_inner
......@@ -41,7 +41,7 @@ from Products.ERP5Type.XMLObject import XMLObject
from Products.ERP5Type.Utils import convertToUpperCase
from Products.ERP5Type.Cache import getReadOnlyTransactionCache, enableReadOnlyTransactionCache, disableReadOnlyTransactionCache
from Products.ZSQLCatalog.SQLCatalog import SQLQuery
from Globals import PersistentMapping
from Products.ERP5Type.Globals import PersistentMapping
from zLOG import LOG
......
......@@ -28,7 +28,7 @@
#
##############################################################################
from Globals import InitializeClass, PersistentMapping
from Products.ERP5Type.Globals import InitializeClass, PersistentMapping
from AccessControl import ClassSecurityInfo
from Products.ERP5Type import Permissions, PropertySheet, Constraint, interfaces
......
......@@ -26,7 +26,7 @@
#
##############################################################################
from Globals import InitializeClass, PersistentMapping
from Products.ERP5Type.Globals import InitializeClass, PersistentMapping
from AccessControl import ClassSecurityInfo
from Products.ERP5Type import Permissions, PropertySheet, Constraint, interfaces
......
......@@ -26,7 +26,7 @@
#
##############################################################################
from Globals import InitializeClass, PersistentMapping
from Products.ERP5Type.Globals import InitializeClass, PersistentMapping
from AccessControl import ClassSecurityInfo
from Products.ERP5Type import Permissions, PropertySheet, Constraint, interfaces
......
......@@ -26,7 +26,7 @@
#
##############################################################################
from Globals import InitializeClass, PersistentMapping
from Products.ERP5Type.Globals import InitializeClass, PersistentMapping
from AccessControl import ClassSecurityInfo
from Products.ERP5Type import Permissions, PropertySheet, Constraint, interfaces
......
......@@ -26,7 +26,7 @@
#
##############################################################################
from Globals import InitializeClass, PersistentMapping
from Products.ERP5Type.Globals import InitializeClass, PersistentMapping
from AccessControl import ClassSecurityInfo
from Products.ERP5Type import Permissions, PropertySheet, Constraint, interfaces
......
......@@ -26,7 +26,7 @@
#
##############################################################################
from Globals import InitializeClass, PersistentMapping
from Products.ERP5Type.Globals import InitializeClass, PersistentMapping
from AccessControl import ClassSecurityInfo
from Products.ERP5Type import Permissions, PropertySheet, Constraint, interfaces
......
......@@ -26,13 +26,13 @@
#
##############################################################################
from Globals import InitializeClass
from Products.ERP5Type.Globals import InitializeClass
from AccessControl import ClassSecurityInfo
from Products.CMFCore.utils import getToolByName
from Products.ERP5Type import Permissions, PropertySheet, Constraint, interfaces
from Products.ERP5Type.TransactionalVariable import getTransactionalVariable
from Globals import PersistentMapping
from Products.ERP5Type.Globals import PersistentMapping
from Products.ERP5.Document.Movement import Movement
......
......@@ -27,7 +27,7 @@
##############################################################################
import zope.interface
from Globals import InitializeClass, PersistentMapping
from Products.ERP5Type.Globals import InitializeClass, PersistentMapping
from AccessControl import ClassSecurityInfo
from Products.ERP5Type import Permissions, PropertySheet, Constraint, interfaces
......
......@@ -26,7 +26,7 @@
#
##############################################################################
from Globals import InitializeClass, PersistentMapping
from Products.ERP5Type.Globals import InitializeClass, PersistentMapping
from AccessControl import ClassSecurityInfo
from Products.ERP5Type import Permissions, PropertySheet, Constraint, interfaces
......
......@@ -26,7 +26,7 @@
#
##############################################################################
from Globals import InitializeClass, PersistentMapping
from Products.ERP5Type.Globals import InitializeClass, PersistentMapping
from Products.CMFCore.utils import getToolByName
from AccessControl import ClassSecurityInfo
from Products.ERP5Type import Permissions, PropertySheet, Constraint, interfaces
......
......@@ -26,7 +26,7 @@
#
##############################################################################
from Globals import InitializeClass, PersistentMapping
from Products.ERP5Type.Globals import InitializeClass, PersistentMapping
from AccessControl import ClassSecurityInfo
from Products.ERP5Type import Permissions, PropertySheet, Constraint, interfaces
......
......@@ -26,7 +26,7 @@
#
##############################################################################
from Globals import InitializeClass, PersistentMapping
from Products.ERP5Type.Globals import InitializeClass, PersistentMapping
from AccessControl import ClassSecurityInfo
from Products.ERP5Type import Permissions, PropertySheet, Constraint, interfaces
......
......@@ -28,7 +28,7 @@
##############################################################################
import zope.interface
from Globals import InitializeClass
from Products.ERP5Type.Globals import InitializeClass
from AccessControl import ClassSecurityInfo
from Products.ERP5Type import Permissions, PropertySheet, interfaces
......
......@@ -27,7 +27,7 @@
##############################################################################
import zope.interface
from Globals import InitializeClass
from Products.ERP5Type.Globals import InitializeClass
from AccessControl import ClassSecurityInfo
from Products.ERP5Type import Permissions, PropertySheet, Constraint, interfaces
......
......@@ -28,8 +28,7 @@
from AccessControl import ClassSecurityInfo
from Products.CMFCore.utils import getToolByName
from Products.ERP5Type import Permissions, PropertySheet,\
Constraint, Interface, Cache
from Products.ERP5Type import Permissions, PropertySheet, Constraint, Cache
from Products.ERP5.Document.Domain import Domain
from Products.ERP5.Document.Document import PermanentURLMixIn
from Acquisition import ImplicitAcquisitionWrapper, aq_base, aq_inner
......
......@@ -32,7 +32,7 @@ from Products.ERP5.Document.WebSection import WebSection, WEBSECTION_KEY
from Products.ERP5Type import Permissions, PropertySheet, Constraint, interfaces, Cache
from Products.ERP5Type.Cache import CachingMethod
from Globals import get_request
from Products.ERP5Type.Globals import get_request
from Persistence import Persistent
from ZPublisher import BeforeTraverse
from ZPublisher.HTTPRequest import HTTPRequest
......
......@@ -14,9 +14,9 @@
Portal class
"""
import Globals
from Products.ERP5Type import Globals
import AccessControl
from Globals import package_home
from Products.ERP5Type.Globals import package_home
from Products.SiteErrorLog.SiteErrorLog import manage_addErrorLog
from ZPublisher import BeforeTraverse
......
from Globals import get_request
from Products.ERP5Type.Globals import get_request
import time
from zLOG import LOG
......
from Globals import get_request
from Products.ERP5Type.Globals import get_request
from Acquisition import aq_base
from Globals import PersistentMapping
from Products.ERP5Type.Globals import PersistentMapping
from Products.CMFCore.utils import getToolByName
......
from Globals import get_request
from Products.ERP5Type.Globals import get_request
import re
import os
import sys
......
from Globals import get_request
from Products.ERP5Type.Globals import get_request
from Acquisition import aq_base
from Products.ERP5Type.Base import Base
from zLOG import LOG
......
......@@ -22,9 +22,9 @@ $Id$
"""
from OFS.SimpleItem import SimpleItem
from Globals import DTMLFile, PersistentMapping
from Products.ERP5Type.Globals import DTMLFile, PersistentMapping
from Acquisition import aq_inner, aq_parent
import Globals
from Products.ERP5Type import Globals
from AccessControl import ClassSecurityInfo
from Products.ERP5Type.Permissions import ManagePortal
......
......@@ -18,7 +18,7 @@
##############################################################################
import transaction
import Globals
from Products.ERP5Type import Globals
import App
from types import StringTypes
from AccessControl import getSecurityManager, ClassSecurityInfo
......
......@@ -27,7 +27,7 @@
#
##############################################################################
from AccessControl import ClassSecurityInfo
from Globals import InitializeClass, DTMLFile
from Products.ERP5Type.Globals import InitializeClass, DTMLFile
from Products.ERP5Type.Tool.BaseTool import BaseTool
from Products.ERP5Type import Permissions
from Products.ERP5 import _dtmldir
......
......@@ -31,7 +31,7 @@ import threading
from AccessControl import ClassSecurityInfo
from AccessControl.SecurityManagement import newSecurityManager
from Globals import InitializeClass, DTMLFile, PersistentMapping
from Products.ERP5Type.Globals import InitializeClass, DTMLFile, PersistentMapping
from Products.ERP5Type.Core.Folder import Folder
from Products.ERP5Type.Tool.BaseTool import BaseTool
from Products.ERP5Type import Permissions
......
......@@ -30,7 +30,7 @@
from Products.ERP5Type import Permissions
from AccessControl import ClassSecurityInfo
from Products.ERP5Type.Tool.BaseTool import BaseTool
from Globals import InitializeClass
from Products.ERP5Type.Globals import InitializeClass
class BuilderTool(BaseTool):
"""Base class for builder tools
......
......@@ -34,7 +34,7 @@ from Products.CMFCategory.CategoryTool import CategoryTool as CMFCategoryTool
from Products.ERP5Type.Tool.BaseTool import BaseTool
from AccessControl import ClassSecurityInfo
from Acquisition import aq_base
from Globals import InitializeClass
from Products.ERP5Type.Globals import InitializeClass
from Products.ERP5Type import Permissions
from Products.ERP5Type.CopySupport import CopyContainer
from Products.CMFCore.utils import getToolByName
......
......@@ -17,7 +17,8 @@
import urllib2, os, dircache, urllib
from StringIO import StringIO
from urllib2 import FileHandler, url2pathname, mimetypes, mimetools, addinfourl, URLError
from urllib2 import FileHandler, url2pathname, addinfourl, URLError
import mimetypes, mimetools
class DirectoryFileHandler(FileHandler):
"""
......
......@@ -27,7 +27,7 @@
#
##############################################################################
from AccessControl import ClassSecurityInfo
from Globals import InitializeClass
from Products.ERP5Type.Globals import InitializeClass
from Products.ERP5Type.Tool.BaseTool import BaseTool
......
......@@ -35,7 +35,7 @@ import urllib2, urllib
import inspect
from AccessControl import ClassSecurityInfo, getSecurityManager
from Globals import InitializeClass, DTMLFile
from Products.ERP5Type.Globals import InitializeClass, DTMLFile
from Products.CMFCore.utils import getToolByName, _checkPermission
from Products.ERP5Type.Tool.BaseTool import BaseTool
from Products.ERP5Type import Permissions
......
......@@ -29,7 +29,7 @@
##############################################################################
from AccessControl import ClassSecurityInfo
from Globals import InitializeClass, DTMLFile
from Products.ERP5Type.Globals import InitializeClass, DTMLFile
from Products.ERP5.Tool.BuilderTool import BuilderTool
from Products.ERP5Type import Permissions
......
......@@ -28,7 +28,7 @@
##############################################################################
from AccessControl import ClassSecurityInfo
from Globals import InitializeClass, DTMLFile
from Products.ERP5Type.Globals import InitializeClass, DTMLFile
from Products.ERP5Type import Permissions
from Products.ERP5 import _dtmldir
from Products.ERP5Type.Tool.BaseTool import BaseTool
......
......@@ -28,7 +28,7 @@
from Acquisition import aq_base
from AccessControl import ClassSecurityInfo
from Globals import InitializeClass, DTMLFile, PersistentMapping
from Products.ERP5Type.Globals import InitializeClass, DTMLFile, PersistentMapping
from Products.ERP5Type.Tool.BaseTool import BaseTool
from Products.ERP5Type import Permissions
from Products.CMFCore.utils import getToolByName
......
......@@ -28,7 +28,7 @@
from AccessControl import ClassSecurityInfo
from Products.CMFCore.utils import UniqueObject, _checkPermission, _getAuthenticatedUser
from Globals import InitializeClass
from Products.ERP5Type.Globals import InitializeClass
from Acquisition import aq_base
from DateTime import DateTime
......
......@@ -30,7 +30,7 @@
import os
import tempfile
from AccessControl import ClassSecurityInfo
from Globals import InitializeClass, DTMLFile
from Products.ERP5Type.Globals import InitializeClass, DTMLFile
from Products.CMFCore.utils import getToolByName
from Products.ERP5Type.Tool.BaseTool import BaseTool
from Products.ERP5Type import Permissions
......
......@@ -26,7 +26,7 @@
#
##############################################################################
from AccessControl import ClassSecurityInfo
from Globals import DTMLFile
from Products.ERP5Type.Globals import DTMLFile
from Products.CMFCore.utils import getToolByName
from Products.ERP5Type.Tool.BaseTool import BaseTool
from Products.ERP5Type import Permissions
......
......@@ -29,7 +29,7 @@
##############################################################################
from AccessControl import ClassSecurityInfo
from Globals import InitializeClass, DTMLFile
from Products.ERP5Type.Globals import InitializeClass, DTMLFile
from Products.ERP5.Tool.BuilderTool import BuilderTool
from Products.ERP5Type import Permissions
......
......@@ -29,7 +29,7 @@
import socket
from AccessControl import ClassSecurityInfo
from Globals import InitializeClass, DTMLFile, get_request
from Products.ERP5Type.Globals import InitializeClass, DTMLFile, get_request
from Products.ERP5Type.Tool.BaseTool import BaseTool
from Products.ERP5Type import Permissions
from Products.ERP5 import _dtmldir
......@@ -38,7 +38,7 @@ import time, random, md5
from DateTime import DateTime
from Products.ERP5Type.Message import translateString
from Acquisition import aq_base
from Globals import PersistentMapping
from Products.ERP5Type.Globals import PersistentMapping
class PasswordTool(BaseTool):
"""
......
......@@ -29,7 +29,7 @@
from Products.CMFCore.utils import UniqueObject
from AccessControl import ClassSecurityInfo
from Globals import InitializeClass, DTMLFile
from Products.ERP5Type.Globals import InitializeClass, DTMLFile
from Products.ERP5Type.Core.Folder import Folder
from Products.ERP5Type import Permissions
from Products.CMFCore.utils import getToolByName
......
......@@ -30,7 +30,7 @@
from Products.CMFCore.utils import getToolByName
from AccessControl import ClassSecurityInfo
from Globals import InitializeClass, DTMLFile
from Products.ERP5Type.Globals import InitializeClass, DTMLFile
from Products.ERP5Type import Permissions
from Products.ERP5Type.Tool.BaseTool import BaseTool
......
......@@ -34,7 +34,7 @@ import shutil
from Acquisition import Implicit
from AccessControl import ClassSecurityInfo
from Globals import InitializeClass, DTMLFile, PersistentMapping
from Products.ERP5Type.Globals import InitializeClass, DTMLFile, PersistentMapping
from Products.ERP5Type.Tool.BaseTool import BaseTool
from Products.ERP5Type import Permissions, tarfile
from Products.ERP5.Document.BusinessTemplate import BusinessTemplateMissingDependency
......
......@@ -32,7 +32,7 @@ from Products.CMFCore.utils import UniqueObject
from Acquisition import Implicit
from AccessControl import ClassSecurityInfo
from Globals import InitializeClass, DTMLFile, PersistentMapping
from Products.ERP5Type.Globals import InitializeClass, DTMLFile, PersistentMapping
from Products.ERP5Type.Tool.BaseTool import BaseTool
from Products.ERP5Type import Permissions
......
......@@ -28,7 +28,7 @@
from AccessControl import ClassSecurityInfo
from Globals import InitializeClass, DTMLFile
from Products.ERP5Type.Globals import InitializeClass, DTMLFile
from Products.ERP5Type.Tool.BaseTool import BaseTool
from Products.ERP5Type import Permissions
from Products.ERP5 import _dtmldir
......
......@@ -27,7 +27,7 @@
##############################################################################
from AccessControl import ClassSecurityInfo
from Globals import InitializeClass
from Products.ERP5Type.Globals import InitializeClass
from Products.CMFCore.utils import getToolByName
from Products.ERP5Type import Context, interfaces, Permissions
......@@ -35,6 +35,7 @@ from Products.ERP5Type.Base import Base
from Products.CMFCategory.Renderer import Renderer
from warnings import warn
from zope.interface import implements
class Variated(Base):
"""
......@@ -57,7 +58,7 @@ class Variated(Base):
security = ClassSecurityInfo()
# Declarative interfaces
__implements__ = (interfaces.IVariated, )
implements(interfaces.IVariated)
security.declareProtected(Permissions.AccessContentsInformation,
'getVariationBaseCategoryList')
......
......@@ -29,9 +29,11 @@
from Products.ERP5Type import interfaces, Permissions
from Products.ERP5Type.Context import Context
from Products.ERP5Type.Base import Base
from Globals import InitializeClass
from Products.ERP5Type.Globals import InitializeClass
from Products.ERP5.Variated import Variated
from zope.interface import implements
def newVariationValue(context=None, REQUEST=None, **kw):
# Create context object
context_obj = VariationValue(context=context, REQUEST=REQUEST, **kw)
......@@ -47,7 +49,7 @@ class VariationValue(Context, Variated):
"""
# Declarative interfaces
__implements__ = (interfaces.IVariated)
implements(interfaces.IVariated)
def __init__(self, context=None, REQUEST=None, **kw):
Context.__init__(self, context=context, REQUEST=REQUEST, **kw)
......
......@@ -40,7 +40,7 @@ from AccessControl import ModuleSecurityInfo
import MovementGroup
allow_class(MovementGroup)
from Globals import package_home
from Products.ERP5Type.Globals import package_home
product_path = package_home( globals() )
# Define object classes and tools
......
......@@ -40,7 +40,7 @@ from Products.ERP5Type.RoleInformation import RoleInformation
from App.config import getConfiguration
from Products.ERP5Type.tests.Sequence import SequenceList
from urllib import pathname2url
from Globals import PersistentMapping
from Products.ERP5Type.Globals import PersistentMapping
from Products.CMFCore.Expression import Expression
from Products.CMFCore.tests.base.testcase import LogInterceptor
import shutil
......
......@@ -276,7 +276,7 @@ class TestPredicates(TestPredicateMixIn):
from Products.ERP5Type.Document.Predicate import Predicate
predicate = self.createPredicate()
self.failUnless(IPredicate.isImplementedBy(predicate))
from Interface.Verify import verifyClass
from zope.interface.verify import verifyClass
verifyClass(IPredicate, Predicate)
......
......@@ -31,7 +31,7 @@ from AccessControl import ClassSecurityInfo
from Products.ERP5Type import Permissions
from Products.ERP5Type.Accessor.Base import Method, func_code
from Products.ERP5Type.Utils import convertToMixedCase, convertToUpperCase
from Globals import InitializeClass
from Products.ERP5Type.Globals import InitializeClass
class BaobabGetter(Method):
"""Get a category differently
......
......@@ -31,6 +31,8 @@ from AccessControl import ClassSecurityInfo
from Products.ERP5Type import Permissions, PropertySheet, Constraint, interfaces
from Products.ERP5.Document.Resource import Resource
from zope.interface import implements
from zLOG import LOG
......@@ -51,7 +53,7 @@ class CashCurrency(Resource):
security.declareObjectProtected(Permissions.View)
# Declarative interfaces
__implements__ = ( interfaces.IVariated, )
implements( interfaces.IVariated, )
# Declarative properties
property_sheets = ( PropertySheet.Base
......
......@@ -29,6 +29,7 @@
from AccessControl import ClassSecurityInfo
from Products.ERP5Type import Permissions, PropertySheet, Constraint, interfaces
from Products.ERP5Banking.Document.BankingOperation import BankingOperation
from zope.interface import implements
class CashDelivery(BankingOperation):
"""
......@@ -45,7 +46,7 @@ class CashDelivery(BankingOperation):
security.declareObjectProtected(Permissions.View)
# Declarative interfaces
__implements__ = ( interfaces.IVariated, )
implements( interfaces.IVariated, )
# Declarative properties
property_sheets = ( PropertySheet.Base
......
......@@ -30,6 +30,7 @@ from AccessControl import ClassSecurityInfo
from Products.ERP5Type import Permissions, PropertySheet, Constraint, interfaces
from Products.ERP5.Document.DeliveryCell import DeliveryCell
from Products.ERP5Banking.BaobabMixin import BaobabMixin
from zope.interface import implements
class CashDeliveryCell(BaobabMixin, DeliveryCell):
"""
......@@ -50,7 +51,7 @@ class CashDeliveryCell(BaobabMixin, DeliveryCell):
security.declareObjectProtected(Permissions.View)
# Declarative interfaces
__implements__ = ( interfaces.IVariated, )
implements( interfaces.IVariated, )
# Declarative properties
property_sheets = ( PropertySheet.Base
......
......@@ -30,6 +30,7 @@ from AccessControl import ClassSecurityInfo
from Products.ERP5Type import Permissions, PropertySheet, Constraint, interfaces
from Products.ERP5.Document.DeliveryLine import DeliveryLine
from Products.ERP5Banking.BaobabMixin import BaobabMixin
from zope.interface import implements
class CashDeliveryLine(BaobabMixin, DeliveryLine):
"""
......@@ -51,7 +52,7 @@ class CashDeliveryLine(BaobabMixin, DeliveryLine):
security.declareObjectProtected(Permissions.View)
# Declarative interfaces
__implements__ = ( interfaces.IVariated, )
implements( interfaces.IVariated, )
# Declarative properties
property_sheets = ( PropertySheet.Base
......
......@@ -30,6 +30,7 @@ from AccessControl import ClassSecurityInfo
from Products.ERP5Type import Permissions, PropertySheet, Constraint, interfaces
from Products.ERP5.Document.InventoryCell import InventoryCell
from Products.ERP5Banking.Document.CashDeliveryCell import CashDeliveryCell
from zope.interface import implements
class CashInventoryCell(InventoryCell, CashDeliveryCell):
"""
......@@ -47,7 +48,7 @@ class CashInventoryCell(InventoryCell, CashDeliveryCell):
security.declareObjectProtected(Permissions.View)
# Declarative interfaces
__implements__ = ( interfaces.IVariated, )
implements( interfaces.IVariated, )
# Declarative properties
property_sheets = ( PropertySheet.Base
......
......@@ -30,6 +30,7 @@ from AccessControl import ClassSecurityInfo
from Products.ERP5Type import Permissions, PropertySheet, Constraint, interfaces
from Products.ERP5Banking.Document.CashDeliveryLine import CashDeliveryLine
from Products.ERP5.Document.InventoryLine import InventoryLine
from zope.interface import implements
class CashInventoryLine(InventoryLine, CashDeliveryLine):
"""
......@@ -48,7 +49,7 @@ class CashInventoryLine(InventoryLine, CashDeliveryLine):
security.declareObjectProtected(Permissions.View)
# Declarative interfaces
__implements__ = ( interfaces.IVariated, )
implements( interfaces.IVariated, )
# Declarative properties
property_sheets = ( PropertySheet.Base
......
......@@ -30,6 +30,7 @@ from AccessControl import ClassSecurityInfo
from Products.ERP5Type import Permissions, PropertySheet, Constraint, interfaces
from Products.ERP5.Document.DeliveryLine import DeliveryLine
from Products.ERP5Banking.BaobabMixin import BaobabMixin
from zope.interface import implements
class CheckOperationLine(BaobabMixin, DeliveryLine):
"""Check Operation Line supports an operation (typically delivery) of a check.
......@@ -46,7 +47,7 @@ class CheckOperationLine(BaobabMixin, DeliveryLine):
security.declareObjectProtected(Permissions.AccessContentsInformation)
# Declarative interfaces
__implements__ = ( interfaces.IVariated, )
implements( interfaces.IVariated, )
# Declarative properties
property_sheets = ( PropertySheet.Base
......
......@@ -36,7 +36,7 @@ from AccessControl import ClassSecurityInfo, getSecurityManager
from Products.CMFCore.CatalogTool import IndexableObjectWrapper as CMFCoreIndexableObjectWrapper
from Products.CMFCore.utils import UniqueObject, _checkPermission, _getAuthenticatedUser, getToolByName
from Products.CMFCore.utils import _mergedLocalRoles
from Globals import InitializeClass, DTMLFile, package_home
from Products.ERP5Type.Globals import InitializeClass, DTMLFile, package_home
from Acquisition import aq_base, aq_inner, aq_parent, ImplicitAcquisitionWrapper
from DateTime.DateTime import DateTime
from Products.CMFActivity.ActiveObject import ActiveObject
......
......@@ -30,9 +30,9 @@
from AccessControl import ClassSecurityInfo
from Products.ERP5Type import PropertySheet, Permissions, interfaces
from Globals import InitializeClass
from Products.ERP5Type.Globals import InitializeClass
from Products.ERP5.Document.Predicate import Predicate
from zope.interface import implements
class Archive(Predicate):
"""
......@@ -51,7 +51,7 @@ class Archive(Predicate):
security.declareObjectProtected(Permissions.AccessContentsInformation)
# Declarative interfaces
__implements__ = ( interfaces.IPredicate, )
implements( interfaces.IPredicate, )
# Default Properties
property_sheets = ( PropertySheet.Base
......
......@@ -28,7 +28,7 @@
from AccessControl import ClassSecurityInfo
from Globals import InitializeClass, DTMLFile
from Products.ERP5Type.Globals import InitializeClass, DTMLFile
from Products.ERP5Type.Tool.BaseTool import BaseTool
from Products.ERP5Type import Permissions
from Products.ERP5Type.Cache import CachingMethod, clearCache
......
......@@ -30,7 +30,7 @@ from Products.ERP5Type.Utils import writeLocalPropertySheet, writeLocalDocument
from Products.PythonScripts.Utility import allow_class
from AccessControl import ClassSecurityInfo
from Products.ERP5Type import Permissions
from Globals import InitializeClass
from Products.ERP5Type.Globals import InitializeClass
class LocalGenerator:
""" Create Local PropertySheets and Documents
......
......@@ -34,7 +34,7 @@ from Products.CMFCore.utils import getToolByName
from Products.PageTemplates.PageTemplateFile import PageTemplateFile
from Globals import get_request
from Products.ERP5Type.Globals import get_request
from Products.PythonScripts.Utility import allow_class
from Products.PythonScripts.standard import url_quote_plus
......
......@@ -26,7 +26,7 @@
#
##############################################################################
from Globals import get_request
from Products.ERP5Type.Globals import get_request
from Products.Formulator.TALESField import TALESMethod
from Products.CMFCore.utils import getToolByName
......
import Globals
from Products.ERP5Type import Globals
from AccessControl import ClassSecurityInfo
from Products.CMFCore.CMFCorePermissions import View, ViewManagementScreens
......
......@@ -40,7 +40,7 @@ from Products.CMFCore.exceptions import AccessControl_Unauthorized
from Products.ERP5Type import PropertySheet, Permissions
from urllib import quote
from Globals import InitializeClass, PersistentMapping, DTMLFile, get_request
from Products.ERP5Type.Globals import InitializeClass, PersistentMapping, DTMLFile, get_request
from AccessControl import Unauthorized, getSecurityManager, ClassSecurityInfo
from ZODB.POSException import ConflictError
from Acquisition import aq_base
......
......@@ -34,7 +34,7 @@ from Products.CMFCore.utils import getToolByName
from Products.PageTemplates.PageTemplateFile import PageTemplateFile
from Globals import get_request
from Products.ERP5Type.Globals import get_request
from Products.PythonScripts.Utility import allow_class
from Products.PythonScripts.standard import url_quote_plus
......
......@@ -42,10 +42,11 @@ from Products.ZSQLCatalog.zsqlbrain import ZSQLBrain
from Products.ERP5Type.Message import Message
from Acquisition import aq_base, aq_self
import Acquisition
from zLOG import LOG, WARNING
from ZODB.POSException import ConflictError
from Globals import InitializeClass, Acquisition, get_request
from Products.ERP5Type.Globals import InitializeClass, get_request
from Products.PythonScripts.Utility import allow_class
from Products.PageTemplates.PageTemplateFile import PageTemplateFile
......
......@@ -38,7 +38,7 @@ from AccessControl import ClassSecurityInfo
from types import StringType
from zLOG import LOG
from Products.Formulator.DummyField import fields
from Globals import get_request
from Products.ERP5Type.Globals import get_request
from AccessControl import Unauthorized
from AccessControl import getSecurityManager
......
......@@ -31,7 +31,7 @@ from Products.Formulator import Widget, Validator
from Products.Formulator.DummyField import fields
from Products.Formulator.Field import ZMIField
from Selection import Selection
from Globals import get_request
from Products.ERP5Type.Globals import get_request
from Products.ERP5OOo.Document.OOoDocument import STANDARD_IMAGE_FORMAT_LIST
from zLOG import LOG
......
......@@ -33,7 +33,7 @@ from Products.PageTemplates.Expressions import getEngine
from Products.PageTemplates.TALES import SafeMapping
from urllib import quote
from Globals import InitializeClass, PersistentMapping, DTMLFile
from Products.ERP5Type.Globals import InitializeClass, PersistentMapping, DTMLFile
from AccessControl import ClassSecurityInfo
from AccessControl.SecurityInfo import allow_class
......
......@@ -36,7 +36,7 @@ from Products.PageTemplates.PageTemplateFile import PageTemplateFile
from Products.ERP5Type import PropertySheet
from urllib import quote
from Globals import InitializeClass, PersistentMapping, DTMLFile, get_request
from Products.ERP5Type.Globals import InitializeClass, PersistentMapping, DTMLFile, get_request
from AccessControl import Unauthorized, getSecurityManager, ClassSecurityInfo
import urllib2
from ZODB.POSException import ConflictError
......
......@@ -34,7 +34,7 @@ from Products.CMFCore.utils import getToolByName
from Products.PageTemplates.PageTemplateFile import PageTemplateFile
from Globals import get_request
from Products.ERP5Type.Globals import get_request
from Products.PythonScripts.Utility import allow_class
from Products.PythonScripts.standard import url_quote_plus
......
......@@ -39,7 +39,7 @@
# Class monitoring access security control
from Products.PythonScripts.Utility import allow_class
from Globals import InitializeClass
from Products.ERP5Type.Globals import InitializeClass
from Products.ERP5Form.ListBox import lazyMethod
from Products.Formulator.Field import ZMIField
......
......@@ -28,7 +28,7 @@
from AccessControl import ClassSecurityInfo, getSecurityManager
from MethodObject import Method
from Globals import InitializeClass, DTMLFile
from Products.ERP5Type.Globals import InitializeClass, DTMLFile
from zLOG import LOG, PROBLEM
from Products.CMFCore.utils import getToolByName
......
......@@ -38,7 +38,7 @@ from Products.CMFCore.utils import getToolByName
from Products.PageTemplates.PageTemplateFile import PageTemplateFile
from Globals import get_request
from Products.ERP5Type.Globals import get_request
from Products.PythonScripts.Utility import allow_class
from Products.PythonScripts.standard import url_quote_plus
......@@ -48,7 +48,7 @@ from MethodObject import Method
from zLOG import LOG, WARNING, DEBUG, PROBLEM
from Acquisition import aq_base, aq_inner, aq_acquire, aq_chain
from Globals import DTMLFile
from Products.ERP5Type.Globals import DTMLFile
from Products.Formulator.TALESField import TALESMethod
from Products.ERP5Form.Form import StaticValue, TALESValue, OverrideValue, DefaultValue, EditableValue
......
......@@ -26,7 +26,7 @@
#
##############################################################################
from Globals import InitializeClass, DTMLFile, get_request
from Products.ERP5Type.Globals import InitializeClass, DTMLFile, get_request
from AccessControl import ClassSecurityInfo
from Acquisition import aq_base
from Products.PythonScripts.Utility import allow_class
......
......@@ -26,7 +26,7 @@
#
##############################################################################
from Globals import get_request
from Products.ERP5Type.Globals import get_request
from AccessControl.ZopeGuards import guarded_getattr
from Products.Formulator import Widget, Validator
from Products.Formulator.Field import ZMIField
......
......@@ -32,7 +32,7 @@ from ZPublisher.HTTPRequest import FileUpload
from xml.dom.ext.reader import PyExpat
from xml.dom import Node, minidom
from AccessControl import ClassSecurityInfo
from Globals import InitializeClass, get_request
from Products.ERP5Type.Globals import InitializeClass, get_request
from zipfile import ZipFile, ZIP_DEFLATED
from StringIO import StringIO
from zLOG import LOG, TRACE, WARNING, ERROR, INFO
......
......@@ -26,7 +26,8 @@
#
##############################################################################
from Globals import InitializeClass, Persistent, Acquisition
from Products.ERP5Type.Globals import InitializeClass, Persistent
import Acquisition
from Acquisition import aq_base
from OFS.Traversable import Traversable
from AccessControl import ClassSecurityInfo
......
......@@ -33,7 +33,7 @@
from OFS.SimpleItem import SimpleItem
from Products.CMFCore.utils import UniqueObject
from Globals import InitializeClass, DTMLFile, PersistentMapping, get_request
from Products.ERP5Type.Globals import InitializeClass, DTMLFile, PersistentMapping, get_request
from AccessControl import ClassSecurityInfo
from Products.ERP5Type.Tool.BaseTool import BaseTool
from Products.ERP5Type import Permissions as ERP5Permissions
......
......@@ -44,7 +44,7 @@ def get_request():
return request
# apply patch (before it's imported by other modules)
import Globals
from Products.ERP5Type import Globals
Globals.get_request = get_request
......
......@@ -35,7 +35,7 @@ from AccessControl.SecurityManagement import newSecurityManager
from zLOG import LOG
from Products.ERP5Type.tests.Sequence import SequenceList
from Testing import ZopeTestCase
from Globals import get_request
from Products.ERP5Type.Globals import get_request
from Products.ERP5Type.tests.utils import createZODBPythonScript
from ZPublisher.HTTPRequest import FileUpload
from StringIO import StringIO
......
......@@ -35,7 +35,7 @@ from Products.ERP5Form.Selection import Selection
from Testing import ZopeTestCase
from Products.ERP5OOo.tests.utils import Validator
from Acquisition import aq_base
from Globals import get_request
from Products.ERP5Type.Globals import get_request
from Products.ERP5OOo.Document.OOoDocument import STANDARD_IMAGE_FORMAT_LIST
from Products.ERP5Type.Core.Folder import Folder
......
......@@ -29,7 +29,7 @@
from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase
from AccessControl.SecurityManagement import newSecurityManager
from Products.ERP5Type.tests.Sequence import SequenceList
from Globals import get_request
from Products.ERP5Type.Globals import get_request
from StringIO import StringIO
from DateTime import DateTime
......
......@@ -40,7 +40,7 @@ def get_request():
return request
# apply patch (before it's imported by other modules)
import Globals
from Products.ERP5Type import Globals
Globals.get_request = get_request
from Products.Formulator.TALESField import TALESMethod
......
......@@ -34,7 +34,7 @@ from Products.ERP5Form.ImageField import ImageField
from Products.ERP5OOo.OOoUtils import OOoBuilder
from Products.CMFCore.exceptions import AccessControl_Unauthorized
from Acquisition import Implicit, aq_base
from Globals import InitializeClass, DTMLFile, Persistent, get_request
from Products.ERP5Type.Globals import InitializeClass, DTMLFile, Persistent, get_request
from AccessControl import ClassSecurityInfo
from AccessControl.Role import RoleManager
from OFS.SimpleItem import Item
......
......@@ -39,8 +39,8 @@ from Products.PageTemplates.PageTemplateFile import PageTemplateFile
from TAL.TALInterpreter import FasterStringIO
from Products.ERP5Type import PropertySheet
from urllib import quote
from Globals import InitializeClass, DTMLFile, get_request
from Globals import DevelopmentMode
from Products.ERP5Type.Globals import InitializeClass, DTMLFile, get_request
from Products.ERP5Type.Globals import DevelopmentMode
from Acquisition import aq_base
from AccessControl import ClassSecurityInfo
from OOoUtils import OOoBuilder
......
......@@ -36,7 +36,7 @@ from Products.PythonScripts.Utility import allow_class
from ZPublisher.HTTPRequest import FileUpload
from xml.dom import Node
from AccessControl import ClassSecurityInfo
from Globals import InitializeClass, get_request
from Products.ERP5Type.Globals import InitializeClass, get_request
from zipfile import ZipFile, ZIP_DEFLATED
try:
from cStringIO import StringIO
......
from Products.PortalTransforms.interfaces import itransform
from zope.interface import implements
from oood_commandtransform import OOOdCommandTransform, OOoDocumentDataStream
from zLOG import LOG
class HTMLToOdt:
"""Transforms HTML to odt by using oood"""
__implements__ = itransform
implements(itransform)
__name__ = 'html_to_odt'
inputs = ('text/html',)
......
from Products.PortalTransforms.interfaces import itransform
from zope.interface import implements
from oood_commandtransform import OOOdCommandTransform, OOoDocumentDataStream
from zLOG import LOG
......@@ -6,7 +7,7 @@ from zLOG import LOG
class OdtToDoc:
"""Transforms ODT to Doc by using oood"""
__implements__ = itransform
implements(itransform)
__name__ = 'odt_to_doc'
inputs = ('application/vnd.oasis.opendocument.text',)
......
from Products.PortalTransforms.interfaces import itransform
from zope.interface import implements
from oood_commandtransform import OOOdCommandTransform, OOoDocumentDataStream
from zLOG import LOG
......@@ -6,7 +7,7 @@ from zLOG import LOG
class OdtToPdf:
"""Transforms ODT to PDF by using oood"""
__implements__ = itransform
implements(itransform)
__name__ = 'odt_to_pdf'
inputs = ('application/vnd.oasis.opendocument.text',)
......
from Products.PortalTransforms.interfaces import itransform
from zope.interface import implements
from oood_commandtransform import OOOdCommandTransform, OOoDocumentDataStream
from zLOG import LOG
from Products.ERP5OOo.OOoUtils import OOoBuilder
......@@ -7,7 +8,7 @@ import re
class OdtToXml:
"""Transforms ODT to Doc by using oood"""
__implements__ = itransform
implements(itransform)
__name__ = 'odt_to_xml'
inputs = ('application/vnd.oasis.opendocument.text',)
......
......@@ -3,6 +3,7 @@ from Products.PortalTransforms.interfaces import idatastream
from Products.ERP5Type.Document import newTempOOoDocument
from Products.CMFCore.utils import getToolByName
from Acquisition import aq_base
from zope.interface import implements
try:
from Products.ERP5OOo.OOoUtils import OOoBuilder
import re
......@@ -20,7 +21,7 @@ class TransformError(Exception):
class OOoDocumentDataStream:
"""Handle OOoDocument in Portal Transforms"""
__implements__ = idatastream
implements(idatastream)
def setData(self, value):
"""set the main"""
......
......@@ -15,7 +15,7 @@
""" Classes: ERP5GroupManager
"""
from Globals import InitializeClass
from Products.ERP5Type.Globals import InitializeClass
from AccessControl import ClassSecurityInfo
from AccessControl.SecurityManagement import newSecurityManager,\
getSecurityManager, setSecurityManager
......
......@@ -15,7 +15,7 @@
""" Classes: ERP5RoleManager
"""
from Globals import InitializeClass
from Products.ERP5Type.Globals import InitializeClass
from AccessControl import ClassSecurityInfo
from Products.PageTemplates.PageTemplateFile import PageTemplateFile
from Products.PluggableAuthService.plugins.BasePlugin import BasePlugin
......
......@@ -15,7 +15,7 @@
""" Classes: ERP5User, ERP5UserFactory
"""
from Globals import InitializeClass
from Products.ERP5Type.Globals import InitializeClass
from Acquisition import aq_inner, aq_parent
from AccessControl import ClassSecurityInfo
from Products.PageTemplates.PageTemplateFile import PageTemplateFile
......
......@@ -15,7 +15,7 @@
""" Classes: ERP5UserManager
"""
from Globals import InitializeClass
from Products.ERP5Type.Globals import InitializeClass
from AccessControl import ClassSecurityInfo
from AccessControl.SecurityManagement import getSecurityManager,\
setSecurityManager, newSecurityManager
......
......@@ -39,10 +39,7 @@ from AccessControl.SecurityManagement import getSecurityManager
from zLOG import LOG
from Products.ERP5Type.Cache import clearCache
from Products.PluggableAuthService import PluggableAuthService
try:
from Interface.Verify import verifyClass
except ImportError:
from zope.interface.verify import verifyClass
from zope.interface.verify import verifyClass
from DateTime import DateTime
class TestUserManagement(ERP5TypeTestCase):
......
......@@ -35,7 +35,7 @@ import os
import sys
from Products.ERP5Type.Utils import convertToUpperCase
from MethodObject import Method
from Globals import InitializeClass
from Products.ERP5Type.Globals import InitializeClass
from AccessControl import ClassSecurityInfo
from Products.PythonScripts.Utility import allow_class
from tempfile import mktemp
......
......@@ -30,7 +30,7 @@
from Products.CMFCore.utils import UniqueObject
from Products.ERP5Type.Tool.BaseTool import BaseTool
from AccessControl import ClassSecurityInfo
from Globals import InitializeClass, DTMLFile
from Products.ERP5Type.Globals import InitializeClass, DTMLFile
from Products.ERP5Type.Core.Folder import Folder
from Products.ERP5Type import Permissions
from Products.ERP5Subversion import _dtmldir
......
......@@ -34,7 +34,7 @@ from email.MIMEBase import MIMEBase
from email import Encoders
from AccessControl import ClassSecurityInfo
from Products.ERP5Type import Permissions, interfaces
from Globals import PersistentMapping
from Products.ERP5Type.Globals import PersistentMapping
import pickle
from xml.sax.saxutils import escape, unescape
from cStringIO import StringIO
......@@ -47,6 +47,7 @@ from xml.marshal.generic import loads as unmarshaler
from zLOG import LOG, INFO, DEBUG
from base64 import standard_b64decode
from OFS.Image import Pdata
from zope.interface import implements
class ERP5Conduit(XMLSyncUtilsMixin):
"""
......@@ -86,7 +87,7 @@ class ERP5Conduit(XMLSyncUtilsMixin):
"""
# Declarative interfaces
__implements__ = ( interfaces.IConduit, )
implements( interfaces.IConduit, )
# Declarative security
security = ClassSecurityInfo()
......
......@@ -27,7 +27,7 @@
#
##############################################################################
from Globals import PersistentMapping
from Products.ERP5Type.Globals import PersistentMapping
from time import gmtime,strftime # for anchors
from SyncCode import SyncCode
from AccessControl import ClassSecurityInfo
......
......@@ -26,7 +26,7 @@
#
##############################################################################
from Globals import Persistent, PersistentMapping
from Products.ERP5Type.Globals import Persistent, PersistentMapping
from SyncCode import SyncCode
from Subscription import Subscription
from Products.ERP5Type import Permissions
......
......@@ -27,7 +27,7 @@
#
##############################################################################
from Globals import PersistentMapping
from Products.ERP5Type.Globals import PersistentMapping
from time import gmtime,strftime # for anchors
from SyncCode import SyncCode
from AccessControl import ClassSecurityInfo
......
......@@ -26,7 +26,7 @@
#
##############################################################################
from Globals import PersistentMapping
from Products.ERP5Type.Globals import PersistentMapping
from time import gmtime, strftime # for anchors
from SyncCode import SyncCode
from AccessControl import ClassSecurityInfo
......
......@@ -27,7 +27,7 @@
##############################################################################
from Products.ERP5Type.Accessor.TypeDefinition import list_types
from Globals import Persistent
from Products.ERP5Type.Globals import Persistent
import re
class SyncCode(Persistent):
......
......@@ -32,7 +32,7 @@ from OFS.SimpleItem import SimpleItem
from Products.ERP5Type.Core.Folder import Folder
from Products.ERP5Type.Base import Base
from Products.CMFCore.utils import UniqueObject
from Globals import InitializeClass, DTMLFile, PersistentMapping, Persistent
from Products.ERP5Type.Globals import InitializeClass, DTMLFile, PersistentMapping, Persistent
from AccessControl import ClassSecurityInfo, getSecurityManager
from Products.CMFCore import CMFCorePermissions
from Products.ERP5SyncML import _dtmldir
......
......@@ -26,7 +26,7 @@
#
##############################################################################
from Interface import Interface
from zope.interface import Interface
class IConduit(Interface):
"""
......
......@@ -32,7 +32,7 @@ from copy import copy
import warnings
import types
from Globals import InitializeClass, DTMLFile
from Products.ERP5Type.Globals import InitializeClass, DTMLFile
from AccessControl import ClassSecurityInfo
from AccessControl.Permission import pname, Permission
from AccessControl.PermissionRole import rolesForPermissionOn
......
......@@ -31,12 +31,13 @@
from Products.CMFCore.Expression import Expression
from Products.ERP5Type.interfaces import IConstraint
from Products.ERP5Type.ConsistencyMessage import ConsistencyMessage
from zope.interface import implements
class Constraint:
"""
Default Constraint implementation
"""
__implements__ = (IConstraint, )
implements( IConstraint, )
_message_id_list = []
......
......@@ -28,7 +28,7 @@
from Acquisition import aq_base
from Globals import InitializeClass
from Products.ERP5Type.Globals import InitializeClass
from Products.ERP5Type.Base import TempBase
from zLOG import LOG
......
......@@ -24,7 +24,7 @@ from OFS.CopySupport import sanity_check
from Products.ERP5Type import Permissions
from Acquisition import aq_base, aq_inner, aq_parent
from Products.CMFCore.utils import getToolByName
from Globals import PersistentMapping, MessageDialog
from Products.ERP5Type.Globals import PersistentMapping, MessageDialog
from Products.ERP5Type.Utils import get_request
from Products.ERP5Type.Message import translateString
from Products.CMFCore.WorkflowCore import WorkflowException
......
......@@ -31,7 +31,7 @@
import zope.interface
from AccessControl import ClassSecurityInfo
from Acquisition import aq_base
from Globals import InitializeClass
from Products.ERP5Type.Globals import InitializeClass
from OFS.SimpleItem import SimpleItem
from Products.CMFCore.utils import getToolByName
......
# ERP5Type has a specific __init__ file to circumvent circular references
## Hide internal implementation
#from Globals import InitializeClass
#from Products.ERP5Type.Globals import InitializeClass
#import Products.ERP5Type.Core.Folder as ERP5Folder
## Default constructor for Folder
## Can be overriden by adding a method addFolder in class Folder
......
......@@ -27,7 +27,7 @@
##############################################################################
from AccessControl import ClassSecurityInfo
from Globals import InitializeClass
from Products.ERP5Type.Globals import InitializeClass
from DocumentationHelper import DocumentationHelper, getCallableSignatureString
from Products.ERP5Type import Permissions
......
......@@ -27,7 +27,7 @@
##############################################################################
from AccessControl import ClassSecurityInfo
from Globals import InitializeClass
from Products.ERP5Type.Globals import InitializeClass
from DocumentationHelper import DocumentationHelper
from DocumentationSection import DocumentationSection
from Products.ERP5Type import Permissions
......
......@@ -29,7 +29,7 @@
##############################################################################
from AccessControl import ClassSecurityInfo
from Globals import InitializeClass
from Products.ERP5Type.Globals import InitializeClass
from DocumentationHelper import DocumentationHelper
from DocumentationSection import DocumentationSection
from Products.ERP5Type import Permissions
......
......@@ -28,7 +28,7 @@
##############################################################################
from AccessControl import ClassSecurityInfo
from Globals import InitializeClass
from Products.ERP5Type.Globals import InitializeClass
from Products.ERP5Type import Permissions
from PortalTypeDocumentationHelper import PortalTypeDocumentationHelper
......
......@@ -27,7 +27,7 @@
##############################################################################
from AccessControl import ClassSecurityInfo
from Globals import InitializeClass
from Products.ERP5Type.Globals import InitializeClass
from DocumentationHelper import DocumentationHelper
from Products.ERP5Type import Permissions
......
......@@ -27,7 +27,7 @@
##############################################################################
from AccessControl import ClassSecurityInfo
from Globals import InitializeClass
from Products.ERP5Type.Globals import InitializeClass
from ZSQLMethodDocumentationHelper import ZSQLMethodDocumentationHelper
from Products.ERP5Type import Permissions
......
......@@ -27,7 +27,7 @@
##############################################################################
from AccessControl import ClassSecurityInfo
from Globals import InitializeClass
from Products.ERP5Type.Globals import InitializeClass
from DocumentationHelper import DocumentationHelper, getCallableSignatureString
from Products.ERP5Type import Permissions
......
......@@ -27,7 +27,7 @@
##############################################################################
from AccessControl import ClassSecurityInfo
from Globals import InitializeClass
from Products.ERP5Type.Globals import InitializeClass
from DocumentationHelper import DocumentationHelper
from Products.ERP5Type import Permissions
from Products.DCWorkflowGraph.DCWorkflowGraph import getGraph
......
......@@ -27,7 +27,7 @@
##############################################################################
from AccessControl import ClassSecurityInfo
from Globals import InitializeClass
from Products.ERP5Type.Globals import InitializeClass
from ScriptPythonDocumentationHelper import ScriptPythonDocumentationHelper
from Products.ERP5Type import Permissions
......
......@@ -27,7 +27,7 @@
##############################################################################
from AccessControl import ClassSecurityInfo
from Globals import InitializeClass
from Products.ERP5Type.Globals import InitializeClass
from Products.ERP5Type import Permissions
from DocumentationHelper import DocumentationHelper
from DCWorkflowDocumentationHelper import getRoleList, permission_code_dict
......
......@@ -27,7 +27,7 @@
##############################################################################
from AccessControl import ClassSecurityInfo
from Globals import InitializeClass
from Products.ERP5Type.Globals import InitializeClass
from DocumentationHelper import DocumentationHelper
from Products.ERP5Type import Permissions
......
......@@ -27,7 +27,7 @@
##############################################################################
from AccessControl import ClassSecurityInfo
from Globals import InitializeClass
from Products.ERP5Type.Globals import InitializeClass
from DocumentationHelper import DocumentationHelper
from Products.ERP5Type import Permissions
......
......@@ -27,7 +27,7 @@
##############################################################################
from AccessControl import ClassSecurityInfo
from Globals import InitializeClass
from Products.ERP5Type.Globals import InitializeClass
from DocumentationHelper import DocumentationHelper
from Products.ERP5Type import Permissions
......
......@@ -29,7 +29,7 @@
from urllib import quote
from Acquisition import Implicit, aq_base
from AccessControl import ClassSecurityInfo
from Globals import InitializeClass
from Products.ERP5Type.Globals import InitializeClass
from Products.ERP5Type import Permissions
from App.config import getConfiguration
import os
......
......@@ -28,7 +28,7 @@
from Acquisition import Implicit
from AccessControl import ClassSecurityInfo
from Globals import InitializeClass
from Products.ERP5Type.Globals import InitializeClass
from Products.ERP5Type import Permissions
from Products.PythonScripts.Utility import allow_class
......
......@@ -27,7 +27,7 @@
##############################################################################
from AccessControl import ClassSecurityInfo
from Globals import InitializeClass
from Products.ERP5Type.Globals import InitializeClass
from DocumentationHelper import DocumentationHelper
from Products.ERP5Type import Permissions
......
......@@ -28,7 +28,7 @@
##############################################################################
from AccessControl import ClassSecurityInfo
from Globals import InitializeClass
from Products.ERP5Type.Globals import InitializeClass
from DocumentationHelper import DocumentationHelper
from Products.ERP5Type import Permissions
......
......@@ -27,7 +27,7 @@
##############################################################################
from AccessControl import ClassSecurityInfo
from Globals import InitializeClass
from Products.ERP5Type.Globals import InitializeClass
from DocumentationHelper import DocumentationHelper
from Products.ERP5Type import Permissions
......
......@@ -27,7 +27,7 @@
##############################################################################
from AccessControl import ClassSecurityInfo
from Globals import InitializeClass
from Products.ERP5Type.Globals import InitializeClass
from DCWorkflowDocumentationHelper import DCWorkflowDocumentationHelper
from Products.ERP5Type import Permissions
......
from Acquisition import Implicit
from AccessControl import ClassSecurityInfo
from Globals import InitializeClass
from Products.ERP5Type.Globals import InitializeClass
from Products.CMFCore.utils import getToolByName
......
......@@ -27,7 +27,7 @@
##############################################################################
from AccessControl import ClassSecurityInfo
from Globals import InitializeClass
from Products.ERP5Type.Globals import InitializeClass
from DocumentationHelper import DocumentationHelper
from Products.ERP5Type import Permissions
......
......@@ -27,7 +27,7 @@
##############################################################################
from AccessControl import ClassSecurityInfo
from Globals import InitializeClass
from Products.ERP5Type.Globals import InitializeClass
from DocumentationHelper import DocumentationHelper
class PortalDocumentationHelper(DocumentationHelper):
......
......@@ -27,7 +27,7 @@
##############################################################################
from AccessControl import ClassSecurityInfo
from Globals import InitializeClass
from Products.ERP5Type.Globals import InitializeClass
from DocumentationHelper import DocumentationHelper
from Products.ERP5Type import Permissions
......
......@@ -27,7 +27,7 @@
##############################################################################
from AccessControl import ClassSecurityInfo
from Globals import InitializeClass
from Products.ERP5Type.Globals import InitializeClass
from Products.ERP5Type import Permissions
from Products.ERP5Type.Base import Base
from DocumentationHelper import DocumentationHelper, TempObjectLibrary
......
......@@ -27,7 +27,7 @@
##############################################################################
from AccessControl import ClassSecurityInfo
from Globals import InitializeClass
from Products.ERP5Type.Globals import InitializeClass
from DocumentationHelper import DocumentationHelper
from DocumentationSection import DocumentationSection
from Products.ERP5Type import Permissions
......
......@@ -27,7 +27,7 @@
##############################################################################
from AccessControl import ClassSecurityInfo
from Globals import InitializeClass
from Products.ERP5Type.Globals import InitializeClass
from DocumentationHelper import DocumentationHelper
from Products.ERP5Type import Permissions
from Products.CMFCore.utils import getToolByName
......
......@@ -27,7 +27,7 @@
##############################################################################
from AccessControl import ClassSecurityInfo
from Globals import InitializeClass
from Products.ERP5Type.Globals import InitializeClass
from DocumentationHelper import DocumentationHelper
from Products.ERP5Type import Permissions
......
......@@ -27,7 +27,7 @@
##############################################################################
from AccessControl import ClassSecurityInfo
from Globals import InitializeClass
from Products.ERP5Type.Globals import InitializeClass
from DocumentationHelper import DocumentationHelper
from Products.ERP5Type import Permissions
......
......@@ -27,7 +27,7 @@
##############################################################################
from AccessControl import ClassSecurityInfo
from Globals import InitializeClass
from Products.ERP5Type.Globals import InitializeClass
from DocumentationHelper import DocumentationHelper
from Products.ERP5Type import Permissions
......
......@@ -28,7 +28,7 @@
from AccessControl import ClassSecurityInfo
from Acquisition import aq_base
from Globals import InitializeClass
from Products.ERP5Type.Globals import InitializeClass
from DocumentationHelper import DocumentationHelper
from Products.ERP5Type import Permissions
......
......@@ -27,7 +27,7 @@
##############################################################################
from AccessControl import ClassSecurityInfo
from Globals import InitializeClass
from Products.ERP5Type.Globals import InitializeClass
from DocumentationHelper import DocumentationHelper
from Products.ERP5Type import Permissions
......
......@@ -27,7 +27,7 @@
##############################################################################
from AccessControl import ClassSecurityInfo
from Globals import InitializeClass
from Products.ERP5Type.Globals import InitializeClass
from DocumentationHelper import DocumentationHelper, getCallableSignatureString
from Products.ERP5Type import Permissions
......
......@@ -27,7 +27,7 @@
##############################################################################
from AccessControl import ClassSecurityInfo
from Globals import InitializeClass
from Products.ERP5Type.Globals import InitializeClass
from DocumentationHelper import DocumentationHelper
from Products.ERP5Type import Permissions
......
......@@ -21,7 +21,7 @@
##############################################################################
import zope.interface
from Globals import InitializeClass
from Products.ERP5Type.Globals import InitializeClass
from AccessControl import ClassSecurityInfo, getSecurityManager
from Acquisition import aq_base, aq_inner, aq_parent
......
......@@ -29,7 +29,7 @@
from Products.ERP5Type.Base import Base
from Products.ERP5Type.Utils import getPath
from zLOG import LOG
from Globals import InitializeClass, DTMLFile
from Products.ERP5Type.Globals import InitializeClass, DTMLFile
from Products.PythonScripts.Utility import allow_class
class Error:
......
##############################################################################
#
# Copyright (c) 2002 Nexedi SARL and Contributors. All Rights Reserved.
# Jean-Paul Smets-Solanes <jp@nexedi.com>
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsability of assessing all potential
# consequences resulting from its eventual inadequacies and bugs
# End users who are looking for a ready-to-use solution with commercial
# garantees and support are strongly adviced to contract a Free Software
# Service Company
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
##############################################################################
"""
ERP5Type.Globals is a class to smoothen transition from Zope 2.8 to 2.12,
where the Globals module has been removed. All ERP5 Code should import
from ERP5Type.Globals instead of Globals
"""
# Globals.InitializeClass a.k.a. default__class_init__. This import location
# has not changed since 2.8 and still works on 2.12
from App.class_init import default__class_init__, ApplicationDefaultPermissions
# Nicer alias for class initializer.
InitializeClass = default__class_init__
##########################################
# Localizer is not always loaded prior to ERP5 products,
# thus, as Localizer is supposed to patch Global to add get_request to it,
# we prefer to redefine get_request inside ERP5Type/Utils,
# to avoid the case when Global wasn't patched and get_request is not available.
# This is specially important on Zope 2.12 where Globals doesn't even exist.
##########################################
try:
import Products.iHotfix
get_request = Products.iHotfix.get_request
except (ImportError, AttributeError):
import Products.Localizer
get_request = Products.Localizer.get_request
# Persistency stuff also hasn't moved much from Zope 2.8, although the old
# "Persistence" module remains there for ancient backward compatibility.
# let's try using the new 'persistence' implementation only and see how far we
# can get. This might not be enough for content in old ZODBs, though...
from Persistence import Persistent, PersistentMapping
from App.special_dtml import HTML, HTMLFile, DTMLFile
from App.Common import package_home
from App.Dialogs import MessageDialog
from App.config import getConfiguration as _getConfiguration
_cfg = _getConfiguration()
DevelopmentMode = _cfg.debug_mode
# backward compatibility
INSTANCE_HOME = _cfg.instancehome
SOFTWARE_HOME = _cfg.softwarehome
ZOPE_HOME = _cfg.zopehome
# don't tempt potential users by leaving these lying around
del _cfg, _getConfiguration
......@@ -29,7 +29,7 @@
import os, re, string, sys
from Globals import package_home, InitializeClass
from Products.ERP5Type.Globals import package_home, InitializeClass
from zLOG import LOG
......
......@@ -26,11 +26,25 @@
#
##############################################################################
from Globals import InitializeClass, Persistent
from Products.ERP5Type.Globals import InitializeClass, Persistent
from AccessControl import ClassSecurityInfo
from Products.PythonScripts.Utility import allow_class
from Products.PageTemplates.GlobalTranslationService import getGlobalTranslationService
from Globals import get_request
try:
from Products.PageTemplates.GlobalTranslationService import getGlobalTranslationService
except ImportError:
import zLOG, sys
zLOG.LOG('Products.ERP5Type.Messages',
zLOG.ERROR,
'Products.PageTemplates.GlobalTranslationService has been removed. '
'Translation services for Message will be disabled',
error=sys.exc_info())
def getGlobalTranslationService():
zLOG.LOG('Products.ERP5Type.Messages',
zLOG.WARNING,
'not returning a translation service!')
return None
from Products.ERP5Type.Globals import get_request
from cPickle import dumps, loads
try:
......
......@@ -79,7 +79,7 @@ class ObjectMessage:
"""
Get the Object.
"""
from Globals import get_request
from Products.ERP5Type.Globals import get_request
request = get_request()['PARENTS']
if request is not None:
for item in request:
......
......@@ -26,7 +26,7 @@
#
##############################################################################
from Globals import InitializeClass
from Products.ERP5Type.Globals import InitializeClass
from AccessControl import ClassSecurityInfo
from Products.ERP5Type import Permissions
from Products.ERP5Type.Errors import SSHConnectionError
......
......@@ -29,7 +29,7 @@
from Products.CMFCore.utils import UniqueObject
from AccessControl import ClassSecurityInfo
from Globals import InitializeClass, DTMLFile
from Products.ERP5Type.Globals import InitializeClass, DTMLFile
from Products.ERP5Type.Core.Folder import Folder
from Products.ERP5Type import Permissions, _dtmldir
......
......@@ -32,7 +32,7 @@
from AccessControl import ClassSecurityInfo
from Products.ERP5Type.Tool.BaseTool import BaseTool
from Products.ERP5Type import Permissions
from Globals import InitializeClass, DTMLFile, PersistentMapping
from Products.ERP5Type.Globals import InitializeClass, DTMLFile, PersistentMapping
from Products.ERP5Type import _dtmldir
from Products.ERP5Type.Cache import CacheFactory
from Products.ERP5Type.Cache import CachingMethod
......
......@@ -37,7 +37,7 @@ from Products.CMFCore.utils import UniqueObject
from zExceptions import BadRequest
from Acquisition import Implicit
from AccessControl import ClassSecurityInfo
from Globals import InitializeClass, DTMLFile
from Products.ERP5Type.Globals import InitializeClass, DTMLFile
from App.config import getConfiguration
from Shared.DC.ZRDB.TM import TM
from Products.PageTemplates.PageTemplateFile import PageTemplateFile
......
......@@ -31,7 +31,7 @@ from threading import local
from Products.ERP5Type.Tool.BaseTool import BaseTool
from Products.ERP5Type import Permissions, _dtmldir
from AccessControl import ClassSecurityInfo
from Globals import DTMLFile
from Products.ERP5Type.Globals import DTMLFile
MEMCACHED_TOOL_MODIFIED_FLAG_PROPERTY_ID = '_v_memcached_edited'
......
......@@ -30,7 +30,7 @@
import sys
from zLOG import LOG, WARNING
from AccessControl import ClassSecurityInfo
from Globals import InitializeClass, DTMLFile
from Products.ERP5Type.Globals import InitializeClass, DTMLFile
from Products.ERP5Type.Tool.BaseTool import BaseTool
from Products.ERP5Type import Permissions
from Products.ERP5Type import _dtmldir
......
......@@ -12,7 +12,7 @@
#
##############################################################################
from Globals import InitializeClass
from Products.ERP5Type.Globals import InitializeClass
from AccessControl import ClassSecurityInfo
from Products.CMFCore.Expression import Expression
from Products.ERP5Type import _dtmldir
......
......@@ -36,8 +36,8 @@ import warnings
from md5 import new as md5_new
from sha import new as sha_new
from Globals import package_home
from Globals import DevelopmentMode
from Products.ERP5Type.Globals import package_home
from Products.ERP5Type.Globals import DevelopmentMode
from Acquisition import aq_base
from Acquisition import aq_inner
from Acquisition import aq_parent
......@@ -64,6 +64,11 @@ from zLOG import LOG, BLATHER, PROBLEM, WARNING
from AccessControl.SecurityManagement import newSecurityManager, getSecurityManager
#####################################################
# Avoid importing from (possibly unpatched) Globals
#####################################################
from Products.ERP5Type.Globals import get_request
#####################################################
# Compatibility - XXX - BAD
#####################################################
......@@ -398,7 +403,7 @@ except ImportError:
getConfiguration = None
pass
from Globals import InitializeClass
from Products.ERP5Type.Globals import InitializeClass
from Accessor.Base import func_code
from Products.CMFCore.utils import manage_addContentForm, manage_addContent
from AccessControl.PermissionRole import PermissionRole
......@@ -550,6 +555,7 @@ def importLocalInterface(module_id, path = None):
try:
class_id = "I" + convertToUpperCase(module_id)
module = imp.load_source(class_id, path, f)
import Products.ERP5Type.interfaces
setattr(Products.ERP5Type.interfaces, class_id, getattr(module, class_id))
finally:
f.close()
......@@ -1476,19 +1482,6 @@ def setDefaultProperties(property_holder, object=None, portal=None):
raise TypeError, '"%s" is invalid type for propertysheet' % \
prop['type']
##########################################
# Localizer is not always loaded prior to ERP5 products,
# thus, as Localizer is supposed to patch Global to add get_request to it,
# we prefer to redefine get_request inside ERP5Type/Utils,
# to avoid the case when Global wasn't patched and get_request is not available.
##########################################
try:
import Products.iHotfix
get_request = Products.iHotfix.get_request
except (ImportError, AttributeError):
import Products.Localizer
get_request = Products.Localizer.get_request
#####################################################
# Accessor initialization
#####################################################
......
......@@ -17,7 +17,13 @@ import transaction
from Acquisition import aq_parent, aq_inner, aq_base
from AccessControl import ClassSecurityInfo, ModuleSecurityInfo
from Products.ERP5Type import Permissions, PropertySheet, Constraint
from Products.CMFCore.PortalContent import NoWL, ResourceLockedError
from Products.CMFCore.PortalContent import ResourceLockedError
try:
from Products.CMFCore.PortalContent import NoWL
except ImportError:
# NoWL has been 0 for a long time now
NoWL = 0
from Products.CMFCore.utils import getToolByName
from Products.CMFDefault.utils import parseHeadersBody
from Products.CMFDefault.utils import html_headcheck
......
......@@ -26,7 +26,7 @@
#
##############################################################################
from Globals import InitializeClass, PersistentMapping
from Products.ERP5Type.Globals import InitializeClass, PersistentMapping
from Acquisition import aq_base, aq_parent, aq_inner, aq_acquire
from AccessControl import ClassSecurityInfo
from Products.ERP5Type import Permissions
......
......@@ -27,7 +27,7 @@
##############################################################################
from Globals import InitializeClass
from Products.ERP5Type.Globals import InitializeClass
from AccessControl import ClassSecurityInfo
from Products.ERP5Type import _dtmldir
from Products.ERP5Type import PropertySheet, Permissions
......
......@@ -43,7 +43,6 @@ from Products.ERP5Type.patches import ActionsTool
from Products.ERP5Type.patches import CookieCrumbler
from Products.ERP5Type.patches import i18n
from Products.ERP5Type.patches import Localizer
from Products.ERP5Type.patches import CMFMailIn
from Products.ERP5Type.patches import PropertySheets
from Products.ERP5Type.patches import CMFCoreSkinnable
from Products.ERP5Type.patches import CMFCoreSkinsTool
......
......@@ -34,7 +34,7 @@ USE_INTERACTOR = False
# Update ERP5 Globals
import sys, Permissions, os
from Globals import package_home
from App.Common import package_home
this_module = sys.modules[ __name__ ]
product_path = package_home( globals() )
this_module._dtmldir = os.path.join( product_path, 'dtml' )
......@@ -44,7 +44,7 @@ document_classes = updateGlobals( this_module,
permissions_module=Permissions,
is_erp5_type=1 )
import Interface, PropertySheet, ZopePatch
import PropertySheet, ZopePatch
import interfaces
import Products.Localizer # So that we make sure Globals.get_request is available
......
......@@ -12,7 +12,7 @@
#
##############################################################################
from Globals import DTMLFile
from Products.ERP5Type.Globals import DTMLFile
from Products.CMFCore.ActionProviderBase import ActionProviderBase
from Products.CMFCore.ActionInformation import ActionInformation
from Products.CMFCore.Expression import Expression
......
......@@ -13,7 +13,13 @@
##############################################################################
from Products.CMFCore import Skinnable
from Products.CMFCore.Skinnable import SKINDATA, superGetAttr, SkinnableObjectManager
from Products.CMFCore.Skinnable import SKINDATA, SkinnableObjectManager
try:
from Products.CMFCore.Skinnable import superGetAttr
except ImportError:
# Removed on CMFCore 2.x
superGetAttr = None
from thread import get_ident
from zLOG import LOG, WARNING, DEBUG
from Acquisition import aq_base
......
##############################################################################
#
# Copyright (c) 2001 Zope Corporation and Contributors. All Rights Reserved.
# Copyright (c) 2006 Nexedi SARL and Contributors. All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
# FOR A PARTICULAR PURPOSE
#
##############################################################################
import mimetypes
import email
from email.Header import decode_header, make_header
from email.Utils import parseaddr
from ZODB.POSException import ConflictError
from zLOG import LOG
import traceback
import StringIO
from Products.CMFMailIn.MailIn_Tool import MailInTool
# Add new method on MailInTool
def MailInTool_postUTF8MailMessage(self, file=None):
"""
Recode the email in UTF-8 in order to import it
in ERP5.
"""
if not file:
raise IOError, 'No Mail Message Supplied'
# Prepare result
theMail = {
'attachment_list': [],
'body': '',
# Place all the email header in the headers dictionary in theMail
'headers': {}
}
# Get Message
msg = email.message_from_string(file)
# Back up original file
theMail['__original__'] = file
# Recode headers to UTF-8 if needed
for key, value in msg.items():
decoded_value_list = decode_header(value)
unicode_value = make_header(decoded_value_list)
new_value = unicode_value.__unicode__().encode('utf-8')
theMail['headers'][key.lower()] = new_value
# Filter mail addresses
for header in ('resent-to', 'resent-from', 'resent-cc', 'resent-sender', 'to', 'from', 'cc', 'sender', 'reply-to'):
header_field = theMail['headers'].get(header)
if header_field:
theMail['headers'][header] = parseaddr(header_field)[1]
# Get attachments
body_found = 0
for part in msg.walk():
content_type = part.get_content_type()
file_name = part.get_filename()
# multipart/* are just containers
# XXX Check if data is None ?
if content_type.startswith('multipart'):
continue
# message/rfc822 contains attached email message
# next 'part' will be the message itself
# so we ignore this one to avoid doubling
elif content_type == 'message/rfc822':
continue
elif content_type == "text/plain":
charset = part.get_content_charset()
payload = part.get_payload(decode=True)
#LOG('CMFMailIn -> ',0,'charset: %s, payload: %s' % (charset,payload))
if charset:
payload = unicode(payload, charset).encode('utf-8')
if body_found:
# Keep the content type
theMail['attachment_list'].append((file_name,
content_type, payload))
else:
theMail['body'] = payload
body_found = 1
else:
payload = part.get_payload(decode=True)
# Keep the content type
theMail['attachment_list'].append((file_name, content_type,
payload))
portal_url = self.portal_url.getPortalPath()
if (portal_url != '') and (portal_url[-1] != '/'):
portal_url = portal_url+'/'
if self.method:
try:
return self.restrictedTraverse(portal_url+self.method)\
(theMail=theMail)
except ConflictError:
# XXX Warning: if exception is raised, the MTA will
# not return the mail to the sender
raise
except:
# It's needed to catch all exceptions, as we need to return
# a value to the MTA in this case.
# Generate log message
fp = StringIO.StringIO()
traceback.print_exc(file=fp)
log_message = fp.getvalue()
LOG("GeneratorTool, next", 1000,
log_message)
return "Message rejected. \n %s" % log_message
self.REQUEST.RESPONSE.notFoundError('MailIn method not specified')
MailInTool.postUTF8MailMessage = MailInTool_postUTF8MailMessage
......@@ -14,7 +14,7 @@
# Optimized rendering of global actions (cache)
from Globals import DTMLFile
from Products.ERP5Type.Globals import DTMLFile
from Products.ERP5Type import _dtmldir
from Products.DCWorkflow.DCWorkflow import DCWorkflowDefinition, StateChangeInfo, createExprContext
from Products.DCWorkflow.DCWorkflow import ObjectDeleted, ObjectMoved, aq_parent, aq_inner
......@@ -605,7 +605,17 @@ TransitionDefinition.getAvailableScriptIds = getAvailableScriptIds
# Add a workflow factory for ERP5 style workflow, because some variables
# are needed for History tab.
from Products.CMFCore.WorkflowTool import addWorkflowFactory
try:
from Products.CMFCore.WorkflowTool import addWorkflowFactory
except ImportError:
import zLOG
zLOG.LOG('Products.ERP5Type.patches.DCWorkflow',
zLOG.ERROR,
'Products.CMFCore.WorkflowTool.addWorkflowFactory has been removed. '
'ERP5 Workflow factory not installed',
error=sys.exc_info())
addWorkflowFactory = lambda factory, id, title: None
from Products.ERP5Type import Permissions
def setupERP5Workflow(wf):
......
......@@ -26,7 +26,7 @@
#
##############################################################################
from Globals import PersistentMapping
from Products.ERP5Type.Globals import PersistentMapping
PersistentMapping__super_copy = PersistentMapping.copy
def PersistentMapping_copy(self):
......
......@@ -15,7 +15,7 @@
# Properties
from OFS.PropertyManager import PropertyManager, type_converters
from OFS.PropertyManager import escape
from Globals import DTMLFile
from Products.ERP5Type.Globals import DTMLFile
from Products.ERP5Type.Utils import createExpressionContext
from Products.CMFCore.Expression import Expression
from Products.ERP5Type import _dtmldir
......
......@@ -14,7 +14,7 @@
# State types patch for DCWorkflow
from Products.DCWorkflow.States import StateDefinition
from Globals import DTMLFile
from Products.ERP5Type.Globals import DTMLFile
from Products.ERP5Type import _dtmldir
_properties_form = DTMLFile('state_properties', _dtmldir)
......
......@@ -32,7 +32,7 @@ from Products.ERP5Type.Cache import CachingMethod
from sets import ImmutableSet
from Acquisition import aq_base
from Persistence import Persistent
from Globals import PersistentMapping
from Products.ERP5Type.Globals import PersistentMapping
from itertools import izip
from MySQLdb import ProgrammingError, OperationalError
......
......@@ -7,9 +7,10 @@ from Products.PortalTransforms.libtransforms.commandtransform \
import os
import sys
import tempfile
from zope.interface import implements
class png_to_text(popentransform):
__implements__ = itransform
implements(itransform)
__name__ = "png_to_text"
inputs = ('image/png',)
......
......@@ -29,11 +29,12 @@
import os
from Products.PortalTransforms.interfaces import itransform
from Products.PortalTransforms.libtransforms.commandtransform import popentransform
from zope.interface import implements
# Conversor using w3m to replace lynx at PortalTransforms...
class w3m_dump(popentransform):
__implements__ = itransform
implements(itransform)
__name__ = "w3m_dump"
inputs = ('text/html',)
......
......@@ -10,7 +10,7 @@ __version__ = '0.3.0'
# XXX make sure that get_request works.
current_app = None
import Products.ERP5Type.Utils
import Globals
from Products.ERP5Type import Globals
# store a copy of the original method
original_get_request = Globals.get_request
......@@ -116,7 +116,6 @@ ZopeTestCase.installProduct('CMFCalendar', quiet=install_product_quiet)
ZopeTestCase.installProduct('CMFPhoto', quiet=install_product_quiet)
ZopeTestCase.installProduct('BTreeFolder2', quiet=install_product_quiet)
ZopeTestCase.installProduct('CMFReportTool', quiet=install_product_quiet) # Not required by ERP5Type but required by ERP5Form
ZopeTestCase.installProduct('CMFMailIn', quiet=install_product_quiet)
ZopeTestCase.installProduct('TranslationService', quiet=install_product_quiet)
ZopeTestCase.installProduct('PortalTransforms', quiet=install_product_quiet)
ZopeTestCase.installProduct('MimetypesRegistry', quiet=install_product_quiet)
......
......@@ -325,7 +325,7 @@ return result
from Products.ERP5Type.CachePlugins.DistributedRamCache import DistributedRamCache
from Products.ERP5Type.CachePlugins.RamCache import RamCache
from Products.ERP5Type.interfaces.cache_plugin import ICachePlugin
from Interface.Verify import verifyClass
from zope.interface.verify import verifyClass
verifyClass(ICachePlugin, DistributedRamCache)
verifyClass(ICachePlugin, RamCache)
......
......@@ -43,7 +43,7 @@ def get_request():
return request
# apply patch (before it's imported by other modules)
import Globals
from Products.ERP5Type import Globals
Globals.get_request = get_request
......
import Globals
from App.class_init import default__class_init__ as InitializeClass
from AccessControl import ClassSecurityInfo
try:
......@@ -108,7 +108,7 @@ class FSForm(FSObject, ZMIForm):
## self._updateFromFS()
## return ZMIForm.get_group_rows(self)
Globals.InitializeClass(FSForm)
InitializeClass(FSForm)
registerFileExtension('form', FSForm)
registerMetaType('FSForm', FSForm)
# -*- coding: utf-8 -*-
import Globals
from App.class_init import default__class_init__ as InitializeClass
import Acquisition
from Globals import Persistent, DTMLFile
from Persistence import Persistent
from App.special_dtml import DTMLFile
from AccessControl import ClassSecurityInfo
import OFS
from Shared.DC.Scripts.Bindings import Bindings
......@@ -379,7 +380,7 @@ class Field:
(self.values.values()+self.tales.values()+
self.overrides.values())))
Globals.InitializeClass(Field)
InitializeClass(Field)
class ZMIField(
Acquisition.Implicit,
......@@ -630,7 +631,7 @@ class ZMIField(
return self
getRecursiveTemplateField = getTemplateField
Globals.InitializeClass(ZMIField)
InitializeClass(ZMIField)
PythonField = ZMIField # NOTE: for backwards compatibility
class ZClassField(Field):
......
from Globals import DTMLFile
from App.special_dtml import DTMLFile
from HelpSys import HelpTopic
class FieldHelpTopic(HelpTopic.HelpTopic):
......
import os
import OFS
from Globals import ImageFile
from App.ImageFile import ImageFile
from FieldHelpTopic import FieldHelpTopic
class FieldRegistry:
......
import Globals, AccessControl
import AccessControl
import OFS
from App.class_init import default__class_init__ as InitializeClass
from Acquisition import aq_base
from Globals import DTMLFile, Persistent
from App.special_dtml import DTMLFile
from Persistence import Persistent
from AccessControl import ClassSecurityInfo
from AccessControl.Role import RoleManager
from OFS.ObjectManager import ObjectManager
......@@ -496,7 +498,7 @@ class Form:
'Content-Type',
'text/html;charset=%s' % encoding)
Globals.InitializeClass(Form)
InitializeClass(Form)
class BasicForm(Persistent, Acquisition.Implicit, Form):
"""A form that manages its own fields, not using ObjectManager.
......@@ -567,7 +569,7 @@ class BasicForm(Persistent, Acquisition.Implicit, Form):
self.fields[field.id] = field
self.fields = self.fields
Globals.InitializeClass(BasicForm)
InitializeClass(BasicForm)
def create_settings_form():
"""Create settings form for ZMIForm.
......@@ -980,7 +982,7 @@ class ZMIForm(ObjectManager, PropertyManager, RoleManager, Item, Form):
manage_tabs_message=message)
PythonForm = ZMIForm # NOTE: backwards compatibility
Globals.InitializeClass(ZMIForm)
InitializeClass(ZMIForm)
manage_addForm = DTMLFile("dtml/formAdd", globals())
......
import string
from DummyField import fields
import Widget, Validator
from Globals import Persistent
from Persistence import Persistent
import Acquisition
from Field import ZMIField
from AccessControl import getSecurityManager
......
......@@ -10,7 +10,8 @@ import string
from AccessControl import ClassSecurityInfo
from Globals import InitializeClass
# this name is safe for importing on Zope 2.8 to 2.12
from App.class_init import default__class_init__ as InitializeClass
import FormValidationError, BasicForm
import StandardFields
......
import string
from DummyField import fields
import Widget, Validator
from Globals import Persistent
from Persistence import Persistent
import Acquisition
from Field import ZMIField
from AccessControl import getSecurityManager
......
......@@ -7,7 +7,6 @@ from cgi import escape
import types
from DocumentTemplate.ustr import ustr
from urlparse import urljoin
from Globals import get_request
class Widget:
"""A field widget that knows how to display itself as HTML.
......@@ -1445,7 +1444,8 @@ class LinkWidget(TextWidget):
"""
link_type = field.get_value('link_type', REQUEST=REQUEST)
if REQUEST is None:
REQUEST = get_request()
# stop relying on get_request bein patched in Globals
REQUEST = field.REQUEST
if link_type == 'internal':
value = urljoin(REQUEST['BASE0'], value)
......
from Globals import DTMLFile
import Form
import StandardFields, HelperFields
from FieldRegistry import FieldRegistry
......
......@@ -13,7 +13,7 @@
##############################################################################
from AccessControl.SecurityInfo import ClassSecurityInfo
from Globals import InitializeClass
from App.class_init import default__class_init__ as InitializeClass
from Products.HBTreeFolder2.HBTreeFolder2 import HBTreeFolder2Base
try:
......
......@@ -18,9 +18,9 @@ from urllib import quote
from random import randint
from types import StringType
import Globals
from Globals import DTMLFile
from Globals import Persistent, PersistentMapping
from App.class_init import default__class_init__ as InitializeClass
from App.special_dtml import DTMLFile
from Persistence import Persistent, PersistentMapping
from Acquisition import aq_base
from BTrees.OOBTree import OOBTree
from BTrees.OIBTree import OIBTree, union
......@@ -595,7 +595,7 @@ class HBTreeFolder2Base (Persistent):
return res
Globals.InitializeClass(HBTreeFolder2Base)
InitializeClass(HBTreeFolder2Base)
class HBTreeFolder2 (HBTreeFolder2Base, Folder):
......@@ -608,5 +608,5 @@ class HBTreeFolder2 (HBTreeFolder2Base, Folder):
HBTreeFolder2Base._checkId(self, id, allow_dup)
Globals.InitializeClass(HBTreeFolder2)
InitializeClass(HBTreeFolder2)
......@@ -12,7 +12,8 @@ from DateTime import DateTime
from email.MIMEMultipart import MIMEMultipart
from email.MIMEText import MIMEText
from Globals import InitializeClass, package_home
from App.class_init import default__class_init__ as InitializeClass
from App.Common import package_home
from MTMultipart import MTMultipart
from Products.PageTemplates.ZopePageTemplate import ZopePageTemplate, SUPPORTS_WEBDAV_LOCKS
from Products.PageTemplates.PageTemplateFile import PageTemplateFile
......
......@@ -6,7 +6,7 @@
from AccessControl import ClassSecurityInfo
from AccessControl import getSecurityManager
from Globals import InitializeClass
from App.class_init import default__class_init__ as InitializeClass
from Products.CMFCore.FSPageTemplate import FSPageTemplate,expandpath
from Products.CMFCore.DirectoryView import registerFileExtension
from Products.CMFCore.DirectoryView import registerMetaType
......
......@@ -8,7 +8,7 @@ from AccessControl import ClassSecurityInfo
from email import Encoders
from email.MIMEBase import MIMEBase
from email.MIMEMultipart import MIMEMultipart
from Globals import InitializeClass
from App.class_init import default__class_init__ as InitializeClass
try:
from zope.app.content_types import guess_content_type
except ImportError:
......
......@@ -8,7 +8,8 @@ import os
from AccessControl import ClassSecurityInfo
from AccessControl import getSecurityManager
from Globals import InitializeClass, package_home
from App.class_init import default__class_init__ as InitializeClass
from App.Common import package_home
from Products.PageTemplates.ZopePageTemplate import ZopePageTemplate, SUPPORTS_WEBDAV_LOCKS
from Products.PageTemplates.PageTemplateFile import PageTemplateFile
......
......@@ -26,7 +26,7 @@ else:
from Products.CMFCore.tests.base.testcase import FSDVTest
from Products.CMFCore.tests.base.dummy import DummyFolder
from AccessControl import ClassSecurityInfo
from Globals import InitializeClass
from App.class_init import default__class_init__ as InitializeClass
class DummyMember:
......
......@@ -5,7 +5,7 @@ from Products.CMFCore.DirectoryView import createDirectoryView
from Products.CMFCore.DirectoryView import manage_listAvailableDirectories
from Products.CMFCore.utils import getToolByName
from Products.CMFCore.utils import minimalpath
from Globals import package_home
from App.Common import package_home
from Acquisition import aq_base
from OFS.ObjectManager import BadRequestException
......
......@@ -2,8 +2,8 @@ from logging import ERROR
from UserDict import UserDict
from Products.PageTemplates.PageTemplateFile import PageTemplateFile
from Globals import InitializeClass
from Globals import PersistentMapping
from App.class_init import default__class_init__ as InitializeClass
from Persistence import PersistentMapping
try:
from ZODB.PersistentList import PersistentList
except ImportError:
......@@ -17,6 +17,7 @@ from Products.CMFCore.utils import getToolByName
from Products.PortalTransforms.interfaces import itransform
from Products.PortalTransforms.utils import TransformException, log, _www
from Products.PortalTransforms.transforms.broken import BrokenTransform
from zope.interface import implements
__revision__ = '$Id: Transform.py 6255 2006-04-11 15:29:29Z hannosch $'
......@@ -67,7 +68,7 @@ class Transform(SimpleItem):
additional configuration information
"""
__implements__ = itransform
implements(itransform)
meta_type = 'Transform'
......
......@@ -3,9 +3,9 @@ from AccessControl import ClassSecurityInfo
from Acquisition import Implicit
from Acquisition import aq_parent
from Acquisition import aq_base
from Globals import Persistent
from Globals import InitializeClass
from Globals import PersistentMapping
from Persistence import Persistent
from App.class_init import default__class_init__ as InitializeClass
from Persistence import PersistentMapping
try:
from ZODB.PersistentList import PersistentList
except ImportError:
......@@ -35,6 +35,8 @@ from Products.PortalTransforms.utils import TransformException
from Products.PortalTransforms.utils import BadRequest
from Products.PortalTransforms.utils import _www
from zope.interface import implements
__revision__ = '$Id: TransformEngine.py 6255 2006-04-11 15:29:29Z hannosch $'
from logging import DEBUG
......@@ -45,7 +47,7 @@ class TransformTool(UniqueObject, ActionProviderBase, Folder):
meta_type = id.title().replace('_', ' ')
isPrincipiaFolderish = 1 # Show up in the ZMI
__implements__ = iengine
implements(iengine)
meta_types = all_meta_types = (
{ 'name' : 'Transform',
......
from Products.PageTemplates.PageTemplateFile import PageTemplateFile
from Globals import Persistent
from Globals import InitializeClass
from Persistence import Persistent
from App.class_init import default__class_init__ as InitializeClass
from Acquisition import Implicit
from OFS.SimpleItem import Item
from AccessControl.Role import RoleManager
......@@ -12,13 +12,14 @@ from Products.CMFCore.utils import getToolByName
from Products.PortalTransforms.utils import TransformException, _www
from Products.PortalTransforms.interfaces import ichain
from Products.PortalTransforms.interfaces import itransform
from zope.interface import implements
from UserList import UserList
class chain(UserList):
"""A chain of transforms used to transform data"""
__implements__ = (ichain, itransform)
implements(ichain, itransform)
def __init__(self, name='',*args):
UserList.__init__(self, *args)
......
from Products.PortalTransforms.interfaces import idatastream
from zope.interface import implements
class datastream:
"""A transformation datastream packet"""
__implements__ = idatastream
implements(idatastream)
__slots__ = ('name', '_data', '_metadata')
def __init__(self, name):
......
from Interface import Interface, Attribute
from zope.interface import Interface, Attribute
class idatastream(Interface):
"""data stream, is the result of a transform"""
......
......@@ -4,6 +4,7 @@ import tempfile
import re
import shutil
from os.path import join, basename
from zope.interface import implements
from Products.PortalTransforms.interfaces import itransform
from Products.PortalTransforms.libtransforms.utils import bin_search, sansext, getShortPathName
......@@ -11,7 +12,7 @@ from Products.PortalTransforms.libtransforms.utils import bin_search, sansext, g
class commandtransform:
"""abstract class for external command based transform
"""
__implements__ = itransform
implements(itransform)
def __init__(self, name=None, binary=None, **kwargs):
if name is not None:
......@@ -57,7 +58,7 @@ class popentransform:
Command must read from stdin and write to stdout
"""
__implements__ = itransform
implements(itransform)
binaryName = ""
binaryArgs = ""
......
from Products.PortalTransforms.interfaces import itransform
import subprocess
from zope.interface import implements
class ImageMagickTransforms:
__implements__ = itransform
implements(itransform)
__name__ = "imagemagick_transforms"
def __init__(self, name=None):
if name is not None:
......
from Products.PortalTransforms.interfaces import itransform
from StringIO import StringIO
import PIL.Image
from zope.interface import implements
class PILTransforms:
__implements__ = itransform
implements(itransform)
__name__ = "piltransforms"
def __init__(self, name=None):
if name is not None:
......
from Products.PortalTransforms.interfaces import itransform
import re
from zope.interface import implements
class retransform:
"""abstract class for regex transforms (re.sub wrapper)"""
__implements__ = itransform
implements(itransform)
inputs = ('text/',)
......
......@@ -12,6 +12,7 @@ from Products.PortalTransforms.chain import chain
import urllib
import time
import re
from zope.interface import implements
class BaseTransform:
def name(self):
......@@ -19,7 +20,7 @@ class BaseTransform:
class HtmlToText(BaseTransform):
__implements__ = itransform
implements(itransform)
inputs = ('text/html',)
output = 'text/plain'
......@@ -36,7 +37,7 @@ class HtmlToTextWithEncoding(HtmlToText):
output_encoding = 'ascii'
class FooToBar(BaseTransform):
__implements__ = itransform
implements(itransform)
inputs = ('text/*',)
output = 'text/plain'
......@@ -51,30 +52,30 @@ class FooToBar(BaseTransform):
class TransformNoIO(BaseTransform):
__implements__ = itransform
implements(itransform)
class BadTransformMissingImplements(BaseTransform):
__implements__ = None
#__implements__ = None
inputs = ('text/*',)
output = 'text/plain'
class BadTransformBadMIMEType1(BaseTransform):
__implements__ = itransform
implements(itransform)
inputs = ('truc/muche',)
output = 'text/plain'
class BadTransformBadMIMEType2(BaseTransform):
__implements__ = itransform
implements(itransform)
inputs = ('text/plain',)
output = 'truc/muche'
class BadTransformNoInput(BaseTransform):
__implements__ = itransform
implements(itransform)
inputs = ()
output = 'text/plain'
class BadTransformWildcardOutput(BaseTransform):
__implements__ = itransform
implements(itransform)
inputs = ('text/plain',)
output = 'text/*'
......
from Products.PortalTransforms.interfaces import itransform
from Products.PortalTransforms.utils import log
from zope.interface import implements
WARNING=100
class BrokenTransform:
__implements__ = itransform
implements(itransform)
__name__ = "broken transform"
inputs = ("BROKEN",)
......
from Products.PortalTransforms.interfaces import itransform
from Products.CMFDefault.utils import bodyfinder
from zope.interface import implements
class HTMLBody:
"""Simple transform which extracts the content of the body tag"""
__implements__ = itransform
implements(itransform)
__name__ = "html_body"
inputs = ('text/html',)
......
......@@ -5,13 +5,14 @@ A simple identity transform
__revision__ = '$Id: identity.py 4787 2005-08-19 21:43:41Z dreamcatcher $'
from Products.PortalTransforms.interfaces import itransform
from zope.interface import implements
class IdentityTransform:
""" Identity transform
return content unchanged.
"""
__implements__ = (itransform,)
implements(itransform,)
__name__ = "rest_to_text"
......
from Products.PortalTransforms.interfaces import itransform
from zope.interface import implements
class image_to_html:
__implements__ = itransform
implements(itransform)
__name__ = "image_to_html"
inputs = ('image/*', )
......
......@@ -5,9 +5,10 @@ from Products.PortalTransforms.interfaces import itransform
from Products.PortalTransforms.libtransforms.commandtransform import commandtransform
from Products.PortalTransforms.libtransforms.commandtransform import popentransform
import os
from zope.interface import implements
class lynx_dump(popentransform):
__implements__ = itransform
implements(itransform)
__name__ = "lynx_dump"
inputs = ('text/html',)
......@@ -25,7 +26,7 @@ class lynx_dump(popentransform):
return ''.join(lines[3:])
class old_lynx_dump(commandtransform):
__implements__ = itransform
implements(itransform)
__name__ = "lynx_dump"
inputs = ('text/html',)
......
......@@ -8,9 +8,10 @@ from Products.PortalTransforms.libtransforms.commandtransform import commandtran
from Products.PortalTransforms.libtransforms.commandtransform import popentransform
from Products.CMFDefault.utils import bodyfinder
import os
from zope.interface import implements
class popen_pdf_to_html(popentransform):
__implements__ = itransform
implements(itransform)
__version__ = '2004-07-02.01'
......@@ -27,7 +28,7 @@ class popen_pdf_to_html(popentransform):
return bodyfinder(couterr.read())
class pdf_to_html(commandtransform):
__implements__ = itransform
implements(itransform)
__name__ = "pdf_to_html"
inputs = ('application/pdf',)
......
......@@ -7,9 +7,10 @@ from Products.PortalTransforms.libtransforms.utils import bin_search, sansext
from Products.PortalTransforms.libtransforms.commandtransform import commandtransform
from Products.PortalTransforms.libtransforms.commandtransform import popentransform
import os
from zope.interface import implements
class pdf_to_text(popentransform):
__implements__ = itransform
implements(itransform)
__name__ = "pdf_to_text"
inputs = ('application/pdf',)
......@@ -23,7 +24,7 @@ class pdf_to_text(popentransform):
useStdin = False
class old_pdf_to_text(commandtransform):
__implements__ = itransform
implements(itransform)
__name__ = "pdf_to_text"
inputs = ('application/pdf',)
......
......@@ -21,6 +21,7 @@ from cStringIO import StringIO
from Products.PortalTransforms.interfaces import itransform
from DocumentTemplate.DT_Util import html_quote
from zope.interface import implements
## Python Source Parser #####################################################
......@@ -109,7 +110,7 @@ class Parser:
class PythonTransform:
"""Colorize Python source files
"""
__implements__ = itransform
implements(itransform)
__name__ = "python_to_html"
inputs = ("text/x-python",)
......
from Products.PortalTransforms.interfaces import itransform
from reStructuredText import HTML
import sys
from zope.interface import implements
class rest:
__implements__ = itransform
implements(itransform)
__name__ = "rest_to_html"
inputs = ("text/x-rst", "text/restructured",)
......
......@@ -6,10 +6,11 @@ from Products.PortalTransforms.interfaces import itransform
from Products.PortalTransforms.libtransforms.utils import bin_search, sansext
from Products.PortalTransforms.libtransforms.commandtransform import commandtransform
from Products.CMFDefault.utils import bodyfinder
from zope.interface import implements
import os
class rtf_to_html(commandtransform):
__implements__ = itransform
implements(itransform)
__name__ = "rtf_to_html"
inputs = ('application/rtf',)
......
......@@ -6,9 +6,10 @@ from Products.PortalTransforms.interfaces import itransform
from Products.PortalTransforms.libtransforms.utils import bin_search, sansext
from Products.PortalTransforms.libtransforms.commandtransform import commandtransform
import os
from zope.interface import implements
class rtf_to_xml(commandtransform):
__implements__ = itransform
implements(itransform)
__name__ = "rtf_to_xml"
inputs = ('application/rtf',)
......
......@@ -2,6 +2,7 @@ import logging
from sgmllib import SGMLParser
import re
from cgi import escape
from zope.interface import implements
from Products.PortalTransforms.interfaces import itransform
from Products.PortalTransforms.utils import log
......@@ -184,7 +185,7 @@ class SafeHTML:
-> Flush Cache.
"""
__implements__ = itransform
implements(itransform)
__name__ = "safe_html"
inputs = ('text/html',)
......
from StructuredText.StructuredText import HTML
from Products.PortalTransforms.interfaces import itransform
from zope.interface import implements
DEFAULT_STX_LEVEL = 2
STX_LEVEL = DEFAULT_STX_LEVEL
class st:
__implements__ = itransform
implements(itransform)
__name__ = "st_to_html"
inputs = ("text/structured",)
......
from Products.PortalTransforms.interfaces import itransform
from DocumentTemplate.DT_Util import html_quote
from zope.interface import implements
__revision__ = '$Id: text_pre_to_html.py 3658 2005-02-23 16:29:54Z tiran $'
class TextPreToHTML:
"""simple transform which wraps raw text into a <pre> tag"""
__implements__ = itransform
implements(itransform)
__name__ = "text-pre_to_html"
inputs = ('text/plain-pre',)
......
from Products.PortalTransforms.interfaces import itransform
from DocumentTemplate.DT_Util import html_quote
from zope.interface import implements
__revision__ = '$Id: text_to_html.py 4787 2005-08-19 21:43:41Z dreamcatcher $'
class TextToHTML:
"""simple transform which wrap raw text in a verbatim environment"""
__implements__ = itransform
implements(itransform)
__name__ = "text_to_html"
output = "text/html"
......
from Products.PortalTransforms.interfaces import itransform
from zope.interface import implements
EXTRACT_BODY = 1
EXTRACT_STYLE = 0
......@@ -30,7 +31,7 @@ else:
import os.path
class word_to_html:
__implements__ = itransform
implements(itransform)
__name__ = "word_to_html"
inputs = ('application/msword',)
......
......@@ -10,6 +10,7 @@ from Products.PortalTransforms.interfaces import itransform
from Products.PortalTransforms.libtransforms.utils import bin_search, sansext
from Products.PortalTransforms.libtransforms.commandtransform import commandtransform
from Products.PortalTransforms.utils import log
from zope.interface import implements
class ExternalCommandTransform(commandtransform):
""" Custom external command
......@@ -20,7 +21,7 @@ class ExternalCommandTransform(commandtransform):
the command line parameters) and return output on stdout.
Input and output mime types must be set correctly !
"""
__implements__ = (itransform,)
implements(itransform,)
__name__ = "command_transform"
......
......@@ -9,6 +9,7 @@ import re
from os import popen3, popen4, system
from cStringIO import StringIO
from zope.interface import implements
from Products.PortalTransforms.interfaces import itransform
from Products.PortalTransforms.libtransforms.utils import bin_search, sansext
from Products.PortalTransforms.libtransforms.commandtransform import commandtransform
......@@ -23,7 +24,7 @@ class XsltTransform(commandtransform):
You can associate different document type to different transformations.
"""
__implements__ = (itransform,)
implements(itransform,)
__name__ = "xml_to_html"
......
......@@ -5,7 +5,7 @@ __version__ = '$Revision: 1.3 $'[11:-2]
import sys, time, threading
from DateTime import DateTime
from Globals import InitializeClass
from App.class_init import default__class_init__ as InitializeClass
from OFS.SimpleItem import SimpleItem
from OFS.PropertyManager import PropertyManager
......
......@@ -2,14 +2,14 @@
# -*- Mode: Python; py-indent-offset: 4 -*-
# Authors: Nik Kim <fafhrd@legco.biz>
import Globals
from App.ImageFile import ImageFile
from AccessControl import ModuleSecurityInfo, allow_module
from AccessControl.Permissions import view
from TimerService import TimerService, current_version
misc_ = { 'timer_icon.gif':
Globals.ImageFile('zpt/timer_icon.gif', globals())}
ImageFile('zpt/timer_icon.gif', globals())}
cp_id = 'timer_service'
......
......@@ -92,7 +92,7 @@ import os
from db import ThreadedDB
import Shared.DC.ZRDB.Connection, sys, DABase
from App.Dialogs import MessageDialog
from Globals import HTMLFile
from App.special_dtml import HTMLFile
from ImageFile import ImageFile
from ExtensionClass import Base
from DateTime import DateTime
......
......@@ -88,7 +88,7 @@ $Id: DABase.py,v 1.5 2001/08/17 02:17:38 adustman Exp $'''
__version__='$Revision: 1.5 $'[11:-2]
import Shared.DC.ZRDB.Connection, sys
from Globals import HTMLFile
from App.special_dtml import HTMLFile
from ImageFile import ImageFile
from ExtensionClass import Base
import Acquisition
......
......@@ -89,7 +89,7 @@ import os
from db import ThreadedDeferredDB
import Shared.DC.ZRDB.Connection, sys, DABase
from App.Dialogs import MessageDialog
from Globals import HTMLFile
from App.special_dtml import HTMLFile
from ImageFile import ImageFile
from ExtensionClass import Base
from DateTime import DateTime
......
......@@ -88,7 +88,7 @@ $Id: DABase.py,v 1.5 2001/08/17 02:17:38 adustman Exp $'''
__version__='$Revision: 1.5 $'[11:-2]
import Shared.DC.ZRDB.Connection, sys
from Globals import HTMLFile
from App.special_dtml import HTMLFile
from ImageFile import ImageFile
from ExtensionClass import Base
import Acquisition
......
......@@ -29,7 +29,8 @@
from zLOG import LOG, WARNING, INFO
from interfaces.column_map import IColumnMap
from Interface.Verify import verifyClass
from zope.interface.verify import verifyClass
from zope.interface import implements
from SQLCatalog import profiler_decorator
DEFAULT_GROUP_ID = None
......@@ -44,7 +45,7 @@ MAPPING_TRACE = False
class ColumnMap(object):
__implements__ = IColumnMap
implements(IColumnMap)
@profiler_decorator
def __init__(self, catalog_table_name=None):
......
......@@ -31,7 +31,7 @@
from OperatorBase import OperatorBase
from Products.ZSQLCatalog.SQLExpression import SQLExpression
from Products.ZSQLCatalog.interfaces.operator import IOperator
from Interface.Verify import verifyClass
from zope.interface.verify import verifyClass
from Products.ZSQLCatalog.SQLCatalog import profiler_decorator
class ComparisonOperatorBase(OperatorBase):
......
......@@ -30,7 +30,8 @@
from zLOG import LOG
from Products.ZSQLCatalog.interfaces.operator import IOperator
from Interface.Verify import verifyClass
from zope.interface.verify import verifyClass
from zope.interface import implements
from Products.ZSQLCatalog.SQLCatalog import profiler_decorator
@profiler_decorator
......@@ -107,7 +108,7 @@ column_renderer = {
class OperatorBase(object):
__implements__ = IOperator
implements(IOperator)
def __init__(self, operator, operator_search_text=None):
self.operator = operator
......
......@@ -31,7 +31,7 @@
from Query import Query
from zLOG import LOG
from Products.ZSQLCatalog.interfaces.query import IQuery
from Interface.Verify import verifyClass
from zope.interface.verify import verifyClass
from Products.ZSQLCatalog.SQLCatalog import profiler_decorator
class AutoQuery(Query):
......
......@@ -32,7 +32,7 @@ from Query import Query
from Products.ZSQLCatalog.SQLExpression import SQLExpression
from SQLQuery import SQLQuery
from Products.ZSQLCatalog.interfaces.query import IQuery
from Interface.Verify import verifyClass
from zope.interface.verify import verifyClass
from Products.ZSQLCatalog.SQLCatalog import profiler_decorator
logical_operator_search_text_dict = {
......
......@@ -32,7 +32,8 @@ from Products.ZSQLCatalog.SQLExpression import SQLExpression
from Products.ZSQLCatalog.ColumnMap import ColumnMap
from zLOG import LOG
from Products.ZSQLCatalog.interfaces.entire_query import IEntireQuery
from Interface.Verify import verifyClass
from zope.interface.verify import verifyClass
from zope.interface import implements
from Products.ZSQLCatalog.SQLCatalog import profiler_decorator
def defaultDict(value):
......@@ -48,7 +49,7 @@ class EntireQuery(object):
internaly.
"""
__implements__ = IEntireQuery
implements(IEntireQuery)
column_map = None
......
......@@ -29,7 +29,8 @@
##############################################################################
from Products.ZSQLCatalog.interfaces.query import IQuery
from Interface.Verify import verifyClass
from zope.interface.verify import verifyClass
from zope.interface import implements
class Query(object):
"""
......@@ -37,7 +38,7 @@ class Query(object):
able to distinguish any kind of value from a query.
"""
__implements__ = IQuery
implements(IQuery)
__allow_access_to_unprotected_subobjects__ = 1
def asSQLExpression(self, sql_catalog, column_map, only_group_columns):
......
......@@ -31,7 +31,7 @@
from Query import Query
from Products.ZSQLCatalog.SQLExpression import SQLExpression
from Products.ZSQLCatalog.interfaces.query import IQuery
from Interface.Verify import verifyClass
from zope.interface.verify import verifyClass
from Products.ZSQLCatalog.SQLCatalog import profiler_decorator
class RelatedQuery(Query):
......
......@@ -31,7 +31,7 @@
from Query import Query
from Products.ZSQLCatalog.SQLExpression import SQLExpression
from Products.ZSQLCatalog.interfaces.query import IQuery
from Interface.Verify import verifyClass
from zope.interface.verify import verifyClass
class SQLQuery(Query):
"""
......
......@@ -30,7 +30,7 @@
from Query import Query
from Products.ZSQLCatalog.interfaces.query import IQuery
from Interface.Verify import verifyClass
from zope.interface.verify import verifyClass
from Products.ZSQLCatalog.SQLCatalog import profiler_decorator
from zLOG import LOG, WARNING
......
......@@ -12,12 +12,12 @@
#
##############################################################################
from Persistence import Persistent
from Persistence import Persistent, PersistentMapping
import Acquisition
import ExtensionClass
import Globals
import OFS.History
from Globals import DTMLFile, PersistentMapping
from App.class_init import default__class_init__ as InitializeClass
from App.special_dtml import DTMLFile
from thread import allocate_lock, get_ident
from OFS.Folder import Folder
from AccessControl import ClassSecurityInfo
......@@ -43,7 +43,8 @@ import os
import md5
from interfaces.query_catalog import ISearchKeyCatalog
from Interface.Verify import verifyClass
from zope.interface.verify import verifyClass
from zope.interface import implements
from SearchText import isAdvancedSearchText
......@@ -258,7 +259,8 @@ class Catalog(Folder,
"""
__implements__ = ISearchKeyCatalog
implements(ISearchKeyCatalog)
meta_type = "SQLCatalog"
icon = 'misc_/ZCatalog/ZCatalog.gif' # FIXME: use a different icon
......@@ -2489,7 +2491,7 @@ class Catalog(Folder,
return getEngine().getContext(data)
Globals.default__class_init__(Catalog)
InitializeClass(Catalog)
class CatalogError(Exception): pass
......
......@@ -29,7 +29,8 @@
from zLOG import LOG
from interfaces.sql_expression import ISQLExpression
from Interface.Verify import verifyClass
from zope.interface.verify import verifyClass
from zope.interface import implements
from types import NoneType
from SQLCatalog import profiler_decorator
......@@ -56,7 +57,7 @@ def defaultDict(value):
class SQLExpression(object):
__implements__ = ISQLExpression
implements(ISQLExpression)
@profiler_decorator
def __init__(self,
......
......@@ -35,7 +35,7 @@ from Products.ZSQLCatalog.Query.ComplexQuery import ComplexQuery
from zLOG import LOG
from DateTime.DateTime import DateTime, DateTimeError, _cache
from Products.ZSQLCatalog.interfaces.search_key import ISearchKey
from Interface.Verify import verifyClass
from zope.interface.verify import verifyClass
from Products.ZSQLCatalog.SQLCatalog import profiler_decorator
from Products.ZSQLCatalog.SearchText import parse
......
......@@ -31,7 +31,7 @@
from SearchKey import SearchKey
from Products.ZSQLCatalog.SearchText import parse
from Products.ZSQLCatalog.interfaces.search_key import ISearchKey
from Interface.Verify import verifyClass
from zope.interface.verify import verifyClass
class DefaultKey(SearchKey):
"""
......
......@@ -32,7 +32,7 @@ from SearchKey import SearchKey
from Products.ZSQLCatalog.Query.SimpleQuery import SimpleQuery
from Products.ZSQLCatalog.SearchText import parse
from Products.ZSQLCatalog.interfaces.search_key import ISearchKey
from Interface.Verify import verifyClass
from zope.interface.verify import verifyClass
from Products.ZSQLCatalog.SQLCatalog import profiler_decorator
import re
......
......@@ -31,7 +31,7 @@
from SearchKey import SearchKey
from Products.ZSQLCatalog.SearchText import parse
from Products.ZSQLCatalog.interfaces.search_key import ISearchKey
from Interface.Verify import verifyClass
from zope.interface.verify import verifyClass
from Products.ZSQLCatalog.Query.SimpleQuery import SimpleQuery
class KeywordKey(SearchKey):
......
......@@ -30,7 +30,7 @@
from SearchKey import SearchKey
from Products.ZSQLCatalog.interfaces.search_key import ISearchKey
from Interface.Verify import verifyClass
from zope.interface.verify import verifyClass
class RawKey(SearchKey):
"""
......
......@@ -34,7 +34,8 @@ from Products.ZSQLCatalog.Query.RelatedQuery import RelatedQuery
from Products.ZSQLCatalog.Query.SQLQuery import SQLQuery
from Products.ZSQLCatalog.SQLExpression import SQLExpression
from Products.ZSQLCatalog.interfaces.search_key import IRelatedKey
from Interface.Verify import verifyClass
from zope.interface.verify import verifyClass
from zope.interface import implements
from Products.ZSQLCatalog.SQLCatalog import profiler_decorator
BACKWARD_COMPATIBILITY = True
......@@ -46,7 +47,7 @@ class RelatedKey(SearchKey):
column to compare, plus a regular query on that column if needed.
"""
__implements__ = IRelatedKey
implements(IRelatedKey)
related_key_definition = None
......
......@@ -32,7 +32,8 @@ from zLOG import LOG
from Products.ZSQLCatalog.Query.SimpleQuery import SimpleQuery
from Products.ZSQLCatalog.Query.ComplexQuery import ComplexQuery
from Products.ZSQLCatalog.interfaces.search_key import ISearchKey
from Interface.Verify import verifyClass
from zope.interface.verify import verifyClass
from zope.interface import implements
from Products.ZSQLCatalog.SQLCatalog import profiler_decorator
single_operator_dict = {
......@@ -74,7 +75,7 @@ operator_value_deprocessor_dict = {
class SearchKey(object):
__implements__ = ISearchKey
implements(ISearchKey)
# Comparison operator to use when parsing a string value and no operator is
# found.
......
......@@ -27,21 +27,14 @@
##############################################################################
from lexer import lexer, update_docstrings
try:
from Products.ZSQLCatalog.interfaces.abstract_syntax_node import INode, IValueNode, ILogicalNode, IColumnNode
from Interface.Verify import verifyClass
except ImportError:
INode = None
IValueNode = None
ILogicalNode = None
IColumnNode = None
def verifyClass(*args, **kw):
pass
from Products.ZSQLCatalog.interfaces.abstract_syntax_node import INode, IValueNode, ILogicalNode, IColumnNode
from zope.interface.verify import verifyClass
from zope.interface import implements
class Node(object):
__allow_access_to_unprotected_subobjects__ = 1
__implements__ = INode
implements(INode)
def isLeaf(self):
return False
......@@ -56,7 +49,7 @@ verifyClass(INode, Node)
class ValueNode(Node):
__implements__ = IValueNode
implements(IValueNode)
def __init__(self, value, comparison_operator=''):
self.value = value
......@@ -79,7 +72,7 @@ verifyClass(IValueNode, ValueNode)
class NotNode(Node):
__implements__ = ILogicalNode
implements(ILogicalNode)
def __init__(self, node):
self.node = node
......@@ -98,7 +91,7 @@ verifyClass(ILogicalNode, NotNode)
class LogicalNode(Node):
__implements__ = ILogicalNode
implements(ILogicalNode)
def __init__(self, logical_operator, node, other):
self.logical_operator = logical_operator
......@@ -126,7 +119,7 @@ verifyClass(ILogicalNode, LogicalNode)
class ColumnNode(Node):
__implements__ = IColumnNode
implements(IColumnNode)
def __init__(self, column_name, node):
self.column_name = column_name
......
......@@ -13,8 +13,9 @@
##############################################################################
"""ZCatalog product"""
from Globals import DTMLFile, MessageDialog
import Globals
from App.special_dtml import DTMLFile
from App.Dialogs import MessageDialog
from App.class_init import default__class_init__ as InitializeClass
from OFS.Folder import Folder
from DateTime import DateTime
......@@ -1331,7 +1332,7 @@ class ZCatalog(Folder, Persistent, Implicit):
return []
Globals.default__class_init__(ZCatalog)
InitializeClass(ZCatalog)
def p_name(name):
......
......@@ -14,12 +14,6 @@
"""ZCatalog product"""
import ZSQLCatalog, SQLCatalog
from ZClasses import createZClassForBase
createZClassForBase( ZSQLCatalog.ZCatalog , globals()
, 'ZSQLCatalogBase', 'ZSQLCatalog' )
createZClassForBase( SQLCatalog.Catalog , globals()
, 'SQLCatalogBase', 'SQLCatalog' )
def initialize(context):
context.registerClass(
......
......@@ -27,7 +27,7 @@
#
##############################################################################
from Interface import Interface
from zope.interface import Interface
class INode(Interface):
"""
......
......@@ -27,7 +27,7 @@
#
##############################################################################
from Interface import Interface
from zope.interface import Interface
class IColumnMap(Interface):
"""
......
......@@ -27,7 +27,7 @@
#
##############################################################################
from Interface import Interface
from zope.interface import Interface
class IEntireQuery(Interface):
"""
......
......@@ -27,7 +27,7 @@
#
##############################################################################
from Interface import Interface
from zope.interface import Interface
class IOperator(Interface):
"""
......
......@@ -27,7 +27,7 @@
#
##############################################################################
from Interface import Interface
from zope.interface import Interface
class IQuery(Interface):
"""
......
......@@ -27,7 +27,7 @@
#
##############################################################################
from Interface import Interface
from zope.interface import Interface
class ISearchKeyCatalog(Interface):
......
......@@ -27,7 +27,7 @@
#
##############################################################################
from Interface import Interface
from zope.interface import Interface
class ISearchKey(Interface):
"""
......
......@@ -27,7 +27,7 @@
#
##############################################################################
from Interface import Interface
from zope.interface import Interface
class ISQLExpression(Interface):
"""
......
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