Did I find the right examples for you? yes no

All Samples(9)  |  Call(5)  |  Derive(0)  |  Import(4)

        def parse_config(config_file=None):
    config = ConfigParser.SafeConfigParser()
    config.add_section(PYANO)
    # fill defaults
    config.set(PYANO,'mixmaster','/usr/bin/mixmaster')
    config.set(PYANO,'remailer_addr','')
    config.set(PYANO,'remailer_mx','localhost')
    config.set(PYANO,'mlist2','')
    config.set(PYANO,'allow_from','')
    config.set(PYANO,'hist_file','')
    config.set(PYANO,'hist_window','15')
    config.set(PYANO,'hist_max_uses','5')
    config.set(PYANO,'banned_file','')
    config.set(PYANO,'chain_max_length','5')
    config.set(PYANO,'max_copies','5')
    config.set(PYANO,'mail_html','')
    config.set(PYANO,'news_html','')
    config.set(PYANO,'block_html','')
    config.set(PYANO,'mail_form_html','')
    config.set(PYANO,'news_form_html','')
    config.set(PYANO,'mail2news','mail2news@dizum.com, mail2news@mixmin.net, mail2news@m2n.mixmin.net, mail2news@reece.net.au, mail2news@tioat.net, '+POST)
    config.set(PYANO,'bad_mail2news','')

    # read config file
    try:
        if config_file != None:
            config.read(config_file)
    except: # Something is wrong with the configuration file
        raise ConfigError('Error parsing configuration file.')

    conf.mixmaster = config.get(PYANO,'mixmaster')
    conf.remailer_addr = config.get(PYANO,'remailer_addr')
    conf.remailer_mx = config.get(PYANO,'remailer_mx')
    conf.mlist2 = config.get(PYANO,'mlist2')
    conf.allow_from = config.get(PYANO,'allow_from')
    conf.hist_file = config.get(PYANO,'hist_file')
    conf.hist_window = config.getint(PYANO,'hist_window')
    conf.hist_max_uses = config.getint(PYANO,'hist_max_uses')
    conf.banned_file = config.get(PYANO,'banned_file')
    conf.chain_max_length = config.getint(PYANO,'chain_max_length')
    conf.max_copies = config.getint(PYANO,'max_copies')
    conf.mail2news = [ gateway.strip() for gateway in config.get(PYANO,'mail2news').split(',')]
    conf.bad_mail2news = config.get(PYANO,'bad_mail2news')
    conf.mail_html = _get_html(config,'mail_html','html/mail.html')
    conf.news_html = _get_html(config,'news_html','html/news.html')
    conf.block_html = _get_html(config,'block_html','html/block.html')
    conf.mail_form_html = _get_html(config,'mail_form_html','html/mail_form.html')
    conf.news_form_html = _get_html(config,'news_form_html','html/news_form.html')
        


src/p/y/pyano-0.6b/pyano/interface.py   pyano(Download)
 
from validate import InputError
from config import ConfigError, conf, parse_config, NONE, RANDOM
from stats import stats, parse_stats, format_stats, uptime_sort
from security import SecurityError, check_ip
            options = req.get_options()
            if 'config_file' in options:
                parse_config( options['config_file'] )
            else:
                parse_config()

src/p/u/purelyjs-0.1.2/purelyjs/main.py   purelyjs(Download)
import optparse
import os
import sys
 
from .config import parse_config
 
    if os.path.exists(CONFIG_FILE):
        interpreters, libs, tests = parse_config(CONFIG_FILE)
 
    if options.interpreter:

src/s/q/squadron-0.5.0/squadron/fileio/tests/test_fileio.py   squadron(Download)
from ..walkhash import walk_hash, hash_diff
from ..config import parse_config
import os
import logging
log = logging.getLogger('normal')
 
    defaults = {'override_this':'/tmp','not_present':'false555'}
    result = parse_config(tmpdir, log, config_file, defaults)
    assert len(result) == 4
    assert 'test' in result

src/s/q/squadron-HEAD/squadron/fileio/tests/test_fileio.py   squadron(Download)
from ..walkhash import walk_hash, hash_diff
from ..config import parse_config
import os
import logging
log = logging.getLogger('normal')
 
    defaults = {'override_this':'/tmp','not_present':'false555'}
    result = parse_config(tmpdir, log, config_file, defaults)
    assert len(result) == 4
    assert 'test' in result