Browse Source

new safe-import convention, from Josh Yelon

David Rose 19 years ago
parent
commit
59b8349fe9

+ 5 - 1
direct/src/tkpanels/AnimPanel.py

@@ -1,4 +1,8 @@
-"DIRECT Animation Control Panel"
+"""DIRECT Animation Control Panel"""
+
+__all__ = ['AnimPanel', 'ActorControl']
+
+
 
 ### SEE END OF FILE FOR EXAMPLE USEAGE ###
 

+ 2 - 0
direct/src/tkpanels/DirectSessionPanel.py

@@ -1,5 +1,7 @@
 """ DIRECT Session Main panel """
 
+__all__ = ['DirectSessionPanel']
+
 # Import Tkinter, Pmw, and the dial code
 from direct.showbase.TkGlobal import *
 from direct.tkwidgets.AppShell import *

+ 3 - 0
direct/src/tkpanels/FSMInspector.py

@@ -1,4 +1,7 @@
 """ Finite State Machine Inspector module """
+
+__all__ = ['FSMInspector', 'StateInspector']
+
 from direct.tkwidgets.AppShell import *
 from direct.showbase.TkGlobal import *
 from tkSimpleDialog import askstring

+ 8 - 4
direct/src/tkpanels/Inspector.py

@@ -1,7 +1,11 @@
-### Inspectors allow you to visually browse through the members of various python objects.
-### To open an inspector, import this module, and execute inspector.inspect(anObject)
-### I start IDLE with this command line: idle.py -c "from inspector import inspect"
-### so that I can just type: inspect(anObject) any time.
+"""Inspectors allow you to visually browse through the members of
+various python objects.  To open an inspector, import this module, and
+execute inspector.inspect(anObject) I start IDLE with this command
+line: idle.py -c "from inspector import inspect"
+so that I can just type: inspect(anObject) any time."""
+
+
+__all__ = ['inspect', 'inspectorFor', 'Inspector', 'ModuleInspector', 'ClassInspector', 'InstanceInspector', 'FunctionInspector', 'InstanceMethodInspector', 'CodeInspector', 'ComplexInspector', 'DictionaryInspector', 'SequenceInspector', 'SliceInspector', 'InspectorWindow']
 
 import string
 from direct.showbase.TkGlobal import *

+ 2 - 0
direct/src/tkpanels/MopathRecorder.py

@@ -1,5 +1,7 @@
 """ Mopath Recorder Panel Module """
 
+__all__ = ['MopathRecorder']
+
 # Import Tkinter, Pmw, and the dial code from this directory tree.
 from pandac.PandaModules import *
 from direct.showbase.DirectObject import DirectObject

+ 4 - 0
direct/src/tkpanels/NotifyPanel.py

@@ -1,3 +1,7 @@
+"""Undocumented Module"""
+
+__all__ = ['NotifyPanel']
+
 
 class NotifyPanel:
     """NotifyPanel class: this class contains methods for creating

+ 2 - 0
direct/src/tkpanels/ParticlePanel.py

@@ -1,5 +1,7 @@
 """PANDA3D Particle Panel"""
 
+__all__ = ['ParticlePanel']
+
 # Import Tkinter, Pmw, and the floater code from this directory tree.
 from direct.tkwidgets.AppShell import *
 from direct.showbase.TkGlobal import *

+ 2 - 0
direct/src/tkpanels/Placer.py

@@ -1,5 +1,7 @@
 """ DIRECT Nine DoF Manipulation Panel """
 
+__all__ = ['Placer', 'place']
+
 # Import Tkinter, Pmw, and the dial code from this directory tree.
 from pandac.PandaModules import *
 from direct.showbase.TkGlobal import *

+ 5 - 0
direct/src/tkpanels/TaskManagerPanel.py

@@ -1,5 +1,10 @@
+"""Undocumented Module"""
+
+__all__ = ['TaskManagerPanel', 'TaskManagerWidget']
+
 from direct.tkwidgets.AppShell import *
 from Tkinter import *
+from direct.showbase.DirectObject import DirectObject
 import Pmw
 
 class TaskManagerPanel(AppShell):

+ 3 - 0
direct/src/tkwidgets/AppShell.py

@@ -4,6 +4,9 @@ This is an adaption of AppShell.py found in Python and Tkinter Programming
 by John E. Grayson which is a streamlined adaptation of GuiAppD.py, originally
 created by Doug Hellmann ([email protected]).
 """
+
+__all__ = ['AppShell']
+
 from direct.showbase.DirectObject import DirectObject
 from direct.showbase.TkGlobal import *
 from tkFileDialog import *

+ 4 - 1
direct/src/tkwidgets/Dial.py

@@ -2,9 +2,12 @@
 Dial Class: Velocity style controller for floating point values with
              a label, entry (validated), and scale
 """
+
+__all__ = ['Dial', 'AngleDial', 'DialWidget']
+
 from direct.showbase.TkGlobal import *
 from Tkinter import *
-from Valuator import *
+from Valuator import Valuator, VALUATOR_MINI, VALUATOR_FULL
 from direct.task import Task
 import math, string, operator, Pmw
 from pandac.PandaModules import ClockObject

+ 3 - 0
direct/src/tkwidgets/EntryScale.py

@@ -1,6 +1,9 @@
 """
 EntryScale Class: Scale with a label, and a linked and validated entry
 """
+
+__all__ = ['EntryScale', 'EntryScaleGroup']
+
 from direct.showbase.DirectObject import DirectObject
 from direct.showbase.TkGlobal import *
 from Tkinter import *

+ 4 - 1
direct/src/tkwidgets/Floater.py

@@ -2,9 +2,12 @@
 Floater Class: Velocity style controller for floating point values with
                 a label, entry (validated), and scale
 """
+
+__all__ = ['Floater', 'FloaterWidget', 'FloaterGroup']
+
 from direct.showbase.TkGlobal import *
 from Tkinter import *
-from Valuator import *
+from Valuator import Valuator, VALUATOR_MINI, VALUATOR_FULL
 from direct.task import Task
 import math, sys, string, Pmw
 

+ 3 - 0
direct/src/tkwidgets/ProgressBar.py

@@ -1,6 +1,9 @@
 """
 A  basic widget for showing the progress being made in a task.
 """
+
+__all__ = ['ProgressBar']
+
 from direct.showbase.TkGlobal import *
 from Tkinter import *
 

+ 5 - 0
direct/src/tkwidgets/SceneGraphExplorer.py

@@ -1,7 +1,12 @@
+"""Undocumented Module"""
+
+__all__ = ['SceneGraphExplorer', 'SceneGraphExplorerItem', 'explore']
+
 from direct.showbase.DirectObject import DirectObject
 from direct.showbase.TkGlobal import *
 from Tkinter import *
 from Tree import *
+import Pmw
 
 # changing these strings requires changing DirectSession.py SGE_ strs too!
 DEFAULT_MENU_ITEMS = [

+ 4 - 1
direct/src/tkwidgets/Slider.py

@@ -2,9 +2,12 @@
 Slider Class: Velocity style controller for floating point values with
                a label, entry (validated), and min/max slider
 """
+
+__all__ = ['Slider', 'SliderWidget', 'rgbPanel']
+
 from direct.showbase.TkGlobal import *
 from Tkinter import *
-from Valuator import *
+from Valuator import Valuator, rgbPanel, VALUATOR_MINI, VALUATOR_FULL
 from direct.task import Task
 import math, sys, string
 import operator, Pmw

+ 4 - 0
direct/src/tkwidgets/Tree.py

@@ -1,3 +1,7 @@
+"""Undocumented Module"""
+
+__all__ = ['TreeNode', 'TreeItem']
+
 # ADAPTED FROM IDLE TreeWidget.py
 # XXX TO DO:
 # - popup menu

+ 4 - 0
direct/src/tkwidgets/Valuator.py

@@ -1,3 +1,7 @@
+"""Undocumented Module"""
+
+__all__ = ['Valuator', 'ValuatorGroup', 'ValuatorGroupPanel']
+
 from direct.showbase.DirectObject import *
 from direct.showbase.TkGlobal import *
 from Tkinter import *

+ 4 - 0
direct/src/tkwidgets/VectorWidgets.py

@@ -1,3 +1,7 @@
+"""Undocumented Module"""
+
+__all__ = ['VectorEntry', 'Vector2Entry', 'Vector3Entry', 'Vector4Entry', 'ColorEntry']
+
 from direct.showbase.TkGlobal import *
 from Tkinter import *
 import Valuator

+ 4 - 0
direct/src/tkwidgets/WidgetPropertiesDialog.py

@@ -1,3 +1,7 @@
+"""Undocumented Module"""
+
+__all__ = ['WidgetPropertiesDialog']
+
 from direct.showbase.TkGlobal import *
 from Tkinter import *
 import types, string, Pmw