diff --git a/checkin_notes b/checkin_notes index 18b68d8f94..f341a1380a 100755 --- a/checkin_notes +++ b/checkin_notes @@ -13548,3 +13548,15 @@ Daniel 14 June 2004 cs_scheduler.C hostinfo_unix.C +Rom 14 June 2004 + - Add two additional tools to the default install + parse_config - Parses the config file looking for the requested config + information. + db_query - Queries the database for specific information in a + stripchart compatible format. + + py/boinc/ + setup_project.py + tools/ + parse_config + db_query diff --git a/py/Boinc/setup_project.py b/py/Boinc/setup_project.py index 3c50b66a59..57173f465f 100644 --- a/py/Boinc/setup_project.py +++ b/py/Boinc/setup_project.py @@ -277,11 +277,12 @@ def install_boinc_files(dest_dir): [ 'cgi', 'file_upload_handler']) map(lambda (s): install(builddir('sched',s), dir('bin',s)), [ 'make_work', 'feeder', 'transitioner', 'validate_test', 'validate_trivial', - 'file_deleter', 'assimilator', 'db_dump', 'update_stats' ]) + 'file_deleter', 'assimilator', 'update_stats', 'db_dump' ]) map(lambda (s): install(srcdir('sched',s), dir('bin',s)), [ 'start', 'stop', 'status', 'grep_logs' ]) map(lambda (s): install(srcdir('tools',s), dir('bin',s)), - [ 'boinc_path_config.py', 'create_work', 'add', 'xadd', 'dbcheck_files_exist', 'update_versions', 'upgrade' ]) + [ 'boinc_path_config.py', 'create_work', 'add', 'xadd', 'dbcheck_files_exist', + 'update_versions', 'upgrade', 'parse_config', 'db_query' ]) class Project: diff --git a/tools/db_query b/tools/db_query new file mode 100755 index 0000000000..7934b7ccd5 --- /dev/null +++ b/tools/db_query @@ -0,0 +1,15 @@ +#! /bin/csh + + + +set CIVDATE = `date "+%Y:%m:%d:%H:%M"` + +set UNIXDATE = `perl -e 'print time()'` + +set DBNAME = `./parse_config db_name` + +set COUNT = `echo "use $DBNAME;$1" | mysql | tail -1` + + + +echo $CIVDATE $UNIXDATE $COUNT diff --git a/tools/parse_config b/tools/parse_config new file mode 100755 index 0000000000..7bc0778460 --- /dev/null +++ b/tools/parse_config @@ -0,0 +1,40 @@ +#!/usr/bin/env python + +# -*- mode: python; python-indent: 4; -*- + + + +## $Id$ + + + +''' + + + +A program to pass config file settings to calling programs via stdout + + + +''' + + + +import boinc_path_config +from Boinc import configxml + +import sys, os + + + +program_path = os.path.realpath(os.path.dirname(sys.argv[0])) + +config_filename = os.path.realpath(os.path.join(program_path, '../config.xml')) + + + +config = configxml.ConfigFile(config_filename).read() + + +print config.config.__dict__.get(sys.argv[1]) +