Commit 75157c35 authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

interfaces directory now follows zope naming convention.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@27287 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 9ccfc974
...@@ -23,7 +23,7 @@ from ZPublisher import BeforeTraverse ...@@ -23,7 +23,7 @@ from ZPublisher import BeforeTraverse
from AccessControl import ClassSecurityInfo from AccessControl import ClassSecurityInfo
from Products.CMFDefault.Portal import CMFSite, PortalGenerator from Products.CMFDefault.Portal import CMFSite, PortalGenerator
from Products.CMFCore.utils import getToolByName, _getAuthenticatedUser from Products.CMFCore.utils import getToolByName, _getAuthenticatedUser
from Products.ERP5Type import Permissions, PropertySheet, Constraint, Interface from Products.ERP5Type import Permissions, PropertySheet, Constraint
from Products.ERP5Type.Core.Folder import FolderMixIn from Products.ERP5Type.Core.Folder import FolderMixIn
from Acquisition import aq_base, aq_parent, aq_inner, aq_acquire from Acquisition import aq_base, aq_parent, aq_inner, aq_acquire
from Products.ERP5Type import allowClassTool from Products.ERP5Type import allowClassTool
......
# -*- coding: utf8 -*- # -*- coding: utf-8 -*-
############################################################################## ##############################################################################
# Copyright (c) 2009 Nexedi SA and Contributors. All Rights Reserved. # Copyright (c) 2009 Nexedi SA and Contributors. All Rights Reserved.
# Łukasz Nowak <luke@nexedi.com> # Łukasz Nowak <luke@nexedi.com>
...@@ -45,72 +45,72 @@ class TestERP5Interfaces(ERP5TypeTestCase): ...@@ -45,72 +45,72 @@ class TestERP5Interfaces(ERP5TypeTestCase):
def test_TradeModelCell_implements_ITransformation(self): def test_TradeModelCell_implements_ITransformation(self):
from Products.ERP5Type.Document.TradeModelCell import TradeModelCell from Products.ERP5Type.Document.TradeModelCell import TradeModelCell
from Products.ERP5Type.Interface import ITransformation from Products.ERP5Type.interfaces import ITransformation
verifyClass(ITransformation, TradeModelCell) verifyClass(ITransformation, TradeModelCell)
def test_TradeModelCell_implements_IVariated(self): def test_TradeModelCell_implements_IVariated(self):
from Products.ERP5Type.Document.TradeModelCell import TradeModelCell from Products.ERP5Type.Document.TradeModelCell import TradeModelCell
from Products.ERP5Type.Interface import IVariated from Products.ERP5Type.interfaces import IVariated
verifyClass(IVariated, TradeModelCell) verifyClass(IVariated, TradeModelCell)
def test_TradeModelLine_implements_ITransformation(self): def test_TradeModelLine_implements_ITransformation(self):
from Products.ERP5Type.Document.TradeModelLine import TradeModelLine from Products.ERP5Type.Document.TradeModelLine import TradeModelLine
from Products.ERP5Type.Interface import ITransformation from Products.ERP5Type.interfaces import ITransformation
verifyClass(ITransformation, TradeModelLine) verifyClass(ITransformation, TradeModelLine)
def test_TradeModelLine_implements_IVariated(self): def test_TradeModelLine_implements_IVariated(self):
from Products.ERP5Type.Document.TradeModelLine import TradeModelLine from Products.ERP5Type.Document.TradeModelLine import TradeModelLine
from Products.ERP5Type.Interface import IVariated from Products.ERP5Type.interfaces import IVariated
verifyClass(IVariated, TradeModelLine) verifyClass(IVariated, TradeModelLine)
def test_Transformation_implements_ITransformation(self): def test_Transformation_implements_ITransformation(self):
from Products.ERP5Type.Document.Transformation import Transformation from Products.ERP5Type.Document.Transformation import Transformation
from Products.ERP5Type.Interface import ITransformation from Products.ERP5Type.interfaces import ITransformation
verifyClass(ITransformation, Transformation) verifyClass(ITransformation, Transformation)
def test_Transformation_implements_IVariated(self): def test_Transformation_implements_IVariated(self):
from Products.ERP5Type.Document.Transformation import Transformation from Products.ERP5Type.Document.Transformation import Transformation
from Products.ERP5Type.Interface import IVariated from Products.ERP5Type.interfaces import IVariated
verifyClass(IVariated, Transformation) verifyClass(IVariated, Transformation)
def test_BusinessPath_implements_IBusinessPath(self): def test_BusinessPath_implements_IBusinessPath(self):
from Products.ERP5Type.Document.BusinessPath import BusinessPath from Products.ERP5Type.Document.BusinessPath import BusinessPath
from Products.ERP5Type.Interface import IBusinessPath from Products.ERP5Type.interfaces import IBusinessPath
verifyClass(IBusinessPath, BusinessPath) verifyClass(IBusinessPath, BusinessPath)
def test_BusinessPath_implements_IArrow(self): def test_BusinessPath_implements_IArrow(self):
from Products.ERP5Type.Document.BusinessPath import BusinessPath from Products.ERP5Type.Document.BusinessPath import BusinessPath
from Products.ERP5Type.Interface import IArrow from Products.ERP5Type.interfaces import IArrow
verifyClass(IArrow, BusinessPath) verifyClass(IArrow, BusinessPath)
def test_BusinessPath_implements_ICategoryAccessProvider(self): def test_BusinessPath_implements_ICategoryAccessProvider(self):
from Products.ERP5Type.Document.BusinessPath import BusinessPath from Products.ERP5Type.Document.BusinessPath import BusinessPath
from Products.ERP5Type.Interface import ICategoryAccessProvider from Products.ERP5Type.interfaces import ICategoryAccessProvider
verifyClass(ICategoryAccessProvider, BusinessPath) verifyClass(ICategoryAccessProvider, BusinessPath)
def test_TradeModelRule_implements_IRule(self): def test_TradeModelRule_implements_IRule(self):
from Products.ERP5Type.Document.TradeModelRule import TradeModelRule from Products.ERP5Type.Document.TradeModelRule import TradeModelRule
from Products.ERP5Type.Interface import IRule from Products.ERP5Type.interfaces import IRule
verifyClass(IRule, TradeModelRule) verifyClass(IRule, TradeModelRule)
def test_TradeModelRule_implements_IPredicate(self): def test_TradeModelRule_implements_IPredicate(self):
from Products.ERP5Type.Document.TradeModelRule import TradeModelRule from Products.ERP5Type.Document.TradeModelRule import TradeModelRule
from Products.ERP5Type.Interface import IPredicate from Products.ERP5Type.interfaces import IPredicate
verifyClass(IPredicate, TradeModelRule) verifyClass(IPredicate, TradeModelRule)
def test_TransformationRule_implements_IRule(self): def test_TransformationRule_implements_IRule(self):
from Products.ERP5Type.Document.TransformationRule import TransformationRule from Products.ERP5Type.Document.TransformationRule import TransformationRule
from Products.ERP5Type.Interface import IRule from Products.ERP5Type.interfaces import IRule
verifyClass(IRule, TransformationRule) verifyClass(IRule, TransformationRule)
def test_TransformationRule_implements_IPredicate(self): def test_TransformationRule_implements_IPredicate(self):
from Products.ERP5Type.Document.TransformationRule import TransformationRule from Products.ERP5Type.Document.TransformationRule import TransformationRule
from Products.ERP5Type.Interface import IPredicate from Products.ERP5Type.interfaces import IPredicate
verifyClass(IPredicate, TransformationRule) verifyClass(IPredicate, TransformationRule)
def test_TransformedResource_implements_IVariated(self): def test_TransformedResource_implements_IVariated(self):
from Products.ERP5Type.Document.TransformedResource import TransformedResource from Products.ERP5Type.Document.TransformedResource import TransformedResource
from Products.ERP5Type.Interface import IVariated from Products.ERP5Type.interfaces import IVariated
verifyClass(IVariated, TransformedResource) verifyClass(IVariated, TransformedResource)
def test_suite(): def test_suite():
......
...@@ -272,7 +272,7 @@ class TestPredicates(TestPredicateMixIn): ...@@ -272,7 +272,7 @@ class TestPredicates(TestPredicateMixIn):
def test_Interface(self): def test_Interface(self):
"""Test Predicate implements Predicate interface.""" """Test Predicate implements Predicate interface."""
from Products.ERP5Type.Interface import Predicate as IPredicate from Products.ERP5Type.interfaces import IPredicate
from Products.ERP5Type.Document.Predicate import Predicate from Products.ERP5Type.Document.Predicate import Predicate
predicate = self.createPredicate() predicate = self.createPredicate()
self.failUnless(IPredicate.isImplementedBy(predicate)) self.failUnless(IPredicate.isImplementedBy(predicate))
......
...@@ -119,7 +119,7 @@ class %(class_name)s : ...@@ -119,7 +119,7 @@ class %(class_name)s :
} }
string = self.copyright_text + """ string = self.copyright_text + """
from Products.ERP5Type import Permissions, PropertySheet, Constraint, Interface from Products.ERP5Type import Permissions, PropertySheet, Constraint, interfaces
from Products.ERP5Type.XMLObject import XMLObject from Products.ERP5Type.XMLObject import XMLObject
from Products.ERP5.Core.Node import Node from Products.ERP5.Core.Node import Node
......
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
from AccessControl import ClassSecurityInfo from AccessControl import ClassSecurityInfo
from Products.ERP5Type import Permissions, PropertySheet, Constraint, Interface from Products.ERP5Type import Permissions, PropertySheet, Constraint
from Products.ERP5Type.Core.Folder import Folder from Products.ERP5Type.Core.Folder import Folder
from Products.CMFCore.utils import getToolByName from Products.CMFCore.utils import getToolByName
......
...@@ -38,7 +38,7 @@ from OFS.Image import File as OFSFile ...@@ -38,7 +38,7 @@ from OFS.Image import File as OFSFile
from OFS.content_types import guess_content_type from OFS.content_types import guess_content_type
from Products.CMFCore.utils import getToolByName, _setCacheHeaders,\ from Products.CMFCore.utils import getToolByName, _setCacheHeaders,\
_ViewEmulator _ViewEmulator
from Products.ERP5Type import Permissions, PropertySheet, Constraint, Interface from Products.ERP5Type import Permissions, PropertySheet, Constraint
from Products.ERP5Type.Cache import CachingMethod from Products.ERP5Type.Cache import CachingMethod
from Products.ERP5Type.UnrestrictedMethod import UnrestrictedMethod from Products.ERP5Type.UnrestrictedMethod import UnrestrictedMethod
from Products.ERP5.Document.File import File from Products.ERP5.Document.File import File
......
...@@ -328,7 +328,7 @@ if allowClassTool(): ...@@ -328,7 +328,7 @@ if allowClassTool():
from AccessControl import ClassSecurityInfo from AccessControl import ClassSecurityInfo
from Products.CMFCore.utils import getToolByName from Products.CMFCore.utils import getToolByName
from Products.ERP5Type import Permissions, PropertySheet, Constraint, Interface from Products.ERP5Type import Permissions, PropertySheet, Constraint, interfaces
from Products.ERP5Type.XMLObject import XMLObject from Products.ERP5Type.XMLObject import XMLObject
class %s(XMLObject): class %s(XMLObject):
...@@ -743,7 +743,7 @@ class %s(Constraint): ...@@ -743,7 +743,7 @@ class %s(Constraint):
os.mkdir(base_path) os.mkdir(base_path)
# Make sub-directories if not present. # Make sub-directories if not present.
for d in ('Interface', 'Document', 'PropertySheet', 'Extensions', 'Tool', 'Constraint', for d in ('interfaces', 'Document', 'PropertySheet', 'Extensions', 'Tool', 'Constraint',
'tests', 'help', 'skins', 'dtml', ): 'tests', 'help', 'skins', 'dtml', ):
path = os.path.join(base_path, d) path = os.path.join(base_path, d)
if not os.path.exists(path): if not os.path.exists(path):
......
...@@ -16,7 +16,7 @@ import re ...@@ -16,7 +16,7 @@ import re
import transaction import transaction
from Acquisition import aq_parent, aq_inner, aq_base from Acquisition import aq_parent, aq_inner, aq_base
from AccessControl import ClassSecurityInfo, ModuleSecurityInfo from AccessControl import ClassSecurityInfo, ModuleSecurityInfo
from Products.ERP5Type import Permissions, PropertySheet, Constraint, Interface from Products.ERP5Type import Permissions, PropertySheet, Constraint
from Products.CMFCore.PortalContent import NoWL, ResourceLockedError from Products.CMFCore.PortalContent import NoWL, ResourceLockedError
from Products.CMFCore.utils import getToolByName from Products.CMFCore.utils import getToolByName
from Products.CMFDefault.utils import parseHeadersBody from Products.CMFDefault.utils import parseHeadersBody
......
...@@ -190,7 +190,7 @@ return result ...@@ -190,7 +190,7 @@ return result
py_script_id = "testCachedMethod" py_script_id = "testCachedMethod"
py_script_obj = getattr(portal, py_script_id) py_script_obj = getattr(portal, py_script_id)
for cf_name in ('ram_cache_factory', for cf_name in ('ram_cache_factory',
'distributed_ram_cache_factory', # 'distributed_ram_cache_factory',
'sql_cache_factory', 'sql_cache_factory',
'zodb_cache_factory',): 'zodb_cache_factory',):
my_cache = CachingMethod(py_script_obj, my_cache = CachingMethod(py_script_obj,
...@@ -229,7 +229,8 @@ return result ...@@ -229,7 +229,8 @@ return result
## 2nd call - should be cached now ## 2nd call - should be cached now
start = time.time() start = time.time()
cached = my_cache(nb_iterations, portal_path=('', portal.getId())) for i in xrange(100):
cached = my_cache(nb_iterations, portal_path=('', portal.getId()))
end = time.time() end = time.time()
calculation_time = end-start calculation_time = end-start
print "\n\tCalculation time (2nd call)", calculation_time print "\n\tCalculation time (2nd call)", calculation_time
...@@ -279,7 +280,7 @@ return result ...@@ -279,7 +280,7 @@ return result
from Products.ERP5Type.CachePlugins.RamCache import RamCache from Products.ERP5Type.CachePlugins.RamCache import RamCache
from Products.ERP5Type.CachePlugins.SQLCache import SQLCache from Products.ERP5Type.CachePlugins.SQLCache import SQLCache
from Products.ERP5Type.CachePlugins.ZODBCache import ZODBCache from Products.ERP5Type.CachePlugins.ZODBCache import ZODBCache
from Products.ERP5Type.Interface.ICachePlugin import ICachePlugin from Products.ERP5Type.interfaces.cache_plugin import ICachePlugin
from Interface.Verify import verifyClass from Interface.Verify import verifyClass
verifyClass(ICachePlugin, ZODBCache) verifyClass(ICachePlugin, ZODBCache)
verifyClass(ICachePlugin, DistributedRamCache) verifyClass(ICachePlugin, DistributedRamCache)
......
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