Commit 71b62448 authored by Yoshinori Okuji's avatar Yoshinori Okuji

Avoid raising exceptions unnecessarily.

Disable some excessive log messages.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@2435 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 66e7f5da
...@@ -815,7 +815,7 @@ class Catalog(Folder, Persistent, Acquisition.Implicit, ExtensionClass.Base): ...@@ -815,7 +815,7 @@ class Catalog(Folder, Persistent, Acquisition.Implicit, ExtensionClass.Base):
arguments = method.arguments_src arguments = method.arguments_src
for arg in split(arguments): for arg in split(arguments):
try: try:
value = getattr(object, arg) value = getattr(object, arg, None)
if callable(value): if callable(value):
value = value() value = value()
kw[arg] = value kw[arg] = value
...@@ -895,12 +895,12 @@ class Catalog(Folder, Persistent, Acquisition.Implicit, ExtensionClass.Base): ...@@ -895,12 +895,12 @@ class Catalog(Folder, Persistent, Acquisition.Implicit, ExtensionClass.Base):
arguments = method.arguments_src arguments = method.arguments_src
for arg in split(arguments): for arg in split(arguments):
try: try:
value = getattr(object, arg) value = getattr(object, arg, None)
if callable(value): if callable(value):
value = value() value = value()
kw[arg] = value kw[arg] = value
except: except:
#LOG("SQLCatalog Warning: Callable value could not be called",0,str((path, arg, method_name))) LOG("SQLCatalog Warning: Callable value could not be called",0,str((path, arg, method_name)))
kw[arg] = None kw[arg] = None
try: try:
method = aq_base(method).__of__(object.__of__(self)) # Use method in the context of object method = aq_base(method).__of__(object.__of__(self)) # Use method in the context of object
...@@ -991,8 +991,8 @@ class Catalog(Folder, Persistent, Acquisition.Implicit, ExtensionClass.Base): ...@@ -991,8 +991,8 @@ class Catalog(Folder, Persistent, Acquisition.Implicit, ExtensionClass.Base):
for arg in split(arguments): for arg in split(arguments):
value_list = [] value_list = []
for object in catalogged_object_list: for object in catalogged_object_list:
LOG('catalog_object_list: object.uid',0,getattr(object,'uid',None)) #LOG('catalog_object_list: object.uid',0,getattr(object,'uid',None))
LOG('catalog_object_list: object.path',0,object.getPhysicalPath()) #LOG('catalog_object_list: object.path',0,object.getPhysicalPath())
try: try:
value = getattr(object, arg) value = getattr(object, arg)
if callable(value): if callable(value):
...@@ -1170,7 +1170,7 @@ class Catalog(Folder, Persistent, Acquisition.Implicit, ExtensionClass.Base): ...@@ -1170,7 +1170,7 @@ class Catalog(Folder, Persistent, Acquisition.Implicit, ExtensionClass.Base):
try: REQUEST=self.REQUEST try: REQUEST=self.REQUEST
except AttributeError: pass except AttributeError: pass
LOG('SQLCatalog.buildSQLQuery, kw',0,kw) #LOG('SQLCatalog.buildSQLQuery, kw',0,kw)
# If kw is not set, then use REQUEST instead # If kw is not set, then use REQUEST instead
if kw is None or kw == {}: if kw is None or kw == {}:
kw = REQUEST kw = REQUEST
......
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