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

(none)
author michalr
date Tue, 22 Feb 2011 18:10:18 +0000
parents
children e0061735c327
rev   line source
1
michalr
parents:
diff changeset
1 #!/usr/bin/python
michalr
parents:
diff changeset
2 # -*- coding: utf-8 -*-
michalr
parents:
diff changeset
3
michalr
parents:
diff changeset
4 import random
michalr
parents:
diff changeset
5
michalr
parents:
diff changeset
6 def default_ini():
michalr
parents:
diff changeset
7 """Funkcja tworząca domyślny plik .ini z ustawieniami aplikacji"""
michalr
parents:
diff changeset
8 config = ConfigParser.SafeConfigParser()
michalr
parents:
diff changeset
9 config.add_section('Basic')
michalr
parents:
diff changeset
10 config.set('Basic', 'Database', '../baza.sqlite')
michalr
parents:
diff changeset
11 config.set('Basic', 'Debug', '0')
michalr
parents:
diff changeset
12 config.set('Basic', 'Secret_Key',
michalr
parents:
diff changeset
13 ''.join(random.choice(string.ascii_letters for x in range(10))))
michalr
parents:
diff changeset
14 with open('config.ini', 'wb') as configfile:
michalr
parents:
diff changeset
15 config.write(configfile)
michalr
parents:
diff changeset
16