[z3-checkins] r27739 - z3/sqlos/branch/jinty-sqlobject2/src/sqlos
jinty at codespeak.net
jinty at codespeak.net
Fri May 26 20:57:20 CEST 2006
Author: jinty
Date: Fri May 26 20:57:18 2006
New Revision: 27739
Removed:
z3/sqlos/branch/jinty-sqlobject2/src/sqlos/meta.zcml
z3/sqlos/branch/jinty-sqlobject2/src/sqlos/metaconfigure.py
z3/sqlos/branch/jinty-sqlobject2/src/sqlos/metadirectives.py
Log:
oops
Deleted: /z3/sqlos/branch/jinty-sqlobject2/src/sqlos/meta.zcml
==============================================================================
--- /z3/sqlos/branch/jinty-sqlobject2/src/sqlos/meta.zcml Fri May 26 20:57:18 2006
+++ (empty file)
@@ -1,21 +0,0 @@
-<configure xmlns='http://namespaces.zope.org/zope'
- xmlns:meta="http://namespaces.zope.org/meta"
- i18n_domain="sqlos">
-
- <meta:directives namespace="http://namespaces.sqlobject.org/sqlos">
-
- <meta:directive
- name="factory"
- schema=".metadirectives.IFactoryDirective"
- handler=".metaconfigure.handler"
- />
-
- <meta:directive
- name="connectionName"
- schema=".metadirectives.IConnectionName"
- handler=".metaconfigure.connectionName"
- />
-
- </meta:directives>
-
-</configure>
Deleted: /z3/sqlos/branch/jinty-sqlobject2/src/sqlos/metaconfigure.py
==============================================================================
--- /z3/sqlos/branch/jinty-sqlobject2/src/sqlos/metaconfigure.py Fri May 26 20:57:18 2006
+++ (empty file)
@@ -1,75 +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 $
-"""
-
-from zope.interface.verify import verifyClass
-from zope.interface import directlyProvides, implements
-from zope.app.component.metaconfigure import utility, PublicPermission, proxify
-from zope.security.checker import defineChecker, Checker
-from zope.security.checker import getCheckerForInstancesOf, MultiChecker
-from zope.component.factory import Factory, IFactory
-from sqlos.interfaces import IISQLObject, IConnectionName
-from sqlos.interfaces import IReadSQLObjectClass, IWriteSQLObjectClass
-
-def handler(_context, component, id, title=None, description=None):
- if isinstance(component, basestring):
- component = _context.resolve(component)
-
- factoryObj = Factory(component, title, description)
-
- # XXX We compute a permission name from the package top-level name
- # plus the component (which should be a class) __name__ The
- # permission should probably be part of the directive here.
- package = component.__module__.split('.')[0]
- add_perm = '%s.Add%s' % (package, component.__name__)
- utility(_context, IFactory, factoryObj,
- permission=add_perm, name=id)
-
- if not IISQLObject.providedBy(component):
- if verifyClass(IISQLObject, component, tentative=1):
- directlyProvides(component, IISQLObject)
-
- # XXX We are really creating a proxy for the *class* here.
- # However, we don't want to modify the class, and we don't want
- # this to conflict with the checker created by the <content>
- # directive, so we create a Proxy using a checker with computed
- # permission names. The permissions should probably be part of
- # the directive.
-
- checker = getCheckerForInstancesOf(component)
- if checker is None:
- read_perm = '%s.View%s' % (package, component.__name__)
- change_perm = '%s.Change%s' % (package, component.__name__)
- checker = MultiChecker(((IReadSQLObjectClass, read_perm),
- (IWriteSQLObjectClass, change_perm),
- ))
- checker = Checker(checker.get_permissions, {})
- defineChecker(component, checker)
-
- proxied = proxify(component, checker)
-
- # XXX We pass permission=None here so that the utility handler
- # doesn't override what we've just did above.
- utility(_context, IISQLObject, proxied,
- permission=None, name=id)
-
-class ConnectionName:
- """A connection name utility"""
-
- implements(IConnectionName)
-
- def __init__(self, name):
- self.name = name
-
-def connectionName(_context, name):
- component = ConnectionName(name)
- utility(_context, IConnectionName, component,
- permission=PublicPermission, name='')
Deleted: /z3/sqlos/branch/jinty-sqlobject2/src/sqlos/metadirectives.py
==============================================================================
--- /z3/sqlos/branch/jinty-sqlobject2/src/sqlos/metadirectives.py Fri May 26 20:57:18 2006
+++ (empty file)
@@ -1,51 +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 $
-"""
-
-from zope.interface import Interface
-from zope.configuration.fields import GlobalObject, MessageID
-from zope.schema import TextLine
-
-class IConnectionName(Interface):
-
- name = TextLine(
- title=u"Connection Name",
- required=True
- )
-
-class IFactoryDirective(Interface):
- """
- Define a factory
- """
-
- component = GlobalObject(
- title=u"Component to be used",
- required=True
- )
-
- id = TextLine(
- title=u"ID",
- required=False
- )
-
- title = MessageID(
- title=u"Title",
- description=u"""
- text suitable for use in the 'add content' menu of a
- management interface""",
- required=False
- )
-
- description = MessageID(
- title=u"Description",
- description=u"Longer narrative description of what this factory does",
- required=False
- )
More information about the z3-checkins
mailing list