Kaynağa Gözat

*** empty log message ***

Mark Mine 25 yıl önce
ebeveyn
işleme
8cc2989e96
1 değiştirilmiş dosya ile 7 ekleme ve 6 silme
  1. 7 6
      direct/src/showbase/PythonUtil.py

+ 7 - 6
direct/src/showbase/PythonUtil.py

@@ -21,13 +21,13 @@ def indent(stream, numIndents, str):
     indentString = '    '
     indentString = '    '
     stream.write(indentString * numIndents + str)
     stream.write(indentString * numIndents + str)
 
 
-def pdir(obj, *args):
+def apropos(obj, *args):
     """
     """
-    Print out a formatted list of members and methods of an instance or class
+    Obsolete, use pdir
     """
     """
-    apply(apropos, (obj,) + args)
+    print 'Use pdir instead'
     
     
-def apropos(obj, str = None, fOverloaded = 0, width = None,
+def pdir(obj, str = None, fOverloaded = 0, width = None,
             fTruncate = 1, lineWidth = 75):
             fTruncate = 1, lineWidth = 75):
     """
     """
     Print out a formatted list of members and methods of an instance or class
     Print out a formatted list of members and methods of an instance or class
@@ -106,13 +106,14 @@ def apropos(obj, str = None, fOverloaded = 0, width = None,
             # Cut off line (keeping at least 1 char)
             # Cut off line (keeping at least 1 char)
             value = value[:max(1,lineWidth - maxWidth)]
             value = value[:max(1,lineWidth - maxWidth)]
         print (format % key)[:maxWidth] + '\t' + value
         print (format % key)[:maxWidth] + '\t' + value
+    # Check for parent classes
     if type(obj) == types.InstanceType:
     if type(obj) == types.InstanceType:
         print
         print
-        apropos(obj.__class__, str = str )
+        pdir(obj.__class__, str = str )
     elif type(obj) == types.ClassType:
     elif type(obj) == types.ClassType:
         for parentClass in obj.__bases__:
         for parentClass in obj.__bases__:
             print
             print
-            apropos(parentClass, str = str)
+            pdir(parentClass, str = str)
 
 
 def aproposAll(obj):
 def aproposAll(obj):
     """
     """