Merge branch 'bbmaster' of ssh://git.cy55.de/home/git/loops into bbmaster
This commit is contained in:
		
						commit
						f8abff58d6
					
				
					 32 changed files with 97 additions and 70 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): | ||||||
|  |  | ||||||
|  | @ -105,7 +105,7 @@ | ||||||
|       name="AddLoopsContainer.html" |       name="AddLoopsContainer.html" | ||||||
|       for="zope.app.container.interfaces.IAdding" |       for="zope.app.container.interfaces.IAdding" | ||||||
|       class="loops.browser.manager.LoopsAddForm" |       class="loops.browser.manager.LoopsAddForm" | ||||||
|       permission="zope.ManageApplication" |       permission="zope.ManageSite" | ||||||
|       /> |       /> | ||||||
| 
 | 
 | ||||||
|   <addMenuItem |   <addMenuItem | ||||||
|  | @ -125,7 +125,7 @@ | ||||||
|       name="edit.html" |       name="edit.html" | ||||||
|       for="loops.interfaces.ILoops" |       for="loops.interfaces.ILoops" | ||||||
|       class="loops.browser.manager.LoopsEditForm" |       class="loops.browser.manager.LoopsEditForm" | ||||||
|       permission="zope.ManageApplication" |       permission="zope.ManageSite" | ||||||
|       menu="zmi_views" title="Edit" |       menu="zmi_views" title="Edit" | ||||||
|       /> |       /> | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -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'' | ||||||
| 
 | 
 | ||||||
|  | @ -732,8 +733,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 | ||||||
|  | @ -850,7 +851,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 [ | ||||||
|  |  | ||||||
|  | @ -432,10 +432,12 @@ | ||||||
|   <!-- utilities --> |   <!-- utilities --> | ||||||
| 
 | 
 | ||||||
|   <utility |   <utility | ||||||
|  |       provides="cybertools.storage.interfaces.IExternalStorage" | ||||||
|       factory="cybertools.storage.filesystem.instanceVarSubdirectoryStorage" |       factory="cybertools.storage.filesystem.instanceVarSubdirectoryStorage" | ||||||
|       name="varsubdir" /> |       name="varsubdir" /> | ||||||
| 
 | 
 | ||||||
|   <utility |   <utility | ||||||
|  |       provides="cybertools.storage.interfaces.IExternalStorage" | ||||||
|       factory="cybertools.storage.filesystem.fullPathStorage" |       factory="cybertools.storage.filesystem.fullPathStorage" | ||||||
|       name="fullpath" /> |       name="fullpath" /> | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -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 | ||||||
|  |  | ||||||
|  | @ -155,7 +155,7 @@ with a principal folder: | ||||||
|   >>> from zope.app.authentication.authentication import PluggableAuthentication |   >>> from zope.app.authentication.authentication import PluggableAuthentication | ||||||
|   >>> from zope.app.security.interfaces import IAuthentication |   >>> from zope.app.security.interfaces import IAuthentication | ||||||
|   >>> ensureUtility(site, IAuthentication, '', PluggableAuthentication, |   >>> ensureUtility(site, IAuthentication, '', PluggableAuthentication, | ||||||
|   ...               copy_to_zlog=False, asObject=True) |   ...               copy_to_zlog=False) | ||||||
|   <...PluggableAuthentication...> |   <...PluggableAuthentication...> | ||||||
|   >>> pau = component.getUtility(IAuthentication, context=site) |   >>> pau = component.getUtility(IAuthentication, context=site) | ||||||
| 
 | 
 | ||||||
|  | @ -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() | ||||||
|  |  | ||||||
|  | @ -65,11 +65,11 @@ | ||||||
|       provides="zope.app.authentication.interfaces.ICredentialsPlugin" |       provides="zope.app.authentication.interfaces.ICredentialsPlugin" | ||||||
|       factory="loops.organize.auth.LoopsSessionCredentialsPlugin" /> |       factory="loops.organize.auth.LoopsSessionCredentialsPlugin" /> | ||||||
| 
 | 
 | ||||||
|   <zope:localUtility class="loops.organize.auth.PersonBasedAuthenticator"> |   <zope:class class="loops.organize.auth.PersonBasedAuthenticator"> | ||||||
|     <require |     <require | ||||||
|         permission="zope.ManageServices" |         permission="zope.ManageServices" | ||||||
|         attributes="prefix" /> |         attributes="prefix" /> | ||||||
|   </zope:localUtility> |   </zope:class> | ||||||
| 
 | 
 | ||||||
|   <!-- other adapters --> |   <!-- other adapters --> | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -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 | ||||||
|  | @ -50,7 +50,7 @@ def setupObjectsForTesting(site, concepts): | ||||||
|     loopsRoot = concepts.getLoopsRoot() |     loopsRoot = concepts.getLoopsRoot() | ||||||
|     setupData = setupUtilitiesAndAdapters(loopsRoot) |     setupData = setupUtilitiesAndAdapters(loopsRoot) | ||||||
|     ensureUtility(site, IAuthentication, '', PluggableAuthentication, |     ensureUtility(site, IAuthentication, '', PluggableAuthentication, | ||||||
|                   copy_to_zlog=False, asObject=True) |                   copy_to_zlog=False) | ||||||
|     pau = component.getUtility(IAuthentication, context=site) |     pau = component.getUtility(IAuthentication, context=site) | ||||||
|     # create principal folder and user(s) |     # create principal folder and user(s) | ||||||
|     pFolder = PrincipalFolder('users.') |     pFolder = PrincipalFolder('users.') | ||||||
|  |  | ||||||
|  | @ -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 | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -16,15 +16,15 @@ | ||||||
| 
 | 
 | ||||||
|   <zope:adapter |   <zope:adapter | ||||||
|         for="loops.interfaces.IConcept" |         for="loops.interfaces.IConcept" | ||||||
|         factory="zope.app.securitypolicy.rolepermission.AnnotationRolePermissionManager" |         factory="zope.securitypolicy.rolepermission.AnnotationRolePermissionManager" | ||||||
|         trusted="true" /> |         trusted="true" /> | ||||||
|   <zope:adapter |   <zope:adapter | ||||||
|         for="loops.interfaces.IResource" |         for="loops.interfaces.IResource" | ||||||
|         factory="zope.app.securitypolicy.rolepermission.AnnotationRolePermissionManager" |         factory="zope.securitypolicy.rolepermission.AnnotationRolePermissionManager" | ||||||
|         trusted="true" /> |         trusted="true" /> | ||||||
|   <zope:adapter |   <zope:adapter | ||||||
|         for="loops.interfaces.IView" |         for="loops.interfaces.IView" | ||||||
|         factory="zope.app.securitypolicy.rolepermission.AnnotationRolePermissionManager" |         factory="zope.securitypolicy.rolepermission.AnnotationRolePermissionManager" | ||||||
|         trusted="true" /> |         trusted="true" /> | ||||||
| 
 | 
 | ||||||
|   <zope:adapter factory="loops.security.setter.ConceptSecuritySetter" /> |   <zope:adapter factory="loops.security.setter.ConceptSecuritySetter" /> | ||||||
|  |  | ||||||
|  | @ -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 | ||||||
|  |  | ||||||
							
								
								
									
										3
									
								
								setup.cfg
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										3
									
								
								setup.cfg
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,3 @@ | ||||||
|  | [egg_info] | ||||||
|  | tag_build = dev | ||||||
|  | tag_svn_revision = true | ||||||
							
								
								
									
										29
									
								
								setup_egg.py
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										29
									
								
								setup_egg.py
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,29 @@ | ||||||
|  | from setuptools import setup, find_packages | ||||||
|  | import sys, os | ||||||
|  | 
 | ||||||
|  | version = '2.0' | ||||||
|  | 
 | ||||||
|  | setup(name='loops', | ||||||
|  |       version=version, | ||||||
|  |       description="loops", | ||||||
|  |       long_description="""\ | ||||||
|  | linked objects for organizational process services""", | ||||||
|  |       classifiers=[], # Get strings from http://pypi.python.org/pypi?%3Aaction=list_classifiers | ||||||
|  |       keywords='', | ||||||
|  |       author='Helmut Merz', | ||||||
|  |       author_email='helmutm@cy55.de', | ||||||
|  |       url='', | ||||||
|  |       license='GPL', | ||||||
|  |       packages=find_packages(exclude=['ez_setup', 'examples', 'tests']), | ||||||
|  |       include_package_data=True, | ||||||
|  |       zip_safe=False, | ||||||
|  |       install_requires=[ | ||||||
|  |           # -*- Extra requirements: -*- | ||||||
|  |           'zope.app.securitypolicy', | ||||||
|  |           'zope.app.session', | ||||||
|  |           'cybertools', | ||||||
|  |       ], | ||||||
|  |       entry_points=""" | ||||||
|  |       # -*- Entry points: -*- | ||||||
|  |       """, | ||||||
|  |       ) | ||||||
|  | @ -23,7 +23,6 @@ resources e.g. from forms that are called on view/node objects. | ||||||
| $Id$ | $Id$ | ||||||
| """ | """ | ||||||
| 
 | 
 | ||||||
| from zope.app import zapi |  | ||||||
| from zope.cachedescriptors.property import Lazy | from zope.cachedescriptors.property import Lazy | ||||||
| from zope.component import adapts | from zope.component import adapts | ||||||
| from zope.i18nmessageid import MessageFactory | from zope.i18nmessageid import MessageFactory | ||||||
|  |  | ||||||
|  | @ -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
	
	 hplattner
						hplattner