[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
gnue/common/src GBaseApp.py GConfig.py
From: |
James Thompson |
Subject: |
gnue/common/src GBaseApp.py GConfig.py |
Date: |
Sat, 01 Jun 2002 15:35:52 -0400 |
CVSROOT: /cvsroot/gnue
Module name: gnue
Changes by: James Thompson <address@hidden> 02/06/01 15:35:52
Modified files:
common/src : GBaseApp.py GConfig.py
Log message:
--help and --version now print the GNUe Common version that is installed
new common option --configuration-options prints the application's
valid config
file entries
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue/common/src/GBaseApp.py.diff?tr1=1.19&tr2=1.20&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue/common/src/GConfig.py.diff?tr1=1.23&tr2=1.24&r1=text&r2=text
Patches:
Index: gnue/common/src/GBaseApp.py
diff -c gnue/common/src/GBaseApp.py:1.19 gnue/common/src/GBaseApp.py:1.20
*** gnue/common/src/GBaseApp.py:1.19 Mon May 6 22:27:04 2002
--- gnue/common/src/GBaseApp.py Sat Jun 1 15:35:52 2002
***************
*** 105,110 ****
--- 105,112 ----
_('GNUE_CONNECTIONS is checked.') ],
[ 'help', None, 'help', 0, None, None,
_('Displays this help screen.') ],
+ [ 'configuration_options', None, 'configuration-options', 0, None,
None,
+ _('Displays a list of valid configuration file entries, their
purpose, and their default values.') ],
[ 'profile', None, 'profile', 0, None, None,
_("Run Python's built-in profiler and display the resulting ") + \
_("run statistics.") ],
***************
*** 157,162 ****
--- 159,167 ----
elif self.OPTIONS['version']:
self.printVersion()
sys.exit()
+ elif self.OPTIONS['configuration_options']:
+ print GConfig.printableConfigOptions(defaults)
+ sys.exit()
self._run = self.run
***************
*** 232,239 ****
#
# Display version information for this application
#
! def printVersion(self):
print _("\n%s\nVersion %s\n") % (self.NAME, self.VERSION)
#
# Display version information for this program
--- 237,246 ----
#
# Display version information for this application
#
! def printVersion(self):
! from gnue.common import VERSION as commonVersion
print _("\n%s\nVersion %s\n") % (self.NAME, self.VERSION)
+ print _("GNUe Common Version %s\n") % commonVersion
#
# Display version information for this program
Index: gnue/common/src/GConfig.py
diff -c gnue/common/src/GConfig.py:1.23 gnue/common/src/GConfig.py:1.24
*** gnue/common/src/GConfig.py:1.23 Tue May 14 21:27:08 2002
--- gnue/common/src/GConfig.py Sat Jun 1 15:35:52 2002
***************
*** 32,38 ****
from ConfigParser import *
import os, sys, string
! from gnue.common import openResource
import GDebug
import copy
--- 32,38 ----
from ConfigParser import *
import os, sys, string
! from gnue.common import openResource, lineWrap
import GDebug
import copy
***************
*** 141,148 ****
return None
!
!
############################
#
# Site configuration stuff
--- 141,158 ----
return None
! def printableConfigOptions(options, outputWidth=60):
! output = "Valid config file options.....\n"
! if options:
! for option in options:
! output += '='*outputWidth+"\n"
! nameString="Name:%s"%option['Name']
! defaultString="Default Value:%s" % option['Default']
! output += "%s%s%s\n" %(nameString,'
'*(outputWidth-len(nameString+defaultString)),defaultString)
! output += "%s\n" % lineWrap(option['Description'],outputWidth)
! else:
! output += "No options defined"
! return output
############################
#
# Site configuration stuff
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- gnue/common/src GBaseApp.py GConfig.py,
James Thompson <=