view frontend/mfrontend/utils.py @ 1:c3fb1e9fc1f7

(none)
author michalr
date Tue, 22 Feb 2011 18:10:18 +0000
parents
children e0061735c327
line wrap: on
line source

#!/usr/bin/python
# -*- coding: utf-8 -*-

import random

def default_ini():
    """Funkcja tworząca domyślny plik .ini z ustawieniami aplikacji"""
    config = ConfigParser.SafeConfigParser()
    config.add_section('Basic')
    config.set('Basic', 'Database', '../baza.sqlite')
    config.set('Basic', 'Debug', '0')
    config.set('Basic', 'Secret_Key',
               ''.join(random.choice(string.ascii_letters for x in range(10))))
    with open('config.ini', 'wb') as configfile:
        config.write(configfile)