From b5b2fa5f58a5398167a3f9500936d663833c5a99 Mon Sep 17 00:00:00 2001 From: Helmut Merz Date: Thu, 1 Mar 2012 17:27:47 +0100 Subject: [PATCH 1/2] change setting for HTML pre element: show scrollbars only if necessary --- browser/skin/lobo/lobo.css | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/browser/skin/lobo/lobo.css b/browser/skin/lobo/lobo.css index 97949b4..98eee30 100644 --- a/browser/skin/lobo/lobo.css +++ b/browser/skin/lobo/lobo.css @@ -52,9 +52,10 @@ a[href]:hover { } pre { + padding: 0.2em; font-size: 100%; - background-color: #f4f4f4; - overflow: scroll; + background-color: #f8f8f8; + overflow: auto; max-height: 35em; } From 8e3d038574782943fbcfcd2cc2a2ef20df9a4996 Mon Sep 17 00:00:00 2001 From: Helmut Merz Date: Thu, 1 Mar 2012 17:28:38 +0100 Subject: [PATCH 2/2] fix handling of relation set changes; provide __ne__() method for AdapterBase --- common.py | 9 +++++++-- xmlrpc/common.py | 8 +++----- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/common.py b/common.py index 03a8a97..61b9a89 100644 --- a/common.py +++ b/common.py @@ -137,9 +137,13 @@ class AdapterBase(object): def __eq__(self, other): if not isinstance(other, AdapterBase): return self.context == other - #return False return self.context == other.context + def __ne__(self, other): + if not isinstance(other, AdapterBase): + return self.context != other + return self.context != other.context + def getLoopsRoot(self): return self.context.getLoopsRoot() @@ -443,8 +447,9 @@ class RelationSetProperty(object): noSecurityCheck=self.noSecurityCheck) def __set__(self, inst, value): + value = [baseObject(c) for c in value] rs = self.factory(inst, self.predicateName) - current = list(rs) + current = [baseObject(c) for c in rs] for c in current: if c not in value: rs.remove(c) diff --git a/xmlrpc/common.py b/xmlrpc/common.py index 1cdcd33..6f06beb 100644 --- a/xmlrpc/common.py +++ b/xmlrpc/common.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2007 Helmut Merz helmutm@cy55.de +# Copyright (c) 2012 Helmut Merz helmutm@cy55.de # # 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 @@ -18,8 +18,6 @@ """ XML-RPC views. - -$Id$ """ from zope.app.container.interfaces import INameChooser @@ -34,7 +32,7 @@ from zope.security.proxy import removeSecurityProxy from zope.cachedescriptors.property import Lazy from cybertools.typology.interfaces import IType -from loops.common import adapted +from loops.common import adapted, AdapterBase from loops.concept import Concept from loops.i18n.browser import I18NView from loops.util import getUidForObject, getObjectForUid, toUnicode @@ -166,7 +164,7 @@ def objectAsDict(obj, langInfo=None): 'title': adapter.title, 'description': adapter.description, 'type': getUidForObject(objType.typeProvider)} ti = objType.typeInterface - if ti is not None and adapter != obj: + if ti is not None and isinstance(adapter, AdapterBase): #adapter != obj: #for attr in (list(adapter._adapterAttributes) + list(ti)): for attr in list(ti): if attr not in ('__parent__', 'context', 'id', 'name',