[Zope3-checkins] CVS: Zope3/src/zope/app/utilities -
content.py:1.4.6.1 instance.py:1.2.6.1 schema.py:1.4.6.1
Jim Fulton
jim at zope.com
Mon Sep 8 15:22:24 EDT 2003
Update of /cvs-repository/Zope3/src/zope/app/utilities
In directory cvs.zope.org:/tmp/cvs-serv20092/src/zope/app/utilities
Modified Files:
Tag: parentgeddon-branch
content.py instance.py schema.py
Log Message:
Checking in work in progress on parentgeddon-branch so Fred can help
me to get the tests passing. Specific log entries will be provided
when we merge this into the head.
=== Zope3/src/zope/app/utilities/content.py 1.4 => 1.4.6.1 ===
--- Zope3/src/zope/app/utilities/content.py:1.4 Mon Aug 18 14:55:37 2003
+++ Zope3/src/zope/app/utilities/content.py Mon Sep 8 14:21:52 2003
@@ -35,11 +35,11 @@
from zope.app.services.servicenames import BrowserMenu
from zope.app.services.utility import UtilityRegistration
from zope.component.exceptions import ComponentLookupError
-from zope.context import ContextMethod, ContextProperty
from zope.interface import directlyProvides, implements
from zope.schema import getFields
from zope.security.checker import CheckerPublic, Checker, defineChecker
+
MenuItemKey = 'http://www.zope.org/utilities/content/menuitem'
@@ -168,15 +168,12 @@
setattr(item, name, getattr(self, name))
self._data['menuItemId'] = menu.setObject('something', item)
- createMenuItem = ContextMethod(createMenuItem)
-
def removeMenuItem(self):
"See zope.app.interfaces.utilities.content.IContentComponentMenuItem"
self._data['menu'].__delitem__(self._data['menuItemId'])
self._data['menu'] = None
self._data['menuItemId'] = None
- removeMenuItem = ContextMethod(removeMenuItem)
def _setMenuId(self, value):
@@ -186,8 +183,7 @@
self.removeMenuItem()
self.createMenuItem()
- menuId = ContextProperty(
- lambda self: self._data['menuId'], _setMenuId)
+ menuId = property(lambda self: self._data['menuId'], _setMenuId)
def _setInterface(self, value):
@@ -197,8 +193,7 @@
if self._menuItem is not None:
self._menuItem.interface = value
- interface = ContextProperty(
- lambda self: self._data['interface'], _setInterface)
+ interface = property(lambda self: self._data['interface'], _setInterface)
def _getAction(self):
@@ -217,7 +212,7 @@
if self._menuItem is not None:
self._menuItem.title = value
- title = ContextProperty(_getTitle, _setTitle)
+ title = property(_getTitle, _setTitle)
def _setDescription(self, value):
@@ -227,8 +222,8 @@
if self._menuItem is not None:
self._menuItem.description = value
- description = ContextProperty(
- lambda self: self._data['description'], _setDescription)
+ description = property(lambda self: self._data['description'],
+ _setDescription)
def _setPermission(self, value):
if self._data['permission'] != value:
@@ -237,8 +232,8 @@
if self._menuItem is not None:
self._menuItem.permission = value
- permission = ContextProperty(
- lambda self: self._data['permission'], _setPermission)
+ permission = property(lambda self: self._data['permission'],
+ _setPermission)
def _setFilterString(self, value):
@@ -248,8 +243,8 @@
if self._menuItem is not None:
self._menuItem.filter = value
- filter_string = ContextProperty(
- lambda self: self._data['filter_string'], _setFilterString)
+ filter_string = property(lambda self: self._data['filter_string'],
+ _setFilterString)
def _setCreate(self, value):
@@ -258,8 +253,8 @@
self._data['create'] = value
self.createMenuItem()
- create = ContextProperty(
- lambda self: self._data['create'], _setCreate)
+ create = property(lambda self: self._data['create'],
+ _setCreate)
@@ -273,7 +268,6 @@
component = self.getComponent()
component.name = self.name
zapi.getAdapter(component, IContentComponentMenuItem).createMenuItem()
- activated = ContextMethod(activated)
def deactivated(self):
"""Once activated, we have to unregister the new Content Object with
@@ -281,7 +275,6 @@
component = self.getComponent()
component.name = None
zapi.getAdapter(component, IContentComponentMenuItem).removeMenuItem()
- deactivated = ContextMethod(deactivated)
class ContentComponentInstance(Persistent):
=== Zope3/src/zope/app/utilities/instance.py 1.2 => 1.2.6.1 ===
--- Zope3/src/zope/app/utilities/instance.py:1.2 Fri Aug 15 20:44:21 2003
+++ Zope3/src/zope/app/utilities/instance.py Mon Sep 8 14:21:52 2003
@@ -20,7 +20,6 @@
from persistence import Persistent
from persistence.dict import PersistentDict
from zope.app.component.interfacefield import InterfaceField
-from zope.context import ContextMethod
from zope.interface import directlyProvides, implements, Interface
from zope.schema import getFields, TextLine
from zope.security.checker import CheckerPublic, Checker, defineChecker
@@ -88,8 +87,6 @@
super(ContentComponentInstance, self).__setattr__(key, value)
else:
raise AttributeError, 'Attribute not available'
-
- __setattr__ = ContextMethod(__setattr__)
def getSchema(self):
=== Zope3/src/zope/app/utilities/schema.py 1.4 => 1.4.6.1 ===
--- Zope3/src/zope/app/utilities/schema.py:1.4 Mon Aug 18 14:52:55 2003
+++ Zope3/src/zope/app/utilities/schema.py Mon Sep 8 14:21:52 2003
@@ -25,11 +25,10 @@
from zope.app.services.interface import PersistentInterfaceClass
from zope.app.services.interface import PersistentInterface
from zope.app.services.utility import UtilityRegistration
-from zope.context import ContextMethod
from zope.interface import implements
from zope.interface import directlyProvides, directlyProvidedBy
from zope.schema import getFieldsInOrder, getFieldNamesInOrder
-
+from zope.app.container.contained import Contained
class SchemaUtility(PersistentInterfaceClass):
@@ -131,7 +130,7 @@
name = self.contentName
container = zapi.getAdapter(self.context, IMutableSchema)
container.addField(name, content)
- return zapi.ContextWrapper(content, container, name=name)
+ return content
def nextURL(self):
"""See zope.app.interfaces.container.IAdding"""
@@ -149,21 +148,18 @@
def activated(self):
schema = self.getComponent()
schema.setName(self.name)
- activated = ContextMethod(activated)
def deactivated(self):
schema = self.getComponent()
schema.setName('<schema not activated>')
- deactivated = ContextMethod(deactivated)
# XXX: This needs refactoring
-class MutableSchemaContent:
+class MutableSchemaContent(Contained):
implements(IMutableSchemaContent)
schema_id = None
- zapi.ContextAwareDescriptors()
def _set_schema(self, iface):
directlyProvides(self, iface)
More information about the Zope3-Checkins
mailing list