dabo Commit
Revision 1403
Date: 2005-10-04 21:48:25 -0700 (Tue, 04 Oct 2005)
Author: paul

Changed:
U   trunk/dabo/common/dObject.py
U   trunk/dabo/dApp.py

Log:
Viewing the new api doc for dApp, I attempted to make the docstrings better
with more information but without getting too wordy. Next, I'll attack the
methods, some of which lack docstrings and some of which may be more 
appropriate as private instead of public methods.


Diff:
Modified: trunk/dabo/common/dObject.py
===================================================================
--- trunk/dabo/common/dObject.py        2005-10-04 23:26:35 UTC (rev 1402)
+++ trunk/dabo/common/dObject.py        2005-10-05 04:48:25 UTC (rev 1403)
@@ -245,29 +245,36 @@
        
 
        Application = property(_getApplication, None, None, 
-                                       'Object reference to the Dabo 
Application object. (read only).')
+               _("""Object reference to the Dabo Application object. (read 
only)."""))
        
        BaseClass = property(_getBaseClass, None, None, 
-                                       'The base class of the object. 
Read-only. (class)')
+               _("""The base Dabo class of the object. Read-only. (class)"""))
        
        Class = property(_getClass, None, None,
-                                       'The class the object is based on. 
Read-only. (class)')
+               _("""The class the object is based on. Read-only. (class)"""))
        
        LogEvents = property(_getLogEvents, _setLogEvents, None, 
-                                       "Specifies which events to log. (list 
of strings)\n"
-                                       "\n"
-                                       "If the first element is 'All', all 
events except the following\n"
-                                       "listed events will be logged.")
+               _("""Specifies which events to log. (list of strings)
+
+               If the first element is 'All', all events except the following 
listed events 
+               will be logged. 
+
+               Event logging is resource-intensive, so in addition to setting 
this LogEvents
+               property, you also need to make the following call:
+
+               >>> dabo.eventLogging = True
+               """))
                                        
        Name = property(_getName, _setName, None, 
-                                       'The name of the object. (str)')
+               _("""The name of the object. (str)"""))
        
        Parent = property(_getParent, _setParent, None, 
-                                       'The containing object. (obj)')
+               _("""The containing object. (obj)"""))
        
        SuperClass = property(_getSuperClass, None, None, 
-                                       'The parent class of the object. 
Read-only. (class)')
+               _("""The parent class of the object. Read-only. (class)"""))
 
+
 if __name__ == "__main__":
        d = dObject()
        print d.Application

Modified: trunk/dabo/dApp.py
===================================================================
--- trunk/dabo/dApp.py  2005-10-04 23:26:35 UTC (rev 1402)
+++ trunk/dabo/dApp.py  2005-10-05 04:48:25 UTC (rev 1403)
@@ -75,11 +75,15 @@
 
 
 class dApp(dabo.common.dObject):
-       """ dabo.dApp
+       """The containing object for the entire application.
 
-               The containing object for the entire application.
-               Various UI's will have app objects also, which 
-               dabo.App is a wrapper for. 
+       All Dabo objects have an Application property which refers to the dApp
+       instance. Instantiate your dApp object from your main script, like so:
+
+       >>> import dabo
+       >>> app = dabo.dApp
+       >>> app.setup()
+       >>> app.start()
        """
        _call_beforeInit, _call_afterInit, _call_initProperties = False, False, 
True
 
@@ -520,6 +524,7 @@
                        # Use the default crypto
                        self._cryptoProvider = SimpleCrypt()
                return self._cryptoProvider
+
        def _setCrypto(self, val):
                self._cryptoProvider = val
 
@@ -531,39 +536,65 @@
                        _("Reference to the object that provides cryptographic 
services.  (varies)" ) )
        
        DrawSizerOutlines = property(_getDrawSizerOutlines, 
_setDrawSizerOutlines, None,
-                       _("Determines if sizer outlines are drawn on the 
ActiveForm.  (bool)") )
+                       _("""Determines if sizer outlines are drawn on the 
ActiveForm.  (bool)"""))
        
        HomeDirectory = property(_getHomeDirectory, _setHomeDirectory, None,
-                       _("Specifies the home-base directory for the 
application's program files (absolute path)."))
+                       _("""Specifies the application's home directory. 
(string)
+
+                       The HomeDirectory is the top-level directory for your 
application files,
+                       the directory where your main script lives. You never 
know what the 
+                       current directory will be on a given system, but 
HomeDirectory will always
+                       get you to your files."""))
                
        MainForm = property(_getMainForm, _setMainForm, None,
-                       _("""The object reference to the main form of the 
application, or None. 
-                       This gets set automatically during application setup, 
based on the 
-                       MainFormClass."""))
+                       _("""The object reference to the main form of the 
application, or None.
+ 
+                       The MainForm gets instantiated automatically during 
application setup, 
+                       based on the value of MainFormClass. If you want to 
swap in your own
+                       MainForm instance, do it after setup() but before 
start(), as in:
+
+                       >>> import dabo
+                       >>> app = dabo.dApp()
+                       >>> app.setup()
+                       >>> app.MainForm = myMainFormInstance
+                       >>> app.start()"""))
                
        MainFormClass = property(_getMainFormClass, _setMainFormClass, None,
-                       _("""Specifies the class to use to instantiate the main 
form. Defaults to 
-                       the dFormMain base class. Set to None if you don't want 
a main form."""))
+                       _("""Specifies the class to instantiate for the main 
form. 
+
+                       Defaults to the dFormMain base class. Set to None if 
you don't want a 
+                       main form, or set to your own main form class. Do this 
before calling
+                       dApp.setup(), as in:
+
+                       >>> import dabo
+                       >>> app = dabo.dApp()
+                       >>> app.MainFormClass = MyMainForm
+                       >>> app.setup()
+                       >>> app.start()"""))
        
        NoneDisplay = property(_getNoneDisp, _setNoneDisp, None, 
                        _("Text to display for null (None) values.  (str)") )
        
        Platform = property(_getPlatform, None, None,
-                       _("""Returns one of 'Mac', 'Win' or 'GTK', depending on 
where we're 
-                       running  (string)""") )
+                       _("""Returns the platform we are running on. (str)
+
+                       This will be one of 'Mac', 'Win' or 'GTK'.""") )
                        
        UI = property(_getUI, _setUI, None, 
-                       _("""Specifies the user interface to load, or None. 
Once set, 
-                       it cannot be reassigned.  (str)""") )
+                       _("""Specifies the user interface to load, or None. 
(str)
 
-       UserSettingProvider = property(_getUserSettingProvider, 
_setUserSettingProvider,
+                       This is the user interface library, such as 'wx' or 
'tk'. Note that
+                       'wx' is the only supported user interface library at 
this point."""))
+
+       UserSettingProvider = property(_getUserSettingProvider, 
+                       _setUserSettingProvider, None,
                        _("""Specifies the reference to the object providing 
user preference persistence.
                        
                        The default UserSettingProvider will save user 
preferences inside the .dabo
                        directory inside the user's     home directory."""))
 
        UserSettingProviderClass = property(_getUserSettingProviderClass,
-                       _setUserSettingProviderClass,
+                       _setUserSettingProviderClass, None,
                        _("""Specifies the class to use for user preference 
persistence.
                        
                        The default UserSettingProviderClass will save user 
preferences inside the .dabo
@@ -571,9 +602,10 @@
                        automatically."""))
 
        SecurityManager = property(_getSecurityManager, _setSecurityManager, 
None, 
-                       _("""Specifies the Security Manager, if any. You must 
subclass 
-                       dSecurityManager, overriding the appropriate hooks and 
properties, 
-                       and then set dApp.SecurityManager to an instance of 
your subclass. 
-                       There is no security manager by default - you 
explicitly set this 
-                       to use Dabo security.""") )
+                       _("""Specifies the Security Manager, if any. 
 
+                       You must subclass       dSecurityManager, overriding 
the appropriate hooks 
+                       and properties, and then set dApp.SecurityManager to an 
instance of your 
+                       subclass. There is no security manager by default - you 
explicitly set 
+                       this to use Dabo security.""") )
+




_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-dev

Reply via email to