Mercurial > kraina_muminkow
diff 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 diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/frontend/mfrontend/utils.py Tue Feb 22 18:10:18 2011 +0000 @@ -0,0 +1,16 @@ +#!/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) +