Commit 3858dcdc authored by Vincent Pelletier's avatar Vincent Pelletier

ZSQLBrain: Assorted style improvements.

parent 0c921888
...@@ -16,17 +16,13 @@ import Acquisition ...@@ -16,17 +16,13 @@ import Acquisition
import sys import sys
import traceback import traceback
from ZODB.POSException import ConflictError from ZODB.POSException import ConflictError
from AccessControl import ClassSecurityInfo from AccessControl import ClassSecurityInfo
from AccessControl.SecurityInfo import allow_class from AccessControl.SecurityInfo import allow_class
from zLOG import LOG, WARNING from zLOG import LOG, WARNING
try: try:
from Products.CMFActivity.ActiveObject import DEFAULT_ACTIVITY from Products.CMFActivity.ActiveObject import DEFAULT_ACTIVITY
except ImportError: except ImportError:
DEFAULT_ACTIVITY = None DEFAULT_ACTIVITY = None
_MARKER = [] _MARKER = []
class ZSQLBrain(Acquisition.Implicit): class ZSQLBrain(Acquisition.Implicit):
...@@ -38,8 +34,7 @@ class ZSQLBrain(Acquisition.Implicit): ...@@ -38,8 +34,7 @@ class ZSQLBrain(Acquisition.Implicit):
""" """
if name.startswith('__') : if name.startswith('__') :
return None return None
o = self.getObject() return getattr(self.getObject(), name, None)
return getattr(o, name, None)
def getURL(self): def getURL(self):
return self.path return self.path
...@@ -114,7 +109,7 @@ class ZSQLBrain(Acquisition.Implicit): ...@@ -114,7 +109,7 @@ class ZSQLBrain(Acquisition.Implicit):
style url. If no object is found, None is returned. style url. If no object is found, None is returned.
No exceptions are raised. No exceptions are raised.
""" """
script=REQUEST.script script = REQUEST.script
if not path.startswith(script): if not path.startswith(script):
path='%s/%s' % (script, path) path='%s/%s' % (script, path)
try: try:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment