Configuration recommendations

Stuart D. Gathman stuart at bmsi.com
Fri Jun 7 17:57:21 EDT 2002


I have an application - of the background daemon variety - written in
python.  It has some configuration data like the following:

scan_rfc822 = 1
scan_html = 1           # can be CPU intensive
block_chinese = 0
hide_path = ()          # domains that block visible private nodes
#hide_path = ( 'jcpenney.com' )
block_forward = {}      # people that hate forwards
#block_forward = { 'mycorp.com': ('egghead','busybee') }
log_headers = 0
blind_wiretap = 1
wiretap_users = {}
wiretap_dest = None
#wiretap_users = { 'bigcorp.com': ('disloyal', 'bigmouth') }
#wiretap_dest = '<spy at bigcorp.com>'
check_user = {}
#check_user = { 'mycorp.com': ('joe','mary','bill') }
reject_virus_from = ()
#reject_virus_from = ( 'mycorp.com' )

What is standard practice for incorporating such data?  I would like it
to remain executable python code for maximum flexibility (plus I don't
have to deal with parsing or XML). Should the application exec the config
script?  Can this be done so that the module namespace is updated?
Or should the config script be the entry point, setting up the data, then
calling the main application?


-- 
Stuart D. Gathman <stuart at bmsi.com>
Business Management Systems Inc.  Phone: 703 591-0911 Fax: 703 591-6154
"Confutatis maledictis, flamis acribus addictis" - Mozart background
song for the Microsoft "Where do you want to go from here?" commercial.



More information about the Python-list mailing list