[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
gnue common/setup.py common/etc/sample.gnue.con...
From: |
Jason Cater |
Subject: |
gnue common/setup.py common/etc/sample.gnue.con... |
Date: |
Sat, 27 Apr 2002 16:30:42 -0400 |
CVSROOT: /home/cvs
Module name: gnue
Changes by: Jason Cater <address@hidden> 02/04/27 16:30:42
Modified files:
common : setup.py
common/etc : sample.gnue.conf
common/src : GConfig.py
designer/src : DataSourceEditor.py Icons.py
designer/src/forms/LayoutEditor: LayoutEditorTools.py
forms : setup.py
forms/src : GFClient.py
forms/src/uidrivers/wx: UIdriver.py
reports/src : GRFilters.py
Log message:
added support for a site-wide installation configuration file that
allows package maintainers to put key files in places other than a single root
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/common/setup.py.diff?cvsroot=OldCVS&tr1=1.34&tr2=1.35&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/common/etc/sample.gnue.conf.diff?cvsroot=OldCVS&tr1=1.29&tr2=1.30&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/common/src/GConfig.py.diff?cvsroot=OldCVS&tr1=1.14&tr2=1.15&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/designer/src/DataSourceEditor.py.diff?cvsroot=OldCVS&tr1=1.20&tr2=1.21&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/designer/src/Icons.py.diff?cvsroot=OldCVS&tr1=1.9&tr2=1.10&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/designer/src/forms/LayoutEditor/LayoutEditorTools.py.diff?cvsroot=OldCVS&tr1=1.6&tr2=1.7&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/forms/setup.py.diff?cvsroot=OldCVS&tr1=1.60&tr2=1.61&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/forms/src/GFClient.py.diff?cvsroot=OldCVS&tr1=1.37&tr2=1.38&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/forms/src/uidrivers/wx/UIdriver.py.diff?cvsroot=OldCVS&tr1=1.165&tr2=1.166&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/reports/src/GRFilters.py.diff?cvsroot=OldCVS&tr1=1.6&tr2=1.7&r1=text&r2=text
Patches:
Index: gnue/common/etc/sample.gnue.conf
diff -c gnue/common/etc/sample.gnue.conf:1.29
gnue/common/etc/sample.gnue.conf:1.30
*** gnue/common/etc/sample.gnue.conf:1.29 Sun Apr 14 17:06:00 2002
--- gnue/common/etc/sample.gnue.conf Sat Apr 27 16:30:41 2002
***************
*** 49,56 ****
#checkboxFalse = N
! # Set to "true" if you want <enter> to insert newlines in multirow entries.
! # Even if set to false, Shift+Enter will insert a newline
EnterIsNewLine = 0
--- 49,56 ----
#checkboxFalse = N
! # Set to "true" if you want <enter> to insert newlines in multirow entries.
! # Even if set to false, Shift+Enter will insert a newline
EnterIsNewLine = 0
***************
*** 70,88 ****
Encoding=DEFAULT
# Startup graphic
! splashScreenPNG=shared/images/gnue-splash.png
disableSplash=0
#GNUe Tool Bar Buttons
! tb_commit=shared/images/tb_save.png
! tb_insert=shared/images/tb_new.png
! tb_rollback=shared/images/tb_undo.png
! tb_delete=shared/images/tb_trash.png
! tb_previous=shared/images/tb_left_arrow.png
! tb_next=shared/images/tb_right_arrow.png
! tb_query_prep=shared/images/tb_preferences.png
! tb_query=shared/images/tb_search.png
! tb_help=shared/images/tb_help.png
#GNUe Menu/Toolbar Status Bar Messages
msg_commit=Save all changes to database.
--- 70,88 ----
Encoding=DEFAULT
# Startup graphic
! splashScreenPNG=gnue-splash.png
disableSplash=0
#GNUe Tool Bar Buttons
! tb_commit=tb_save.png
! tb_insert=tb_new.png
! tb_rollback=tb_undo.png
! tb_delete=tb_trash.png
! tb_previous=tb_left_arrow.png
! tb_next=tb_right_arrow.png
! tb_query_prep=tb_preferences.png
! tb_query=tb_search.png
! tb_help=tb_help.png
#GNUe Menu/Toolbar Status Bar Messages
msg_commit=Save all changes to database.
***************
*** 106,116 ****
GEASDIR=/usr/local/
# GNUe logo
! smallPNG=shared/images/gnue.png
# Might need altered but I doubt it
# The default height of widgets for widgets that don't specify height in .gfd
file
! widgetHeight=1
# The default width of widgets for widgets that don't specify width in .gfd
file
widgetWidth =10
--- 106,116 ----
GEASDIR=/usr/local/
# GNUe logo
! smallPNG=gnue.png
# Might need altered but I doubt it
# The default height of widgets for widgets that don't specify height in .gfd
file
! widgetHeight=1
# The default width of widgets for widgets that don't specify width in .gfd
file
widgetWidth =10
***************
*** 209,220 ****
[reports]
ReportsDir = reports
! FiltersDir = shared/filters
# TempDir = /usr/tmp
! # Location of the filter definition file
! filters = etc/report-filters.conf
# Default Destinations
DefaultDestinationType = printer
--- 209,220 ----
[reports]
ReportsDir = reports
! FiltersDir = filters
# TempDir = /usr/tmp
! # Location/name of the filter definition file
! filters = report-filters.conf
# Default Destinations
DefaultDestinationType = printer
Index: gnue/common/setup.py
diff -c gnue/common/setup.py:1.34 gnue/common/setup.py:1.35
*** gnue/common/setup.py:1.34 Mon Jan 28 19:57:15 2002
--- gnue/common/setup.py Sat Apr 27 16:30:41 2002
***************
*** 110,127 ****
options = []
# This statement stops the "search path" error messages
! try:
sys.path.append(dict['install_lib'][1])
! except KeyError:
! if sys.platform == 'win32':
options.append('install_lib = r"%s"' % sys.prefix)
for key in dict.keys():
options.append('%s = "%s"' % (key,
string.replace(dict[key][1],'"','\\"')))
gnue_sys_py = """
#
! # Copyright 2001 Free Software Foundation
#
# This file is part of GNU Enterprise.
#
--- 110,130 ----
options = []
# This statement stops the "search path" error messages
! try:
sys.path.append(dict['install_lib'][1])
! except KeyError:
! if sys.platform == 'win32':
options.append('install_lib = r"%s"' % sys.prefix)
for key in dict.keys():
options.append('%s = "%s"' % (key,
string.replace(dict[key][1],'"','\\"')))
+ if dict.has_key('prefix') and not dict.has_key('install_prefix'):
+ options.append('install_prefix = prefix')
+
gnue_sys_py = """
#
! # Copyright 2001-2002 Free Software Foundation
#
# This file is part of GNU Enterprise.
#
***************
*** 156,161 ****
--- 159,218 ----
output.write(gnue_sys_py)
output.close()
+ output = open("site_config.cfg", "w")
+ output.write("""# IF YOU DON'T KNOW WHAT THIS FILE IS FOR, THEN YOU DON'T
NEED TO BE HERE
+
+
+ ##
+ ## Python dist-utils options
+ ##
+ %s
+
+
+ ##
+ ## .. and our settings
+ ##
+ common_etc = install_prefix + '/etc'
+ common_images = install_prefix + '/shared/images'
+ common_appbase = install_prefix
+
+ # forms_etc = common_etc
+ # forms_images = common_images
+ # forms_appbase = common_appbase
+
+ # reports_etc = common_etc
+ # reports_images = common_images
+ # reports_appbase = common_appbase
+
+ # designer_etc = common_etc
+ # designer_images = common_images
+
+ ##
+ ## ... and package maintainer overrides
+ ##
+ """ % string.join(options,'\n'))
+
+ output.close()
+
+
+ # Site config stuff
+ try:
+ index = sys.argv.index('--cfg-path')
+ site_config =
os.path.join(os.path.abspath(sys.argv[index+1]),'.gnue-install.cfg')
+ sys.argv.pop(index)
+ sys.argv.pop(index)
+ if 'install' in sys.argv:
+ input = open('site_config.cfg')
+ file = input.readlines()
+ input.close()
+ print "Writing site configuration to %s" % site_config
+ output = open(site_config,'w')
+ output.writelines(file)
+ output.close()
+
+ except ValueError:
+ pass
+
distutils.core.setup (name = "GNUe-Common",
version = VERSION,
***************
*** 167,173 ****
# Override certain command classes with our own ones
cmdclass = {'install_data':install_Data_Files,
'build_scripts':my_build_scripts},
! # scripts = ["scripts/gnuedtd"],
data_files = dfiles,
packages = ["gnue",
"gnue.common",
--- 224,230 ----
# Override certain command classes with our own ones
cmdclass = {'install_data':install_Data_Files,
'build_scripts':my_build_scripts},
! scripts = ["scripts/gnuedtd"],
data_files = dfiles,
packages = ["gnue",
"gnue.common",
***************
*** 195,201 ****
"gnue.common.dbdrivers.ingres",
"gnue.common.dbdrivers.interbase",
"gnue.common.dbdrivers.sapdb",
! "gnue.common.dbdrivers.sqlrelay",
"gnue.common.dbdrivers.sybase"
],
--- 252,258 ----
"gnue.common.dbdrivers.ingres",
"gnue.common.dbdrivers.interbase",
"gnue.common.dbdrivers.sapdb",
! "gnue.common.dbdrivers.sqlrelay",
"gnue.common.dbdrivers.sybase"
],
Index: gnue/common/src/GConfig.py
diff -c gnue/common/src/GConfig.py:1.14 gnue/common/src/GConfig.py:1.15
*** gnue/common/src/GConfig.py:1.14 Tue Apr 23 19:25:24 2002
--- gnue/common/src/GConfig.py Sat Apr 27 16:30:42 2002
***************
*** 74,106 ****
GDebug.printMesg(1,'Application style: %s' % self._application)
GDebug.printMesg(1,'Reading basic configuration')
- if os.environ.has_key('INSTALL_PREFIX'):
- location = os.environ['INSTALL_PREFIX']+'/etc/gnue.conf'
- try:
- self.readConfig(location)
- _success = TRUE
- except IOError:
- GDebug.printMesg (1,'File not available')
- except:
- _error_type=sys.exc_type
- _error_msg=sys.exc_value
! GDebug.printMesg(1,'Reading user configuration overrides')
! if os.environ.has_key('HOME'):
! location = os.environ['HOME']+'/.gnue/gnue.conf'
! try:
! self.readConfig(location)
! _success = TRUE
! except IOError:
! GDebug.printMesg (1,'File not available')
! except:
! _error_type=sys.exc_type
! _error_msg=sys.exc_value
! GDebug.printMesg(1,'Reading fixed system configuration')
! if os.environ.has_key('INSTALL_PREFIX'):
! location = os.environ['INSTALL_PREFIX']+'/etc/gnue.conf.fixed'
try:
self.readConfig(location)
_success = TRUE
--- 74,100 ----
GDebug.printMesg(1,'Application style: %s' % self._application)
GDebug.printMesg(1,'Reading basic configuration')
! etc_base = getInstalledBase('%s_etc' % application, 'common_etc')
! locations = []
+ # /usr/local/gnue/etc/gnue.conf
+ if etc_base:
+ locations.append(os.path.join(etc_base,'gnue.conf'))
! # ~/.gnue/gnue.conf
! try:
! locations.append(os.path.join(os.environ['HOME'], '.gnue','gnue.conf'))
! except KeyError:
! pass
!
! # /usr/local/gnue/etc/gnue.conf.fixed
! if etc_base:
! locations.append(os.path.join(etc_base,'gnue.conf.fixed'))
!
! # Now, try each file
! for location in locations:
! GDebug.printMesg(1,'Reading configuration file %s' % location)
try:
self.readConfig(location)
_success = TRUE
***************
*** 110,129 ****
_error_type=sys.exc_type
_error_msg=sys.exc_value
-
if not _success:
if _error_type==None:
!
print "The gnue.conf file appears to be missing\n\n" \
+"The file should be located in one of the following
locations\n"
! if os.environ.has_key('INSTALL_PREFIX'):
! print os.environ['INSTALL_PREFIX']+'/etc/gnue.conf'
if os.environ.has_key('HOME'):
print os.environ['HOME']+'/.gnue/gnue.conf'
- if os.environ.has_key('INSTALL_PREFIX'):
- print os.environ['INSTALL_PREFIX']+'/etc/gnue.conf.fixed'
sys.exit("Missing GNUe config file")
!
else:
raise Exception,_error_msg
--- 104,126 ----
_error_type=sys.exc_type
_error_msg=sys.exc_value
if not _success:
if _error_type==None:
!
! #
! # TODO: Should we even abort?
! # TODO: If not, then at least
! # TODO: make this an exception
! #
print "The gnue.conf file appears to be missing\n\n" \
+"The file should be located in one of the following
locations\n"
! if etc_dir:
! print etc_dir + '/gnue.conf'
! print etc_dir + '/gnue.conf.fixed'
if os.environ.has_key('HOME'):
print os.environ['HOME']+'/.gnue/gnue.conf'
sys.exit("Missing GNUe config file")
!
else:
raise Exception,_error_msg
***************
*** 156,161 ****
--- 153,198 ----
+ def getInstalledBase(*parameters):
+ for param in parameters:
+ try:
+ return _site_config[param]
+ except KeyError:
+ pass
+
+ return None
+
+
+
+ ############################
+ #
+ # Site configuration stuff
+ #
+ ############################
+
+ _site_config = {}
+
+ if os.environ.has_key('GNUE_INSTALLED_SITE_CFG'):
+ try:
+ input = open(os.environ['GNUE_INSTALLED_SITE_CFG'],'r')
+ text = input.read()
+ input.close()
+ except IOError:
+ raise "Unable to read the GNUE_INSTALLED_SITE_CFG file... There is a
problem with your installation"
+
+ # This evaluates the text file as a python script (hope you secured it)
+ # The resulting namespace is stored as a dict in _site_config.
+ eval (text, _site_config)
+
+ elif os.environ.has_key('INSTALL_PREFIX'):
+
+ install_prefix = os.environ['INSTALL_PREFIX']
+ _site_config = {
+ 'install_prefix': install_prefix,
+ 'common_etc': os.path.join(install_prefix,'etc'),
+ 'common_images': os.path.join(install_prefix,'shared/images'),
+ 'common_appbase': install_prefix
+ }
Index: gnue/designer/src/DataSourceEditor.py
diff -c gnue/designer/src/DataSourceEditor.py:1.20
gnue/designer/src/DataSourceEditor.py:1.21
*** gnue/designer/src/DataSourceEditor.py:1.20 Tue Jan 22 21:48:53 2002
--- gnue/designer/src/DataSourceEditor.py Sat Apr 27 16:30:42 2002
***************
*** 353,365 ****
self.deleteButtonId = wxNewId()
self.AddSimpleTool(self.addButtonId,
! wxImage(os.environ['INSTALL_PREFIX']+'/'+GConfig.get('tb_insert'),
wxBITMAP_TYPE_PNG).ConvertToBitmap(),
"Create Data Source",
"Create a new data source")
self.AddSimpleTool(self.deleteButtonId,
! wxImage(os.environ['INSTALL_PREFIX']+'/'+GConfig.get('tb_delete'),
wxBITMAP_TYPE_PNG).ConvertToBitmap(),
"Delete Data Source",
"Delete the currently selected data source")
--- 353,365 ----
self.deleteButtonId = wxNewId()
self.AddSimpleTool(self.addButtonId,
! wxImage(iamges_dir+GConfig.get('tb_insert'),
wxBITMAP_TYPE_PNG).ConvertToBitmap(),
"Create Data Source",
"Create a new data source")
self.AddSimpleTool(self.deleteButtonId,
! wxImage(iamges_dir+GConfig.get('tb_delete'),
wxBITMAP_TYPE_PNG).ConvertToBitmap(),
"Delete Data Source",
"Delete the currently selected data source")
***************
*** 661,664 ****
--- 661,669 ----
except NameError:
wxLC_HRULES=0
wxLC_VRULES=0
+
+
+ # Shortcut
+ images_dir = GConfig.getInstalledBase('designer_images','common_images') + '/'
+
Index: gnue/designer/src/Icons.py
diff -c gnue/designer/src/Icons.py:1.9 gnue/designer/src/Icons.py:1.10
*** gnue/designer/src/Icons.py:1.9 Wed Nov 21 00:02:06 2001
--- gnue/designer/src/Icons.py Sat Apr 27 16:30:42 2002
***************
*** 38,46 ****
treeIconMap = {}
treeIconList = myImageList(16,16,false)
! iconlocation = os.path.join(os.environ['INSTALL_PREFIX'],'shared/images')
! if sys.platform != 'win32':
icontype = wxBITMAP_TYPE_XPM
iconextension = 'xpm'
else:
--- 38,46 ----
treeIconMap = {}
treeIconList = myImageList(16,16,false)
! iconlocation = GConfig.getInstalledBase('designer_images','common_images') +
'/'
! if sys.platform != 'win32':
icontype = wxBITMAP_TYPE_XPM
iconextension = 'xpm'
else:
Index: gnue/designer/src/forms/LayoutEditor/LayoutEditorTools.py
diff -c gnue/designer/src/forms/LayoutEditor/LayoutEditorTools.py:1.6
gnue/designer/src/forms/LayoutEditor/LayoutEditorTools.py:1.7
*** gnue/designer/src/forms/LayoutEditor/LayoutEditorTools.py:1.6 Sun Mar
31 13:25:04 2002
--- gnue/designer/src/forms/LayoutEditor/LayoutEditorTools.py Sat Apr 27
16:30:42 2002
***************
*** 29,35 ****
from wxPython.wx import *
from gnue.common import GDebug, GConfig
! iconlocation = os.path.join(os.environ['INSTALL_PREFIX'],'shared','images')
class LayoutEditorTools(wxToolBar):
--- 29,37 ----
from wxPython.wx import *
from gnue.common import GDebug, GConfig
! iconlocation = GConfig.getInstalledBase('designer_images','common_images') +
'/'
!
!
class LayoutEditorTools(wxToolBar):
Index: gnue/forms/setup.py
diff -c gnue/forms/setup.py:1.60 gnue/forms/setup.py:1.61
*** gnue/forms/setup.py:1.60 Tue Mar 26 17:10:47 2002
--- gnue/forms/setup.py Sat Apr 27 16:30:42 2002
***************
*** 124,136 ****
if 'sdist' in sys.argv:
print """
! We are going to create the docs needed for the
source distro. You'll need lyx installed.
"""
raw_input ("Press Control-D to abort or any other key to continue")
! os.system ("""
cd doc
! lyx --export text techref.lyx
lyx --export pdf techref.lyx
lyx --export text user_guide.lyx
lyx --export pdf user_guide.lyx
--- 124,136 ----
if 'sdist' in sys.argv:
print """
! We are going to create the docs needed for the
source distro. You'll need lyx installed.
"""
raw_input ("Press Control-D to abort or any other key to continue")
! os.system ("""
cd doc
! lyx --export text techref.lyx
lyx --export pdf techref.lyx
lyx --export text user_guide.lyx
lyx --export pdf user_guide.lyx
***************
*** 154,173 ****
#"""
# sys.exit()
- # # Verify that PyXML is installed
- # try:
- # print "Checking for PyXML....",
- # from xml.sax import saxexts
- # from xml.sax import saxlib
- # print "OK"
- # except ImportError:
- # print """
- #Your system does not appear to have the
- #PyXML module installed. GNUe Forms will
- #not function without it. It is available
- #at http://sourceforge.net/projects/pyxml
- #"""
- # sys.exit()
#
# Verify at least one UI is installed
--- 154,159 ----
***************
*** 224,229 ****
--- 210,226 ----
dict = self.distribution.get_option_dict("install")
+ install_prefix = dict['prefix'][1]
+
+ # Site config stuff
+ index = sys.argv.index('--cfg-path')
+ if index > 0:
+ site_config = sys.argv[index+1]
+ else:
+ site_config = os.path.join(install_prefix,'etc')
+
+ site_config =
os.path.join(os.path.abspath(site_config),'.gnue-install.cfg')
+
if sys.platform != 'win32':
gnue_env = \
"#######\n" \
***************
*** 233,238 ****
--- 230,236 ----
+ "INST_GNUE_CONNECTIONS='%s/etc/connections.conf'\n" %
dict['prefix'][1] \
+ "os.environ['INSTALL_LIB']='%s'\n" % dict['install_lib'][1] \
+ "os.environ['INSTALL_PREFIX']='%s'\n" % dict['prefix'][1] \
+ + "os.environ['GNUE_INSTALLED_SITE_CFG']='%s'\n" % site_config \
+ "#######\n"
else:
gnue_env = \
***************
*** 252,257 ****
--- 250,256 ----
+ "os.environ['INSTALL_PREFIX']=_BASE\n" \
+ "os.environ['INSTALL_LIB']=_BASE\n" \
+ "os.putenv('PYTHONCASEOK','1')\n" \
+ + "os.environ['GNUE_INSTALLED_SITE_CFG']='%s'\n" % site_config \
+ "if os.path.isdir(os.path.join(_BASE,'extras')):\n" \
+ " sys.path.append(os.path.join(_BASE,'extras'))\n" \
+ "#######\n\n"
***************
*** 278,288 ****
docfiles = []
for file in ('doc/techref.pdf','doc/techref.txt',
! 'doc/user_guide.txt','doc/user_guide.pdf'):
! if os.path.isfile(file):
! docfiles.append(file)
! else:
! print "WARNING: File %s does not exist... not installing!" % file
setup (name = "GNUe-Forms",
--- 277,287 ----
docfiles = []
for file in ('doc/techref.pdf','doc/techref.txt',
! 'doc/user_guide.txt','doc/user_guide.pdf'):
! if os.path.isfile(file):
! docfiles.append(file)
! else:
! print "WARNING: File %s does not exist... not installing!" % file
setup (name = "GNUe-Forms",
***************
*** 296,302 ****
# Override certain command classes with our own ones
cmdclass = {'build_scripts':my_build_scripts},
! data_files = [ ('doc', docfiles) ],
packages = ["gnue.forms",
"gnue.forms.GFObjects",
--- 295,301 ----
# Override certain command classes with our own ones
cmdclass = {'build_scripts':my_build_scripts},
! data_files = [ ('doc', docfiles) ],
packages = ["gnue.forms",
"gnue.forms.GFObjects",
Index: gnue/forms/src/GFClient.py
diff -c gnue/forms/src/GFClient.py:1.37 gnue/forms/src/GFClient.py:1.38
*** gnue/forms/src/GFClient.py:1.37 Fri Mar 1 14:05:48 2002
--- gnue/forms/src/GFClient.py Sat Apr 27 16:30:42 2002
***************
*** 91,98 ****
formfile = self.ARGUMENTS[0]
except:
try:
if string.split(string.lower(os.path.basename(sys.argv[0])),'.')[0]
!= 'gfclient':
! formfile =
os.environ['INSTALL_PREFIX']+'/'+GConfig.get('FormDir')+"/"+os.path.basename(sys.argv[0])+".gfd"
else:
raise IndexError
except IndexError:
--- 91,102 ----
formfile = self.ARGUMENTS[0]
except:
try:
+ # If no form specified, then see if this is a symlinked form
definition
if string.split(string.lower(os.path.basename(sys.argv[0])),'.')[0]
!= 'gfclient':
! formfile = os.path.join (
!
GConfig.getInstalledBase('forms_appbase','common_appbase','install_prefix'),
! GConfig.get('FormDir'),
! os.path.basename(sys.argv[0])+".gfd" )
else:
raise IndexError
except IndexError:
Index: gnue/forms/src/uidrivers/wx/UIdriver.py
diff -c gnue/forms/src/uidrivers/wx/UIdriver.py:1.165
gnue/forms/src/uidrivers/wx/UIdriver.py:1.166
*** gnue/forms/src/uidrivers/wx/UIdriver.py:1.165 Thu Apr 25 21:26:21 2002
--- gnue/forms/src/uidrivers/wx/UIdriver.py Sat Apr 27 16:30:42 2002
***************
*** 1,6 ****
#
- # Copyright 2000-2002 Free Software Foundation
- #
# This file is part of GNU Enterprise.
#
# GNU Enterprise is free software; you can redistribute it
--- 1,4 ----
***************
*** 18,23 ****
--- 16,23 ----
# write to the Free Software Foundation, Inc., 59 Temple Place
# - Suite 330, Boston, MA 02111-1307, USA.
#
+ # Copyright 2000-2002 Free Software Foundation
+ #
# FILE:
# UIwxpython.py
#
***************
*** 128,138 ****
# It is used the build the basic UI
#
def init(self):
#
# SplashScreen
#
if not self._disableSplash:
! self.splash =
SplashScreen(None,bitmapfile=os.environ['INSTALL_PREFIX']+'/'+GConfig.get('splashScreenPNG'),
duration = 4000, callback=self.onCloseSplash,
style=wxSIMPLE_BORDER|wxCENTRE_ON_SCREEN )
swidth,sheight = self.splash.GetSizeTuple()
--- 128,140 ----
# It is used the build the basic UI
#
def init(self):
+
+
#
# SplashScreen
#
if not self._disableSplash:
! self.splash =
SplashScreen(None,bitmapfile=images_dir+GConfig.get('splashScreenPNG'),
duration = 4000, callback=self.onCloseSplash,
style=wxSIMPLE_BORDER|wxCENTRE_ON_SCREEN )
swidth,sheight = self.splash.GetSizeTuple()
***************
*** 197,203 ****
self.menu_sb_space=4 # the extra spaces needed by the menu, toolbar and
statusbar
!
self.statusBar = self.mainWindow.CreateStatusBar()
self.statusBar.SetFieldsCount(5)
self.statusBar.SetStatusWidths([-1,50,50,75,75])
--- 199,205 ----
self.menu_sb_space=4 # the extra spaces needed by the menu, toolbar and
statusbar
!
self.statusBar = self.mainWindow.CreateStatusBar()
self.statusBar.SetFieldsCount(5)
self.statusBar.SetStatusWidths([-1,50,50,75,75])
***************
*** 272,288 ****
mainToolBar =
self.mainWindow.CreateToolBar(wxTB_HORIZONTAL|wxTB_DOCKABLE)
mainToolBar.SetToolBitmapSize(wxSize(24,24))
! mainToolBar.AddSimpleTool(100,
wxImage(os.environ['INSTALL_PREFIX']+'/'+GConfig.get('tb_commit'),
wxBITMAP_TYPE_PNG).ConvertToBitmap(), "Save Changes", GConfig.get('msg_commit'))
! mainToolBar.AddSimpleTool(203,
wxImage(os.environ['INSTALL_PREFIX']+'/'+GConfig.get('tb_insert'),
wxBITMAP_TYPE_PNG).ConvertToBitmap(), "Insert Record",
GConfig.get('msg_insert'))
! mainToolBar.AddSimpleTool(204,
wxImage(os.environ['INSTALL_PREFIX']+'/'+GConfig.get('tb_delete'),
wxBITMAP_TYPE_PNG).ConvertToBitmap(), "Delete Record",
GConfig.get('msg_delete'))
mainToolBar.AddSeparator()
! mainToolBar.AddSimpleTool(202,
wxImage(os.environ['INSTALL_PREFIX']+'/'+GConfig.get('tb_previous'),
wxBITMAP_TYPE_PNG).ConvertToBitmap(), "Previous
Record",GConfig.get('msg_previous'))
! mainToolBar.AddSimpleTool(201,
wxImage(os.environ['INSTALL_PREFIX']+'/'+GConfig.get('tb_next'),
wxBITMAP_TYPE_PNG).ConvertToBitmap(), "Next Record",GConfig.get('msg_next'))
mainToolBar.AddSeparator()
! mainToolBar.AddSimpleTool(207,
wxImage(os.environ['INSTALL_PREFIX']+'/'+GConfig.get('tb_query_prep'),
wxBITMAP_TYPE_PNG).ConvertToBitmap(), "Prepare Query",
GConfig.get('msg_query_prep'))
! mainToolBar.AddSimpleTool(208,
wxImage(os.environ['INSTALL_PREFIX']+'/'+GConfig.get('tb_query'),
wxBITMAP_TYPE_PNG).ConvertToBitmap(), "Execute Query", GConfig.get('msg_query'))
mainToolBar.AddSeparator()
! mainToolBar.AddSimpleTool(102,
wxImage(os.environ['INSTALL_PREFIX']+'/'+GConfig.get('tb_rollback'),
wxBITMAP_TYPE_PNG).ConvertToBitmap(), "Clear Form", GConfig.get('msg_rollback'))
mainToolBar.Realize()
self.mainWindow.panel = wxPanel(self.mainWindow,-1,
wxDefaultPosition,self.mainWindow.GetSize())
--- 274,290 ----
mainToolBar =
self.mainWindow.CreateToolBar(wxTB_HORIZONTAL|wxTB_DOCKABLE)
mainToolBar.SetToolBitmapSize(wxSize(24,24))
! mainToolBar.AddSimpleTool(100,
wxImage(images_dir+GConfig.get('tb_commit'),
wxBITMAP_TYPE_PNG).ConvertToBitmap(), "Save Changes", GConfig.get('msg_commit'))
! mainToolBar.AddSimpleTool(203,
wxImage(images_dir+GConfig.get('tb_insert'),
wxBITMAP_TYPE_PNG).ConvertToBitmap(), "Insert Record",
GConfig.get('msg_insert'))
! mainToolBar.AddSimpleTool(204,
wxImage(images_dir+GConfig.get('tb_delete'),
wxBITMAP_TYPE_PNG).ConvertToBitmap(), "Delete Record",
GConfig.get('msg_delete'))
mainToolBar.AddSeparator()
! mainToolBar.AddSimpleTool(202,
wxImage(images_dir+GConfig.get('tb_previous'),
wxBITMAP_TYPE_PNG).ConvertToBitmap(), "Previous
Record",GConfig.get('msg_previous'))
! mainToolBar.AddSimpleTool(201, wxImage(images_dir+GConfig.get('tb_next'),
wxBITMAP_TYPE_PNG).ConvertToBitmap(), "Next Record",GConfig.get('msg_next'))
mainToolBar.AddSeparator()
! mainToolBar.AddSimpleTool(207,
wxImage(images_dir+GConfig.get('tb_query_prep'),
wxBITMAP_TYPE_PNG).ConvertToBitmap(), "Prepare Query",
GConfig.get('msg_query_prep'))
! mainToolBar.AddSimpleTool(208,
wxImage(images_dir+GConfig.get('tb_query'),
wxBITMAP_TYPE_PNG).ConvertToBitmap(), "Execute Query", GConfig.get('msg_query'))
mainToolBar.AddSeparator()
! mainToolBar.AddSimpleTool(102,
wxImage(images_dir+GConfig.get('tb_rollback'),
wxBITMAP_TYPE_PNG).ConvertToBitmap(), "Clear Form", GConfig.get('msg_rollback'))
mainToolBar.Realize()
self.mainWindow.panel = wxPanel(self.mainWindow,-1,
wxDefaultPosition,self.mainWindow.GetSize())
***************
*** 503,509 ****
action = self.dispatchEvent(GFEvent('requestRECORDNUMBER',
dlg.GetValue()))
else:
action = None
!
dlg.Destroy()
return action
--- 505,511 ----
action = self.dispatchEvent(GFEvent('requestRECORDNUMBER',
dlg.GetValue()))
else:
action = None
!
dlg.Destroy()
return action
***************
*** 528,534 ****
self.splash.Show(0)
self.splash.Destroy()
!
#############################################################################
#############################################################################
#
--- 530,536 ----
self.splash.Show(0)
self.splash.Destroy()
!
#############################################################################
#############################################################################
#
***************
*** 664,670 ****
wxSize(object.width*widgetWidth,object.height*widgetHeight),
wxSB_VERTICAL)
return newWidget
!
#
# UIButton
#
--- 666,672 ----
wxSize(object.width*widgetWidth,object.height*widgetHeight),
wxSB_VERTICAL)
return newWidget
!
#
# UIButton
#
***************
*** 680,686 ****
if initialize:
EVT_BUTTON(newWidget,newWidget.GetId(),self.buttonHandler)
#_setDefaultEventHandlers(newWidget,initialize)
!
return newWidget
def buttonHandler(self,event):
--- 682,688 ----
if initialize:
EVT_BUTTON(newWidget,newWidget.GetId(),self.buttonHandler)
#_setDefaultEventHandlers(newWidget,initialize)
!
return newWidget
def buttonHandler(self,event):
***************
*** 693,699 ****
action = GFEvent('fireTRIGGER',gfObject.trigger)
if action:
! _EVENTPROCESSOR(action)
#
# UIPage
--- 695,701 ----
action = GFEvent('fireTRIGGER',gfObject.trigger)
if action:
! _EVENTPROCESSOR(action)
#
# UIPage
***************
*** 712,720 ****
else:
newWidget = wxPanel(container, -1,wxDefaultPosition,container.GetSize())
newWidget.Show(FALSE)
!
_setDefaultEventHandlers(newWidget,initialize)
!
interface._pageList.append(newWidget)
return newWidget
--- 714,722 ----
else:
newWidget = wxPanel(container, -1,wxDefaultPosition,container.GetSize())
newWidget.Show(FALSE)
!
_setDefaultEventHandlers(newWidget,initialize)
!
interface._pageList.append(newWidget)
return newWidget
***************
*** 739,745 ****
choices = [""]
choices.sort()
!
newWidget = wxComboBox(container, -1, "",defaultPoint,
wxSize(self.itemWidth,self.itemHeight),
choices, wxCB_DROPDOWN,) # |wxWANTS_CHARS,)
--- 741,747 ----
choices = [""]
choices.sort()
!
newWidget = wxComboBox(container, -1, "",defaultPoint,
wxSize(self.itemWidth,self.itemHeight),
choices, wxCB_DROPDOWN,) # |wxWANTS_CHARS,)
***************
*** 874,880 ****
" Name : %s\n"
" Version: %s\n"
" Author : %s\n"
! " Description: %s\n"
% (programVersion, formName
,formVersion,author,description),
"About", wxOK | wxICON_INFORMATION)
#
--- 876,882 ----
" Name : %s\n"
" Version: %s\n"
" Author : %s\n"
! " Description: %s\n"
% (programVersion, formName
,formVersion,author,description),
"About", wxOK | wxICON_INFORMATION)
#
***************
*** 1056,1062 ****
self.dlg = wxDialog(NULL, -1, "GNU Enterprise: Login to %s" %
loginData[0])
self.dlg.SetAutoLayout(true)
! bmp = wxImage(os.environ['INSTALL_PREFIX']+'/'+GConfig.get('smallPNG'),
wxBITMAP_TYPE_PNG).ConvertToBitmap()
messageField = WrappedStaticText(self.dlg, -1, str(loginMesg), 300,
style=wxALIGN_CENTER)
--- 1058,1064 ----
self.dlg = wxDialog(NULL, -1, "GNU Enterprise: Login to %s" %
loginData[0])
self.dlg.SetAutoLayout(true)
! bmp = wxImage(images_dir+GConfig.get('smallPNG'),
wxBITMAP_TYPE_PNG).ConvertToBitmap()
messageField = WrappedStaticText(self.dlg, -1, str(loginMesg), 300,
style=wxALIGN_CENTER)
***************
*** 1276,1281 ****
}
!
--- 1278,1284 ----
}
! # Shortcut
! images_dir = GConfig.getInstalledBase('forms_images','common_images') + '/'
Index: gnue/reports/src/GRFilters.py
diff -c gnue/reports/src/GRFilters.py:1.6 gnue/reports/src/GRFilters.py:1.7
*** gnue/reports/src/GRFilters.py:1.6 Fri Apr 26 01:34:26 2002
--- gnue/reports/src/GRFilters.py Sat Apr 27 16:30:42 2002
***************
*** 81,87 ****
location = GConfig.get('filters','')
if location:
if location[0] != '/':
! location = install_prefix + "/" + location
self.readConfig(location)
--- 81,89 ----
location = GConfig.get('filters','')
if location:
if location[0] != '/':
! location = os.path.join(
!
GConfig.getInstalledBase('reports_etc','common_etc','install_prefix'),
! location )
self.readConfig(location)
***************
*** 116,124 ****
self.mappings[string.lower(option)] =
self._parser.get('mappings',option)
# Get the base directory for filters
! filterBase = GConfig.get('FiltersDir','shared/filters')
if filterBase[0] != '/':
! filterBase = install_prefix + '/' + filterBase
# Pull in all the other sections
for section in self._parser.sections():
--- 118,126 ----
self.mappings[string.lower(option)] =
self._parser.get('mappings',option)
# Get the base directory for filters
! filterBase = GConfig.get('FiltersDir','filters')
if filterBase[0] != '/':
! filterBase = GConfig.getInstalledBase('reports_shared') + filterBase
# Pull in all the other sections
for section in self._parser.sections():
***************
*** 156,165 ****
def getFilters(self):
return []
-
- # Get the install prefix
- if os.environ.has_key('INSTALL_PREFIX'):
- install_prefix = os.environ['INSTALL_PREFIX']
- else:
- install_prefix = '/usr/local/gnue'
--- 158,161 ----
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- gnue common/setup.py common/etc/sample.gnue.con...,
Jason Cater <=