work in progress: make loops package work with BlueBream 1.0
This commit is contained in:
parent
29ad535ce5
commit
8dc0d49972
25 changed files with 54 additions and 60 deletions
|
@ -552,7 +552,7 @@ view for rendering.)
|
||||||
False
|
False
|
||||||
|
|
||||||
>>> view.renderTarget()
|
>>> view.renderTarget()
|
||||||
u'<p>Test data</p>\n<p>Another <a class="reference" href="para">paragraph</a></p>\n'
|
u'<p>Test data</p>\n<p>Another <a class="reference external" href="para">paragraph</a></p>\n'
|
||||||
|
|
||||||
u'<p>Test data</p>\n<p>Another <a class="reference create"
|
u'<p>Test data</p>\n<p>Another <a class="reference create"
|
||||||
href="http://127.0.0.1/loops/wiki/create.html?linkid=0000001">?paragraph</a></p>\n'
|
href="http://127.0.0.1/loops/wiki/create.html?linkid=0000001">?paragraph</a></p>\n'
|
||||||
|
|
|
@ -24,7 +24,6 @@ $Id$
|
||||||
|
|
||||||
from itertools import groupby
|
from itertools import groupby
|
||||||
from zope import interface, component, schema
|
from zope import interface, component, schema
|
||||||
from zope.app import zapi
|
|
||||||
from zope.app.catalog.interfaces import ICatalog
|
from zope.app.catalog.interfaces import ICatalog
|
||||||
from zope.lifecycleevent import ObjectCreatedEvent, ObjectModifiedEvent
|
from zope.lifecycleevent import ObjectCreatedEvent, ObjectModifiedEvent
|
||||||
from zope.app.container.contained import ObjectRemovedEvent
|
from zope.app.container.contained import ObjectRemovedEvent
|
||||||
|
@ -43,6 +42,7 @@ from zope.publisher.interfaces.browser import IBrowserRequest
|
||||||
from zope.schema.interfaces import IIterableSource
|
from zope.schema.interfaces import IIterableSource
|
||||||
from zope.security.proxy import removeSecurityProxy
|
from zope.security.proxy import removeSecurityProxy
|
||||||
from zope.traversing.api import getName
|
from zope.traversing.api import getName
|
||||||
|
from zope.traversing.browser import absoluteURL
|
||||||
|
|
||||||
from cybertools.browser.action import actions
|
from cybertools.browser.action import actions
|
||||||
from cybertools.composer.interfaces import IInstance
|
from cybertools.composer.interfaces import IInstance
|
||||||
|
@ -182,7 +182,7 @@ class BaseRelationView(BaseView):
|
||||||
|
|
||||||
@Lazy
|
@Lazy
|
||||||
def predicateUrl(self):
|
def predicateUrl(self):
|
||||||
return zapi.absoluteURL(self.predicate, self.request)
|
return absoluteURL(self.predicate, self.request)
|
||||||
|
|
||||||
@Lazy
|
@Lazy
|
||||||
def relevance(self):
|
def relevance(self):
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#
|
#
|
||||||
# Copyright (c) 2006 Helmut Merz helmutm@cy55.de
|
# Copyright (c) 2011 Helmut Merz helmutm@cy55.de
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or modify
|
# 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
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
@ -22,7 +22,6 @@ Definition of view classes for the top-level loops container.
|
||||||
$Id$
|
$Id$
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from zope.app import zapi
|
|
||||||
from zope import component
|
from zope import component
|
||||||
from zope.lifecycleevent import ObjectCreatedEvent, ObjectModifiedEvent
|
from zope.lifecycleevent import ObjectCreatedEvent, ObjectModifiedEvent
|
||||||
from zope.event import notify
|
from zope.event import notify
|
||||||
|
|
|
@ -25,7 +25,6 @@ $Id$
|
||||||
from urlparse import urlparse, urlunparse
|
from urlparse import urlparse, urlunparse
|
||||||
from zope import component, interface, schema
|
from zope import component, interface, schema
|
||||||
from zope.cachedescriptors.property import Lazy
|
from zope.cachedescriptors.property import Lazy
|
||||||
from zope.app import zapi
|
|
||||||
from zope.annotation.interfaces import IAnnotations
|
from zope.annotation.interfaces import IAnnotations
|
||||||
from zope.app.catalog.interfaces import ICatalog
|
from zope.app.catalog.interfaces import ICatalog
|
||||||
from zope.app.container.browser.contents import JustContents
|
from zope.app.container.browser.contents import JustContents
|
||||||
|
@ -39,8 +38,10 @@ from zope.lifecycleevent import ObjectCreatedEvent, ObjectModifiedEvent
|
||||||
from zope.lifecycleevent import Attributes
|
from zope.lifecycleevent import Attributes
|
||||||
from zope.formlib.form import Form, FormFields
|
from zope.formlib.form import Form, FormFields
|
||||||
from zope.proxy import removeAllProxies
|
from zope.proxy import removeAllProxies
|
||||||
|
from zope.publisher.defaultview import getDefaultViewName
|
||||||
from zope.security import canAccess, canWrite, checkPermission
|
from zope.security import canAccess, canWrite, checkPermission
|
||||||
from zope.security.proxy import removeSecurityProxy
|
from zope.security.proxy import removeSecurityProxy
|
||||||
|
from zope.traversing.api import getParent, getParents, getPath
|
||||||
|
|
||||||
from cybertools.ajax import innerHtml
|
from cybertools.ajax import innerHtml
|
||||||
from cybertools.browser import configurator
|
from cybertools.browser import configurator
|
||||||
|
@ -243,7 +244,7 @@ class NodeView(BaseView):
|
||||||
return u''
|
return u''
|
||||||
if text.startswith('<'): # seems to be HTML
|
if text.startswith('<'): # seems to be HTML
|
||||||
return text
|
return text
|
||||||
source = zapi.createObject(self.context.contentType, text)
|
source = component.createObject(self.context.contentType, text)
|
||||||
view = component.getMultiAdapter((removeAllProxies(source), self.request))
|
view = component.getMultiAdapter((removeAllProxies(source), self.request))
|
||||||
return view.render()
|
return view.render()
|
||||||
|
|
||||||
|
@ -316,7 +317,7 @@ class NodeView(BaseView):
|
||||||
menu = self.menuObject
|
menu = self.menuObject
|
||||||
parentMenu = None
|
parentMenu = None
|
||||||
while menu is not None:
|
while menu is not None:
|
||||||
parent = zapi.getParent(menu)
|
parent = getParent(menu)
|
||||||
if INode.providedBy(parent):
|
if INode.providedBy(parent):
|
||||||
parentMenu = parent.getMenu()
|
parentMenu = parent.getMenu()
|
||||||
if parentMenu is None or parentMenu is menu:
|
if parentMenu is None or parentMenu is menu:
|
||||||
|
@ -348,7 +349,7 @@ class NodeView(BaseView):
|
||||||
|
|
||||||
@Lazy
|
@Lazy
|
||||||
def parents(self):
|
def parents(self):
|
||||||
return zapi.getParents(self.context)
|
return getParents(self.context)
|
||||||
|
|
||||||
@Lazy
|
@Lazy
|
||||||
def nearestMenuItem(self):
|
def nearestMenuItem(self):
|
||||||
|
@ -413,7 +414,7 @@ class NodeView(BaseView):
|
||||||
target = self.virtualTargetObject
|
target = self.virtualTargetObject
|
||||||
if target is not None:
|
if target is not None:
|
||||||
# zope.app.publisher.browser
|
# zope.app.publisher.browser
|
||||||
name = zapi.getDefaultViewName(target, self.request)
|
name = getDefaultViewName(target, self.request)
|
||||||
return self.targetView(name)
|
return self.targetView(name)
|
||||||
return u''
|
return u''
|
||||||
|
|
||||||
|
@ -718,8 +719,8 @@ class ConfigureView(NodeView):
|
||||||
container = type.defaultContainer
|
container = type.defaultContainer
|
||||||
name = form.get('create.name', '')
|
name = form.get('create.name', '')
|
||||||
if not name:
|
if not name:
|
||||||
viewManagerPath = zapi.getPath(root.getViewManager())
|
viewManagerPath = getPath(root.getViewManager())
|
||||||
name = zapi.getPath(self.context)[len(viewManagerPath)+1:]
|
name = getPath(self.context)[len(viewManagerPath)+1:]
|
||||||
name = name.replace('/', '.')
|
name = name.replace('/', '.')
|
||||||
# check for duplicates:
|
# check for duplicates:
|
||||||
num = 1
|
num = 1
|
||||||
|
@ -836,7 +837,7 @@ class NodeViewConfigurator(configurator.AnnotationViewConfigurator):
|
||||||
@property
|
@property
|
||||||
def viewProperties(self):
|
def viewProperties(self):
|
||||||
result = []
|
result = []
|
||||||
for p in list(reversed(zapi.getParents(self.context))) + [self.context]:
|
for p in list(reversed(getParents(self.context))) + [self.context]:
|
||||||
if not INode.providedBy(p) or p.nodeType != 'menu':
|
if not INode.providedBy(p) or p.nodeType != 'menu':
|
||||||
continue
|
continue
|
||||||
ann = IAnnotations(p)
|
ann = IAnnotations(p)
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#
|
#
|
||||||
# Copyright (c) 2006 Helmut Merz helmutm@cy55.de
|
# Copyright (c) 2011 Helmut Merz helmutm@cy55.de
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or modify
|
# 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
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
@ -22,10 +22,10 @@ Utilities.
|
||||||
$Id$
|
$Id$
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from zope.app import zapi
|
|
||||||
from zope.app.pagetemplate import ViewPageTemplateFile
|
from zope.app.pagetemplate import ViewPageTemplateFile
|
||||||
from zope.app.publisher.browser.menu import BrowserMenu
|
from zope.app.publisher.browser.menu import BrowserMenu
|
||||||
from zope.app.publisher.interfaces.browser import IBrowserSubMenuItem
|
from zope.app.publisher.interfaces.browser import IBrowserSubMenuItem
|
||||||
|
from zope import component
|
||||||
from zope.formlib.namedtemplate import NamedTemplateImplementation
|
from zope.formlib.namedtemplate import NamedTemplateImplementation
|
||||||
|
|
||||||
|
|
||||||
|
@ -45,7 +45,7 @@ class LoopsMenu(BrowserMenu):
|
||||||
def getMenuItems(self, object, request):
|
def getMenuItems(self, object, request):
|
||||||
"""Return menu item entries in a TAL-friendly form."""
|
"""Return menu item entries in a TAL-friendly form."""
|
||||||
result = sorted([(item.order, item.action.lower(), item)
|
result = sorted([(item.order, item.action.lower(), item)
|
||||||
for name, item in zapi.getAdapters(
|
for name, item in component.getAdapters(
|
||||||
(object, request), self.getMenuItemType())
|
(object, request), self.getMenuItemType())
|
||||||
if item.available()])
|
if item.available()])
|
||||||
return [
|
return [
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#
|
#
|
||||||
# Copyright (c) 2008 Helmut Merz helmutm@cy55.de
|
# Copyright (c) 2011 Helmut Merz helmutm@cy55.de
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or modify
|
# 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
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
@ -27,8 +27,8 @@ from BTrees.IFBTree import weightedIntersection, weightedUnion, IFBucket
|
||||||
from zope import schema, component
|
from zope import schema, component
|
||||||
from zope.interface import Interface, Attribute, implements
|
from zope.interface import Interface, Attribute, implements
|
||||||
from zope.app.catalog.interfaces import ICatalog
|
from zope.app.catalog.interfaces import ICatalog
|
||||||
from zope.app.intid.interfaces import IIntIds
|
|
||||||
from zope.cachedescriptors.property import Lazy
|
from zope.cachedescriptors.property import Lazy
|
||||||
|
from zope.intid.interfaces import IIntIds
|
||||||
|
|
||||||
from cybertools.typology.interfaces import IType
|
from cybertools.typology.interfaces import IType
|
||||||
from loops.common import AdapterBase
|
from loops.common import AdapterBase
|
||||||
|
|
|
@ -26,10 +26,10 @@ from BTrees.IIBTree import IITreeSet
|
||||||
from BTrees.IFBTree import IFBucket, IFBTree, IFTreeSet
|
from BTrees.IFBTree import IFBucket, IFBTree, IFTreeSet
|
||||||
from BTrees.IOBTree import IOBucket, IOBTree
|
from BTrees.IOBTree import IOBucket, IOBTree
|
||||||
from zope import interface, component
|
from zope import interface, component
|
||||||
from zope.app.intid.interfaces import IIntIds
|
|
||||||
from zope.component import adapts
|
from zope.component import adapts
|
||||||
from zope.interface import implements, implementer
|
from zope.interface import implements, implementer
|
||||||
from zope.cachedescriptors.property import Lazy
|
from zope.cachedescriptors.property import Lazy
|
||||||
|
from zope.intid.interfaces import IIntIds
|
||||||
|
|
||||||
from cybertools.catalog.query import Term, Eq, Between, And, Or
|
from cybertools.catalog.query import Term, Eq, Between, And, Or
|
||||||
from cybertools.catalog.query import Text as BaseText
|
from cybertools.catalog.query import Text as BaseText
|
||||||
|
|
1
external/browser.py
vendored
1
external/browser.py
vendored
|
@ -27,7 +27,6 @@ import os
|
||||||
import time
|
import time
|
||||||
from zope import component
|
from zope import component
|
||||||
from zope.interface import Interface, implements
|
from zope.interface import Interface, implements
|
||||||
from zope.app import zapi
|
|
||||||
from zope.app.pagetemplate.viewpagetemplatefile import ViewPageTemplateFile
|
from zope.app.pagetemplate.viewpagetemplatefile import ViewPageTemplateFile
|
||||||
from zope.cachedescriptors.property import Lazy
|
from zope.cachedescriptors.property import Lazy
|
||||||
from zope.security.proxy import removeSecurityProxy
|
from zope.security.proxy import removeSecurityProxy
|
||||||
|
|
|
@ -24,7 +24,6 @@ $Id$
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from zope import interface, component
|
from zope import interface, component
|
||||||
from zope.app import zapi
|
|
||||||
from zope.component import adapts
|
from zope.component import adapts
|
||||||
from zope.interface import implements
|
from zope.interface import implements
|
||||||
from zope.cachedescriptors.property import Lazy
|
from zope.cachedescriptors.property import Lazy
|
||||||
|
|
|
@ -265,7 +265,7 @@ Automatic security settings on persons
|
||||||
Person objects that have a user assigned to them receive this user
|
Person objects that have a user assigned to them receive this user
|
||||||
(principal) as their owner.
|
(principal) as their owner.
|
||||||
|
|
||||||
>>> from zope.app.securitypolicy.interfaces import IPrincipalRoleMap
|
>>> from zope.securitypolicy.interfaces import IPrincipalRoleMap
|
||||||
>>> IPrincipalRoleMap(concepts['john']).getPrincipalsAndRoles()
|
>>> IPrincipalRoleMap(concepts['john']).getPrincipalsAndRoles()
|
||||||
[('loops.Owner', 'users.john', PermissionSetting: Allow)]
|
[('loops.Owner', 'users.john', PermissionSetting: Allow)]
|
||||||
>>> IPrincipalRoleMap(concepts['person.newuser']).getPrincipalsAndRoles()
|
>>> IPrincipalRoleMap(concepts['person.newuser']).getPrincipalsAndRoles()
|
||||||
|
|
|
@ -24,10 +24,10 @@ $Id$
|
||||||
|
|
||||||
from zope.interface import Interface, Attribute
|
from zope.interface import Interface, Attribute
|
||||||
from zope import interface, component, schema
|
from zope import interface, component, schema
|
||||||
from zope.app import zapi
|
|
||||||
from zope.app.principalannotation import annotations
|
from zope.app.principalannotation import annotations
|
||||||
from zope.app.security.interfaces import IAuthentication, PrincipalLookupError
|
from zope.app.security.interfaces import IAuthentication, PrincipalLookupError
|
||||||
from zope.security.proxy import removeSecurityProxy
|
from zope.security.proxy import removeSecurityProxy
|
||||||
|
from zope.traversing.api import getName
|
||||||
|
|
||||||
from cybertools.organize.interfaces import IAddress as IBaseAddress
|
from cybertools.organize.interfaces import IAddress as IBaseAddress
|
||||||
from cybertools.organize.interfaces import IPerson as IBasePerson
|
from cybertools.organize.interfaces import IPerson as IBasePerson
|
||||||
|
@ -70,7 +70,7 @@ class UserId(schema.TextLine):
|
||||||
if person is not None and person != context:
|
if person is not None and person != context:
|
||||||
raiseValidationError(
|
raiseValidationError(
|
||||||
_(u'There is alread a person ($person) assigned to user $userId.',
|
_(u'There is alread a person ($person) assigned to user $userId.',
|
||||||
mapping=dict(person=zapi.getName(person),
|
mapping=dict(person=getName(person),
|
||||||
userId=userId)))
|
userId=userId)))
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -12,7 +12,6 @@ Let's do some basic set up
|
||||||
>>> site = placefulSetUp(True)
|
>>> site = placefulSetUp(True)
|
||||||
|
|
||||||
>>> from zope import component, interface
|
>>> from zope import component, interface
|
||||||
>>> from zope.app import zapi
|
|
||||||
|
|
||||||
and setup a simple loops site with a concept manager and some concepts
|
and setup a simple loops site with a concept manager and some concepts
|
||||||
(with all the type machinery, what in real life is done via standard
|
(with all the type machinery, what in real life is done via standard
|
||||||
|
|
|
@ -24,7 +24,6 @@ $Id$
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from zope import interface, component
|
from zope import interface, component
|
||||||
from zope.app import zapi
|
|
||||||
from zope.component import adapts
|
from zope.component import adapts
|
||||||
from zope.interface import implements
|
from zope.interface import implements
|
||||||
from zope.cachedescriptors.property import Lazy
|
from zope.cachedescriptors.property import Lazy
|
||||||
|
|
|
@ -17,8 +17,8 @@ from zope.app.principalannotation import annotations
|
||||||
from zope.app.principalannotation.interfaces import IPrincipalAnnotationUtility
|
from zope.app.principalannotation.interfaces import IPrincipalAnnotationUtility
|
||||||
from zope.app.security.interfaces import IAuthentication
|
from zope.app.security.interfaces import IAuthentication
|
||||||
from zope.app.security.principalregistry import PrincipalRegistry
|
from zope.app.security.principalregistry import PrincipalRegistry
|
||||||
from zope.app.securitypolicy.interfaces import IRolePermissionManager
|
from zope.securitypolicy.interfaces import IRolePermissionManager
|
||||||
from zope.app.securitypolicy.interfaces import IPrincipalRoleManager
|
from zope.securitypolicy.interfaces import IPrincipalRoleManager
|
||||||
|
|
||||||
from cybertools.util.jeep import Jeep
|
from cybertools.util.jeep import Jeep
|
||||||
from loops.common import adapted
|
from loops.common import adapted
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#
|
#
|
||||||
# Copyright (c) 2009 Helmut Merz helmutm@cy55.de
|
# Copyright (c) 2011 Helmut Merz helmutm@cy55.de
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or modify
|
# 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
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
@ -28,7 +28,7 @@ from zope.app.authentication.interfaces import IAuthenticatorPlugin
|
||||||
from zope.app.authentication.groupfolder import GroupFolder
|
from zope.app.authentication.groupfolder import GroupFolder
|
||||||
from zope.app.security.interfaces import IAuthentication, PrincipalLookupError
|
from zope.app.security.interfaces import IAuthentication, PrincipalLookupError
|
||||||
from zope.app.security.settings import Allow, Deny, Unset
|
from zope.app.security.settings import Allow, Deny, Unset
|
||||||
from zope.app.securitypolicy.interfaces import IPrincipalRoleManager
|
from zope.securitypolicy.interfaces import IPrincipalRoleManager
|
||||||
from zope.traversing.api import getParents
|
from zope.traversing.api import getParents
|
||||||
from loops.common import adapted
|
from loops.common import adapted
|
||||||
from loops.type import getOptionsDict
|
from loops.type import getOptionsDict
|
||||||
|
|
2
query.py
2
query.py
|
@ -27,8 +27,8 @@ from BTrees.IFBTree import weightedIntersection, weightedUnion, IFBucket
|
||||||
from zope import schema, component
|
from zope import schema, component
|
||||||
from zope.interface import Interface, Attribute, implements
|
from zope.interface import Interface, Attribute, implements
|
||||||
from zope.app.catalog.interfaces import ICatalog
|
from zope.app.catalog.interfaces import ICatalog
|
||||||
from zope.app.intid.interfaces import IIntIds
|
|
||||||
from zope.cachedescriptors.property import Lazy
|
from zope.cachedescriptors.property import Lazy
|
||||||
|
from zope.intid.interfaces import IIntIds
|
||||||
|
|
||||||
from cybertools.typology.interfaces import IType
|
from cybertools.typology.interfaces import IType
|
||||||
from loops.common import AdapterBase
|
from loops.common import AdapterBase
|
||||||
|
|
|
@ -28,17 +28,17 @@ from zope.app.security.interfaces import IPermission
|
||||||
from zope.app.security.settings import Allow, Deny, Unset
|
from zope.app.security.settings import Allow, Deny, Unset
|
||||||
from zope.app.securitypolicy.browser import granting
|
from zope.app.securitypolicy.browser import granting
|
||||||
from zope.app.securitypolicy.browser.rolepermissionview import RolePermissionView
|
from zope.app.securitypolicy.browser.rolepermissionview import RolePermissionView
|
||||||
from zope.app.securitypolicy.interfaces import IPrincipalRoleManager, \
|
|
||||||
IRolePermissionMap
|
|
||||||
from zope.app.securitypolicy.interfaces import IPrincipalPermissionManager, \
|
|
||||||
IPrincipalPermissionMap
|
|
||||||
from zope.app.securitypolicy.zopepolicy import SettingAsBoolean
|
|
||||||
from zope import component
|
from zope import component
|
||||||
from zope.event import notify
|
from zope.event import notify
|
||||||
from zope.interface import implements
|
from zope.interface import implements
|
||||||
from zope.cachedescriptors.property import Lazy
|
from zope.cachedescriptors.property import Lazy
|
||||||
from zope.lifecycleevent import ObjectCreatedEvent, ObjectModifiedEvent
|
from zope.lifecycleevent import ObjectCreatedEvent, ObjectModifiedEvent
|
||||||
from zope.security.proxy import removeSecurityProxy
|
from zope.security.proxy import removeSecurityProxy
|
||||||
|
from zope.securitypolicy.interfaces import IPrincipalRoleManager, \
|
||||||
|
IRolePermissionMap
|
||||||
|
from zope.securitypolicy.interfaces import IPrincipalPermissionManager, \
|
||||||
|
IPrincipalPermissionMap
|
||||||
|
from zope.securitypolicy.zopepolicy import SettingAsBoolean
|
||||||
from zope.traversing.api import getName, getParent, getParents
|
from zope.traversing.api import getName, getParent, getParents
|
||||||
|
|
||||||
from loops.common import adapted
|
from loops.common import adapted
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#
|
#
|
||||||
# Copyright (c) 2010 Helmut Merz helmutm@cy55.de
|
# Copyright (c) 2011 Helmut Merz helmutm@cy55.de
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or modify
|
# 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
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
@ -24,9 +24,9 @@ $Id$
|
||||||
|
|
||||||
from zope import interface, component
|
from zope import interface, component
|
||||||
from zope.app.pagetemplate import ViewPageTemplateFile
|
from zope.app.pagetemplate import ViewPageTemplateFile
|
||||||
from zope.app.securitypolicy.interfaces import IRolePermissionMap
|
|
||||||
from zope.app.securitypolicy.zopepolicy import SettingAsBoolean
|
|
||||||
from zope.cachedescriptors.property import Lazy
|
from zope.cachedescriptors.property import Lazy
|
||||||
|
from zope.securitypolicy.interfaces import IRolePermissionMap
|
||||||
|
from zope.securitypolicy.zopepolicy import SettingAsBoolean
|
||||||
from zope.traversing.api import getName, getParent
|
from zope.traversing.api import getName, getParent
|
||||||
|
|
||||||
from loops.browser.concept import ConceptView
|
from loops.browser.concept import ConceptView
|
||||||
|
|
|
@ -27,14 +27,14 @@ from zope import component
|
||||||
from zope.annotation.interfaces import IAttributeAnnotatable
|
from zope.annotation.interfaces import IAttributeAnnotatable
|
||||||
from zope.app.container.interfaces import IObjectAddedEvent
|
from zope.app.container.interfaces import IObjectAddedEvent
|
||||||
from zope.app.security.settings import Allow, Deny, Unset
|
from zope.app.security.settings import Allow, Deny, Unset
|
||||||
from zope.app.securitypolicy.interfaces import IPrincipalRoleManager
|
|
||||||
from zope.app.securitypolicy.interfaces import IRolePermissionManager
|
|
||||||
from zope.cachedescriptors.property import Lazy
|
from zope.cachedescriptors.property import Lazy
|
||||||
from zope.interface import implements
|
from zope.interface import implements
|
||||||
from zope.lifecycleevent import IObjectCreatedEvent, IObjectModifiedEvent
|
from zope.lifecycleevent import IObjectCreatedEvent, IObjectModifiedEvent
|
||||||
from zope.security import canAccess, canWrite
|
from zope.security import canAccess, canWrite
|
||||||
from zope.security import checkPermission as baseCheckPermission
|
from zope.security import checkPermission as baseCheckPermission
|
||||||
from zope.security.management import getInteraction
|
from zope.security.management import getInteraction
|
||||||
|
from zope.securitypolicy.interfaces import IPrincipalRoleManager
|
||||||
|
from zope.securitypolicy.interfaces import IRolePermissionManager
|
||||||
from zope.traversing.api import getName
|
from zope.traversing.api import getName
|
||||||
from zope.traversing.interfaces import IPhysicallyLocatable
|
from zope.traversing.interfaces import IPhysicallyLocatable
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#
|
#
|
||||||
# Copyright (c) 2008 Helmut Merz helmutm@cy55.de
|
# Copyright (c) 2011 Helmut Merz helmutm@cy55.de
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or modify
|
# 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
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
@ -24,16 +24,16 @@ $Id$
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from zope.app.security.settings import Allow, Deny, Unset
|
from zope.app.security.settings import Allow, Deny, Unset
|
||||||
from zope.app.securitypolicy.interfaces import IPrincipalRoleMap, IRolePermissionMap
|
|
||||||
from zope.app.securitypolicy.zopepolicy import ZopeSecurityPolicy
|
|
||||||
from zope.app.securitypolicy.zopepolicy import SettingAsBoolean, \
|
|
||||||
globalRolesForPrincipal, globalRolesForPermission
|
|
||||||
from zope import component
|
from zope import component
|
||||||
from zope.component import adapts
|
from zope.component import adapts
|
||||||
from zope.cachedescriptors.property import Lazy
|
from zope.cachedescriptors.property import Lazy
|
||||||
from zope.interface import classProvides
|
from zope.interface import classProvides
|
||||||
from zope.security.interfaces import ISecurityPolicy
|
from zope.security.interfaces import ISecurityPolicy
|
||||||
from zope.security.proxy import removeSecurityProxy
|
from zope.security.proxy import removeSecurityProxy
|
||||||
|
from zope.securitypolicy.interfaces import IPrincipalRoleMap, IRolePermissionMap
|
||||||
|
from zope.securitypolicy.zopepolicy import ZopeSecurityPolicy
|
||||||
|
from zope.securitypolicy.zopepolicy import SettingAsBoolean, \
|
||||||
|
globalRolesForPrincipal, globalRolesForPermission
|
||||||
|
|
||||||
from loops.interfaces import IConcept, IResource
|
from loops.interfaces import IConcept, IResource
|
||||||
|
|
||||||
|
|
|
@ -24,14 +24,14 @@ $Id$
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from zope.app.security.settings import Allow, Deny, Unset
|
from zope.app.security.settings import Allow, Deny, Unset
|
||||||
from zope.app.securitypolicy.interfaces import \
|
|
||||||
IRolePermissionMap, IRolePermissionManager, \
|
|
||||||
IPrincipalRoleMap, IPrincipalRoleManager
|
|
||||||
from zope import component
|
from zope import component
|
||||||
from zope.component import adapts
|
from zope.component import adapts
|
||||||
from zope.cachedescriptors.property import Lazy
|
from zope.cachedescriptors.property import Lazy
|
||||||
from zope.interface import implements, Interface
|
from zope.interface import implements, Interface
|
||||||
from zope.security.proxy import isinstance
|
from zope.security.proxy import isinstance
|
||||||
|
from zope.securitypolicy.interfaces import \
|
||||||
|
IRolePermissionMap, IRolePermissionManager, \
|
||||||
|
IPrincipalRoleMap, IPrincipalRoleManager
|
||||||
|
|
||||||
from loops.common import adapted, AdapterBase, baseObject
|
from loops.common import adapted, AdapterBase, baseObject
|
||||||
from loops.interfaces import IConceptSchema, IBaseResourceSchema, ILoopsAdapter
|
from loops.interfaces import IConceptSchema, IBaseResourceSchema, ILoopsAdapter
|
||||||
|
|
|
@ -16,9 +16,6 @@ from zope.app.principalannotation import PrincipalAnnotationUtility
|
||||||
from zope.app.principalannotation.interfaces import IPrincipalAnnotationUtility
|
from zope.app.principalannotation.interfaces import IPrincipalAnnotationUtility
|
||||||
from zope.app.security.principalregistry import principalRegistry
|
from zope.app.security.principalregistry import principalRegistry
|
||||||
from zope.app.security.interfaces import IAuthentication
|
from zope.app.security.interfaces import IAuthentication
|
||||||
from zope.app.securitypolicy.zopepolicy import ZopeSecurityPolicy
|
|
||||||
from zope.app.securitypolicy.principalrole import AnnotationPrincipalRoleManager
|
|
||||||
from zope.app.securitypolicy.rolepermission import AnnotationRolePermissionManager
|
|
||||||
from zope.app.session.interfaces import IClientIdManager, ISessionDataContainer
|
from zope.app.session.interfaces import IClientIdManager, ISessionDataContainer
|
||||||
from zope.app.session import session
|
from zope.app.session import session
|
||||||
from zope.dublincore.annotatableadapter import ZDCAnnotatableAdapter
|
from zope.dublincore.annotatableadapter import ZDCAnnotatableAdapter
|
||||||
|
@ -27,6 +24,9 @@ from zope.interface import Interface, implements
|
||||||
from zope.publisher.interfaces.browser import IBrowserRequest, IBrowserView
|
from zope.publisher.interfaces.browser import IBrowserRequest, IBrowserView
|
||||||
from zope.security.checker import Checker, defineChecker
|
from zope.security.checker import Checker, defineChecker
|
||||||
from zope.security.management import setSecurityPolicy
|
from zope.security.management import setSecurityPolicy
|
||||||
|
from zope.securitypolicy.zopepolicy import ZopeSecurityPolicy
|
||||||
|
from zope.securitypolicy.principalrole import AnnotationPrincipalRoleManager
|
||||||
|
from zope.securitypolicy.rolepermission import AnnotationRolePermissionManager
|
||||||
|
|
||||||
from cybertools.browser.controller import Controller
|
from cybertools.browser.controller import Controller
|
||||||
from cybertools.catalog.keyword import KeywordIndex
|
from cybertools.catalog.keyword import KeywordIndex
|
||||||
|
|
|
@ -1,11 +1,9 @@
|
||||||
# $Id$
|
# $Id$
|
||||||
|
|
||||||
import unittest, doctest
|
import unittest, doctest
|
||||||
from zope.testing.doctestunit import DocFileSuite
|
|
||||||
from zope.interface.verify import verifyClass
|
from zope.interface.verify import verifyClass
|
||||||
from zope.interface import implements
|
from zope.interface import implements
|
||||||
from zope.app import zapi
|
from zope.intid.interfaces import IIntIds
|
||||||
from zope.app.intid.interfaces import IIntIds
|
|
||||||
|
|
||||||
from loops.interfaces import ILoops
|
from loops.interfaces import ILoops
|
||||||
from loops.base import Loops
|
from loops.base import Loops
|
||||||
|
@ -48,8 +46,8 @@ def test_suite():
|
||||||
flags = doctest.NORMALIZE_WHITESPACE | doctest.ELLIPSIS
|
flags = doctest.NORMALIZE_WHITESPACE | doctest.ELLIPSIS
|
||||||
return unittest.TestSuite((
|
return unittest.TestSuite((
|
||||||
unittest.makeSuite(Test),
|
unittest.makeSuite(Test),
|
||||||
DocFileSuite('../README.txt', optionflags=flags),
|
doctest.DocFileSuite('../README.txt', optionflags=flags),
|
||||||
DocFileSuite('../helpers.txt', optionflags=flags),
|
doctest.DocFileSuite('../helpers.txt', optionflags=flags),
|
||||||
))
|
))
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
|
4
util.py
4
util.py
|
@ -1,5 +1,5 @@
|
||||||
#
|
#
|
||||||
# Copyright (c) 2006 Helmut Merz helmutm@cy55.de
|
# Copyright (c) 2011 Helmut Merz helmutm@cy55.de
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or modify
|
# 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
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
@ -24,8 +24,8 @@ $Id$
|
||||||
|
|
||||||
import os
|
import os
|
||||||
from zope import component
|
from zope import component
|
||||||
from zope.app.intid.interfaces import IIntIds
|
|
||||||
from zope.interface import directlyProvides, directlyProvidedBy
|
from zope.interface import directlyProvides, directlyProvidedBy
|
||||||
|
from zope.intid.interfaces import IIntIds
|
||||||
from zope.i18nmessageid import MessageFactory
|
from zope.i18nmessageid import MessageFactory
|
||||||
from zope.schema import vocabulary
|
from zope.schema import vocabulary
|
||||||
|
|
||||||
|
|
2
view.py
2
view.py
|
@ -26,11 +26,11 @@ from zope import component
|
||||||
from zope.app.container.btree import BTreeContainer
|
from zope.app.container.btree import BTreeContainer
|
||||||
from zope.app.container.contained import Contained
|
from zope.app.container.contained import Contained
|
||||||
from zope.app.container.ordered import OrderedContainer
|
from zope.app.container.ordered import OrderedContainer
|
||||||
from zope.app.intid.interfaces import IIntIds
|
|
||||||
from zope.cachedescriptors.property import Lazy, readproperty
|
from zope.cachedescriptors.property import Lazy, readproperty
|
||||||
from zope.component import adapts
|
from zope.component import adapts
|
||||||
from zope.interface import implements
|
from zope.interface import implements
|
||||||
from zope.interface import alsoProvides, directlyProvides, directlyProvidedBy
|
from zope.interface import alsoProvides, directlyProvides, directlyProvidedBy
|
||||||
|
from zope.intid.interfaces import IIntIds
|
||||||
from zope.publisher.browser import applySkin
|
from zope.publisher.browser import applySkin
|
||||||
from zope import schema
|
from zope import schema
|
||||||
from zope.security import canAccess
|
from zope.security import canAccess
|
||||||
|
|
Loading…
Add table
Reference in a new issue