1
|
1 #!/usr/bin/python
|
|
2 # -*- coding: utf-8 -*-
|
|
3
|
|
4 import random
|
|
5
|
|
6 def default_ini():
|
|
7 """Funkcja tworząca domyślny plik .ini z ustawieniami aplikacji"""
|
|
8 config = ConfigParser.SafeConfigParser()
|
|
9 config.add_section('Basic')
|
|
10 config.set('Basic', 'Database', '../baza.sqlite')
|
|
11 config.set('Basic', 'Debug', '0')
|
|
12 config.set('Basic', 'Secret_Key',
|
|
13 ''.join(random.choice(string.ascii_letters for x in range(10))))
|
|
14 with open('config.ini', 'wb') as configfile:
|
|
15 config.write(configfile)
|
|
16
|