[Erp5-report] r14493 - in /erp5/trunk/utils/oood: config.py oood.conf

nobody at svn.erp5.org nobody at svn.erp5.org
Tue May 15 15:49:42 CEST 2007


Author: bartek
Date: Tue May 15 15:49:42 2007
New Revision: 14493

URL: http://svn.erp5.org?rev=14493&view=rev
Log:
* migration to standard config file format

Added:
    erp5/trunk/utils/oood/oood.conf
Modified:
    erp5/trunk/utils/oood/config.py

Modified: erp5/trunk/utils/oood/config.py
URL: http://svn.erp5.org/erp5/trunk/utils/oood/config.py?rev=14493&r1=14492&r2=14493&view=diff
==============================================================================
--- erp5/trunk/utils/oood/config.py (original)
+++ erp5/trunk/utils/oood/config.py Tue May 15 15:49:42 2007
@@ -29,43 +29,43 @@
 ##############################################################################
 
 import logging
+from ConfigParser import ConfigParser
+
+config = ConfigParser()
+config.read(['/etc/oood/oood.conf', 'oood.conf'])
 
 ###################################################################
 # System config
 ###################################################################
 
-oood_home = '/var/lib/oood/'                  # Folder where all oood core files are installed
-run_dir   = '/var/run/oood/'                  # Folder where pid files, lock files and virtual frame buffer mappings are stored
-uno_path  = '/opt/openoffice.org2.0/program'  # Folder where OpenOffice Uno interpreter is installed
-log_file  = '/var/log/oood/oood.log'          # Complete absolute path to the log file
+oood_home = config.get('System', 'oood_home')
+run_dir   = config.get('System', 'run_dir')
+uno_path  = config.get('System', 'uno_path')
+log_file  = config.get('System', 'log_file')
 
-debug_mode = False
-log_level = logging.DEBUG
+debug_mode = eval(config.get('System', 'debug_mode'))
+log_level = eval(config.get('System', 'log_level'))
 
 
 ###################################################################
 # Server settings
 ###################################################################
 
-server_host = '127.0.0.1'
-server_port = 8008  # Other http-alt ports are 591 and 8080
-printer_name = 'default_printer' # name of local printer to print files directly
+server_host = config.get('Server', 'server_host')
+server_port = int(config.get('Server', 'server_port'))
+printer_name = config.get('Server', 'printer_name')
 
 
 ###################################################################
 # Pool settings
-# The pool consist of several OpenOffice.org instances
 ###################################################################
 
-pool_host             = 'localhost'
-pool_port_range_start = 4060 # According www.iana.org/assignments/port-numbers , 4060-4088 port range is unassigned
-instance_load_time    = 120  # time in seconds we have to gave one OOo instance to load in restart
-instance_timeout      = 20   # seconds to wait before killing and restarting OOo instance
-virtual_display_id    = 99   # ID of the virtual display where OOo instances are launched
+pool_host             = config.get('Pool', 'pool_host')
+pool_port_range_start = int(config.get('Pool', 'pool_port_range_start'))
+instance_load_time    = int(config.get('Pool', 'instance_load_time'))
+instance_timeout      = int(config.get('Pool', 'instance_timeout'))
+virtual_display_id    = int(config.get('Pool', 'virtual_display_id'))
 
 
-###################################################################
-# END OF USER VARIABLES
-###################################################################
+pool_size             = 1 # do not change this
 
-pool_size             = 1 # do not change this

Added: erp5/trunk/utils/oood/oood.conf
URL: http://svn.erp5.org/erp5/trunk/utils/oood/oood.conf?rev=14493&view=auto
==============================================================================
--- erp5/trunk/utils/oood/oood.conf (added)
+++ erp5/trunk/utils/oood/oood.conf Tue May 15 15:49:42 2007
@@ -1,0 +1,76 @@
+#!/usr/bin/python2.4
+##############################################################################
+#
+# Copyright (c) 2002, 2006 Nexedi SARL and Contributors. All Rights Reserved.
+#                    Bartlomiej Gorny <bartek at erp5.pl>
+#                    Kevin Deldycke <kevin at nexedi.com>
+#
+# WARNING: This program as such is intended to be used by professional
+# programmers who take the whole responsability of assessing all potential
+# consequences resulting from its eventual inadequacies and bugs
+# End users who are looking for a ready-to-use solution with commercial
+# garantees and support are strongly adviced to contract a Free Software
+# Service Company
+#
+# This program is Free Software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+#
+##############################################################################
+
+###################################################################
+# System config
+###################################################################
+
+[System]
+# Folder where all oood core files are installed
+oood_home             = /var/lib/oood
+# Folder where pid files, lock files and virtual frame buffer mappings are stored
+run_dir               = /var/run/oood
+# Folder where OpenOffice Uno interpreter is installed
+uno_path              = /opt/openoffice.org2.1/program  
+# Complete absolute path to the log file
+log_file              = /var/log/oood/oood.log
+# debug_mode tells oood to leave files in tmp directory
+debug_mode            = False
+log_level             = logging.DEBUG
+
+
+###################################################################
+# Server settings
+###################################################################
+
+[Server]
+server_host           = 127.0.0.1
+# Other http-alt ports are 591 and 8080
+server_port           = 8008  
+# name of local printer to print files directly
+printer_name          = default_printer
+
+
+###################################################################
+# Pool settings
+###################################################################
+
+[Pool]
+# The pool consist of several OpenOffice.org instances
+pool_host             = localhost
+# According www.iana.org/assignments/port-numbers , 4060-4088 port range is unassigned
+pool_port_range_start = 4060 
+# time in seconds we have to gave one OOo instance to load in restart
+instance_load_time    = 60
+# seconds to wait before killing and restarting OOo instance
+instance_timeout      = 40   
+# ID of the virtual display where OOo instances are launched
+virtual_display_id    = 99   
+




More information about the Erp5-report mailing list