mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-02 09:52:27 -04:00
Revert some of my callable changes, I found out that old-style classes don't provide __call__
This commit is contained in:
parent
b4900f139b
commit
7a33157f92
@ -351,7 +351,7 @@ class Inspector:
|
||||
keys.sort()
|
||||
for each in keys:
|
||||
self._partsList.append(each)
|
||||
#if not hasattr(getattr(self.object, each), '__call__'):
|
||||
#if not callable(getattr(self.object, each)):
|
||||
# self._partsList.append(each)
|
||||
|
||||
def initializePartNames(self):
|
||||
@ -373,7 +373,7 @@ class Inspector:
|
||||
def stringForPartNumber(self, partNumber):
|
||||
object = self.partNumber(partNumber)
|
||||
doc = None
|
||||
if hasattr(object, '__call__'):
|
||||
if callable(object):
|
||||
try:
|
||||
doc = object.__doc__
|
||||
except:
|
||||
|
@ -57,7 +57,7 @@ class LerpNodePathInterval(CLerpNodePathInterval):
|
||||
# parameter.
|
||||
|
||||
for param in params:
|
||||
if hasattr(param, '__call__'):
|
||||
if callable(param):
|
||||
return 1
|
||||
return 0
|
||||
|
||||
@ -67,7 +67,7 @@ class LerpNodePathInterval(CLerpNodePathInterval):
|
||||
# a callable functor, calls it; otherwise, uses the param
|
||||
# directly.
|
||||
if param != None:
|
||||
if hasattr(param, '__call__'):
|
||||
if callable(param):
|
||||
func(param())
|
||||
else:
|
||||
func(param)
|
||||
|
@ -106,7 +106,7 @@ class ProjectileInterval(Interval):
|
||||
def doIndirections(*items):
|
||||
result = []
|
||||
for item in items:
|
||||
if hasattr(item, '__call__'):
|
||||
if callable(item):
|
||||
item = item()
|
||||
result.append(item)
|
||||
return result
|
||||
|
@ -117,7 +117,7 @@ class Functor:
|
||||
_kargs.update(kargs)
|
||||
return self._function(*(self._args + args), **_kargs)
|
||||
|
||||
# this methoxd is used in place of __call__ if we are recording creation stacks
|
||||
# this method is used in place of __call__ if we are recording creation stacks
|
||||
def _exceptionLoggedCreationStack__call__(self, *args, **kargs):
|
||||
try:
|
||||
return self._do__call__(*args, **kargs)
|
||||
@ -510,7 +510,7 @@ def _pdir(obj, str = None, width = None,
|
||||
format = '%-' + repr(maxWidth) + 's'
|
||||
for key in keys:
|
||||
value = dict[key]
|
||||
if hasattr(value, '__call__'):
|
||||
if callable(value):
|
||||
strvalue = repr(Signature(value))
|
||||
else:
|
||||
strvalue = repr(value)
|
||||
|
@ -88,7 +88,7 @@ class Inspector:
|
||||
keys.sort()
|
||||
for each in keys:
|
||||
self._partsList.append(each)
|
||||
#if not hasattr(getattr(self.object, each), '__call__'):
|
||||
#if not callable(getattr(self.object, each)):
|
||||
# self._partsList.append(each)
|
||||
|
||||
def initializePartNames(self):
|
||||
@ -110,7 +110,7 @@ class Inspector:
|
||||
def stringForPartNumber(self, partNumber):
|
||||
object = self.partNumber(partNumber)
|
||||
doc = None
|
||||
if hasattr(object, '__call__'):
|
||||
if callable(object):
|
||||
try:
|
||||
doc = object.__doc__
|
||||
except:
|
||||
|
Loading…
x
Reference in New Issue
Block a user