[z3-checkins] r5477 - in z3/sqlos/trunk: . ftests interfaces
services
dreamcatcher at codespeak.net
dreamcatcher at codespeak.net
Wed Jul 7 18:06:13 MEST 2004
Author: dreamcatcher
Date: Wed Jul 7 18:06:13 2004
New Revision: 5477
Removed:
z3/sqlos/trunk/descriptor.py
z3/sqlos/trunk/interfaces/services.py
z3/sqlos/trunk/services/
Modified:
z3/sqlos/trunk/ftests/test_transaction.py
z3/sqlos/trunk/meta.zcml
Log:
Dead chickens, consider yourself buried.
Deleted: /z3/sqlos/trunk/descriptor.py
==============================================================================
--- /z3/sqlos/trunk/descriptor.py Wed Jul 7 18:06:13 2004
+++ (empty file)
@@ -1,49 +0,0 @@
-##############################################################################
-#
-# Copyright (c) 2004 Enfold Systems LLC. All rights reserved.
-#
-# This software is distributed under the terms of the Zope Public
-# License (ZPL) v2.1. See COPYING.txt for more information.
-#
-##############################################################################
-"""
-$Id: __init__.py 5216 2004-06-21 18:33:07Z dreamcatcher $
-"""
-__metaclass__ = type
-
-from zope.security.checker import NamesChecker
-
-class ClassObjDescriptor:
-
- def __init__(self, name, module='sqlos'):
- self.name = name
- self.module = module
-
- def __get__(self, inst, cls=None):
- if inst is None:
- # being called for the class
- # XXX This is going to be replaced by registering a
- # proxied class using the sqlos:factory directive
- # with computed permission names (or maybe providing
- # permission names on the directive). The content
- # creation will be protected on the IFactory utility.
- add_perm = '%s.Add%s' % (self.module, cls.__name__)
- checker = NamesChecker(new=add_perm,
- q='zope.View',
- select='zope.View')
- return checker
- try:
- return inst.__dict__[self.name]
- except KeyError:
- raise AttributeError, self.name
-
- def __set__(self, inst, value):
- if value is None:
- raise AttributeError, '%s cannot be None' % self.name
- inst.__dict__[self.name] = value
-
- def __delete__(self, inst):
- try:
- del inst.__dict__[self.name]
- except KeyError:
- raise AttributeError, self.name
Modified: z3/sqlos/trunk/ftests/test_transaction.py
==============================================================================
--- z3/sqlos/trunk/ftests/test_transaction.py (original)
+++ z3/sqlos/trunk/ftests/test_transaction.py Wed Jul 7 18:06:13 2004
@@ -21,7 +21,6 @@
from sqlos import getFactory
from sqlos.container import SQLObjectContainer
-from sqlos.services.classservice import registerClass
from sqlos.tests.sampleperson import SamplePerson
from psycopgda.adapter import PsycopgAdapter
@@ -36,7 +35,6 @@
def setUp(self):
BrowserTestCase.setUp(self)
- registerClass(SamplePerson, 'SamplePerson')
self.conn = PsycopgAdapter(DSN)
utilities = zapi.getService(None, zapi.servicenames.Utilities)
utilities.provideUtility(IZopeDatabaseAdapter, self.conn, 'stub')
Deleted: /z3/sqlos/trunk/interfaces/services.py
==============================================================================
--- /z3/sqlos/trunk/interfaces/services.py Wed Jul 7 18:06:13 2004
+++ (empty file)
@@ -1,33 +0,0 @@
-##############################################################################
-#
-# Copyright (c) 2004 Enfold Systems LLC. All rights reserved.
-#
-# This software is distributed under the terms of the Zope Public
-# License (ZPL) v2.1. See COPYING.txt for more information.
-#
-##############################################################################
-"""
-$Id$
-"""
-from zope.interface import Interface
-from zope.schema import Choice
-
-class IClassService(Interface):
- """ A simple registry of factory classes """
-
- def getClass(name):
- """ Return a class registered by the given name """
-
- def queryClass(name, default=None):
- """ Query for a named class and return default if not found """
-
- def getClassesByInterface(self, iface):
- """ Return a list of classes registered by the given interface"""
-
- def getClassNameByClass(self, klass):
- """ Return the name a class is registered under"""
-
-class IGlobalClassService(IClassService):
-
- def registerClass(self, _class, name=''):
- """ Register a given class by a name """
Modified: z3/sqlos/trunk/meta.zcml
==============================================================================
--- z3/sqlos/trunk/meta.zcml (original)
+++ z3/sqlos/trunk/meta.zcml Wed Jul 7 18:06:13 2004
@@ -2,19 +2,6 @@
xmlns:meta="http://namespaces.zope.org/meta"
i18n_domain="sqlos">
- <serviceType id='ClassService'
- interface='.interfaces.services.IClassService' />
- <service serviceType='ClassService'
- permission='zope.ManageContent'
- component='.services.classservice.service' />
-
- <meta:directives namespace="http://namespaces.zope.org/class">
-
- <directive name="registerClass" attributes="component name"
- handler=".services.metaconfigure.classhandler" />
-
- </meta:directives>
-
<meta:directives namespace="http://namespaces.sqlobject.org/sqlos">
<meta:directive
More information about the z3-checkins
mailing list