[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
gnue/gnue-common/gnue/common GClientApp.py
From: |
Jason Cater |
Subject: |
gnue/gnue-common/gnue/common GClientApp.py |
Date: |
Fri, 01 Jun 2001 12:56:06 -0700 |
CVSROOT: /home/cvs
Module name: gnue
Changes by: Jason Cater <address@hidden> 01/06/01 12:56:06
Modified files:
gnue-common/gnue/common: GClientApp.py
Log message:
Stuff
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue-common/gnue/common/GClientApp.py.diff?cvsroot=OldCVS&tr1=1.7&tr2=1.8&r1=text&r2=text
Patches:
Index: gnue/gnue-common/gnue/common/GClientApp.py
diff -u gnue/gnue-common/gnue/common/GClientApp.py:1.7
gnue/gnue-common/gnue/common/GClientApp.py:1.8
--- gnue/gnue-common/gnue/common/GClientApp.py:1.7 Sat May 26 19:42:44 2001
+++ gnue/gnue-common/gnue/common/GClientApp.py Fri Jun 1 12:56:06 2001
@@ -44,7 +44,8 @@
NAME = "GNUe Client Application"
COMMAND_OPTIONS = [] # Should be in same format as _base_options below
SUMMARY = "A brief summary of the program goes here."
- USAGE = "%s [options] file" % sys.argv[0]
+ COMMAND = "client"
+ USAGE = "%s [options] file"
# Run the program
@@ -61,7 +62,7 @@
- def __init__(self):
+ def __init__(self, connections=None):
# format of COMMAND_OPTIONS and _base_options:
# [option, option] where option is:
@@ -145,37 +146,39 @@
# Get the connection definitions
-
- if self.OPTIONS['connections']:
- self.connections_file = self.OPTIONS['connections']
- elif os.environ.has_key('GNUE_CONNECTIONS'):
- self.connections_file = os.environ['GNUE_CONNECTIONS']
+ if connections != None:
+ self.connections = Connections
else:
- self.connections_file = "" # temp
-# self.handleStartupError(
-# 'Unable to load the connections definition file.\n' \
-# + '\n Please set the environmental variable GNUE_CONNECTIONS or '
\
-# + '\n use the "-f" command option.')
+ if self.OPTIONS['connections']:
+ self.connections_file = self.OPTIONS['connections']
+ elif os.environ.has_key('GNUE_CONNECTIONS'):
+ self.connections_file = os.environ['GNUE_CONNECTIONS']
+ else:
+ self.connections_file = "" # temp
+# self.handleStartupError(
+# 'Unable to load the connections definition file.\n' \
+# + '\n Please set the environmental variable GNUE_CONNECTIONS or
' \
+# + '\n use the "-f" command option.')
#
- GDebug.printMesg(1, 'Connection Definition: "%s"' % self.connections_file)
+ GDebug.printMesg(1, 'Connection Definition: "%s"' %
self.connections_file)
- # Temporary "if" until we fully implement the connection definitions
- if len(self.connections_file):
- try:
- self.connections = GConnections.GConnections(self.connections_file)
- except GConnections.InvalidFormatError, msg:
- self.handleStartupError(
- 'Unable to load the connections definition file.\n' \
- + '\n The connections file is in an invalid format. ' \
- + '\n %s' \
- % msg)
- except:
- self.handleStartupError(
- 'Unable to load the connections definition file.\n' \
- + '\n The connections file specified either does ' \
- + '\n not exist or is not readable by your account.\n' \
- + '\n Location: "%s"'
- % self.connections_file)
+ # Temporary "if" until we fully implement the connection definitions
+ if len(self.connections_file):
+ try:
+ self.connections = GConnections.GConnections(self.connections_file)
+ except GConnections.InvalidFormatError, msg:
+ self.handleStartupError(
+ 'Unable to load the connections definition file.\n' \
+ + '\n The connections file is in an invalid format. ' \
+ + '\n %s' \
+ % msg)
+ except:
+ self.handleStartupError(
+ 'Unable to load the connections definition file.\n' \
+ + '\n The connections file specified either does ' \
+ + '\n not exist or is not readable by your account.\n' \
+ + '\n Location: "%s"'
+ % self.connections_file)
#
# Display version information for this application
@@ -248,7 +251,7 @@
print "Error: %s" % msg
if string.find(msg, "\n") + 1:
print '-' * 60
- print "\nFor help, type:\n %s --help\n" % (sys.argv[0])
+ print "\nFor help, type:\n %s --help\n" % (self.COMMAND)
sys.exit()
#
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- gnue/gnue-common/gnue/common GClientApp.py,
Jason Cater <=