[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnue] r7868 - trunk/gnue-forms/src
From: |
jamest |
Subject: |
[gnue] r7868 - trunk/gnue-forms/src |
Date: |
Thu, 18 Aug 2005 22:35:57 -0500 (CDT) |
Author: jamest
Date: 2005-08-18 22:35:56 -0500 (Thu, 18 Aug 2005)
New Revision: 7868
Modified:
trunk/gnue-forms/src/GFClient.py
Log:
added a few comments
Modified: trunk/gnue-forms/src/GFClient.py
===================================================================
--- trunk/gnue-forms/src/GFClient.py 2005-08-18 00:33:55 UTC (rev 7867)
+++ trunk/gnue-forms/src/GFClient.py 2005-08-19 03:35:56 UTC (rev 7868)
@@ -25,15 +25,16 @@
Command line client startup file that parses args, imports the required UI,
configures the controling GFInstance and passes control to it.
"""
+__revision__ = "$Id$"
import os, sys
-from gnue.common.apps import GConfig, errors
-from gnue.common.apps.GClientApp import *
+from gnue.common.apps import GConfig
+from gnue.common.apps.GClientApp import GClientApp, StartupError
from gnue.common.utils.FileUtils import dyn_import
from gnue.forms import VERSION
-from gnue.forms.GFInstance import *
+from gnue.forms.GFInstance import GFInstance
from gnue.forms.GFConfig import ConfigOptions
from gnue.forms.uidrivers._base import Exceptions
@@ -86,24 +87,37 @@
defaults = ReportsConfigOptions)
self.configurationManager.registerAlias ('gConfigReports', 'reports')
+ # Load default configuration options
+ self._ui = None
+ self.ui_type = gConfigForms ('DefaultUI')
+ self.disableSplash = self.OPTIONS['no-splash']
# ---------------------------------------------------------------------------
# Run the client application
# ---------------------------------------------------------------------------
def run (self):
-
+ """
+ Main method of GFClient
+
+ Responsible for setting up the desired UI driver, parsing command line
+ arguments, loading the desired form, and passing control to the GFInstance
+ that will control the application.
+
+ """
gEnter (4)
- # Initialize user interface
+ # -------------------------------------------------------------------------
+ # User interface setup
+ # -------------------------------------------------------------------------
+ if gConfigForms ('disableSplash') == True:
+ self.disableSplash = True
+
gDebug (4, "Loading user interface driver")
- self.ui_type = self.OPTIONS ['user_interface']
- if self.ui_type:
- SPECIFIC_UI = True
- else:
- SPECIFIC_UI = False
- self.ui_type = gConfigForms ('DefaultUI')
+ SPECIFIC_UI = bool(self.OPTIONS ['user_interface'])
+ if SPECIFIC_UI:
+ self.ui_type = self.OPTIONS ['user_interface']
while 1:
try:
@@ -132,15 +146,16 @@
else:
raise StartupError, u_("Unable to load UI driver: %s") % err
+ # -------------------------------------------------------------------------
# Get the user supplied parameters
+ # -------------------------------------------------------------------------
+ # User supplied parameters are a way of passing initial values into form
+ # variables from the command line
+ #
gDebug (4, "Parsing command line parameters")
userParameters = self.getCommandLineParameters (self.ARGUMENTS [1:])
- if gConfigForms ('disableSplash') == True:
- self.disableSplash = True
- else:
- self.disableSplash = self.OPTIONS['no-splash']
# Create the instance that will control the loaded form(s)
gDebug (4, "Creating GFInstance object")
@@ -178,9 +193,6 @@
gDebug (4, "Parsing form definition")
instance.addFormFromFile (formfile)
- #gDebug (4, "Parsing standard dialogs")
- #instance.addDialogs ()
-
gDebug (4, "Activating form")
instance.activate ()
@@ -195,6 +207,12 @@
# ---------------------------------------------------------------------------
def __listUIs (self):
+ """
+ Helper function to print a list of user interfaces that forms supports
+
+ If this functoin is called then it will print out the help text and then
+ force exit of the program.
+ """
self.printHelpHeader ()
print _("The following interfaces are supported by GNUe Forms. "
"You can select an\ninterface via the --interface option.")
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [gnue] r7868 - trunk/gnue-forms/src,
jamest <=