comparison frontend/mfrontend/__init__.py @ 2:e0061735c327

Usunąłem nieskończoną pętlę
author michalr
date Tue, 22 Feb 2011 18:37:32 +0000
parents c3fb1e9fc1f7
children 9a0a9fa7f91d
comparison
equal deleted inserted replaced
1:c3fb1e9fc1f7 2:e0061735c327
1 #!/usr/bin/python 1 #!/usr/bin/python
2 # -*- coding: utf-8 -*- 2 # -*- coding: utf-8 -*-
3 3
4 import flask 4 import flask
5 import ConfigParser 5 from ConfigParser import SafeConfigParser, NoSectionError
6 from mfrontend.views.frontend import frontend 6 from mfrontend.views.frontend import frontend
7 from mfrontend import db, utils 7 from mfrontend import db, utils
8 8
9 9
10 #-- konfiguracja 10 #-- konfiguracja
11 config = ConfigParser.SafeConfigParser() 11 config = SafeConfigParser()
12 config.read('config.ini')
13 while True: 12 while True:
14 try: 13 try:
14 config.read('config.ini')
15 DATABASE = config.get('Basic', 'Database') 15 DATABASE = config.get('Basic', 'Database')
16 DEBUG = config.getboolean('Basic', 'Debug') 16 DEBUG = config.getboolean('Basic', 'Debug')
17 SECRET_KEY = config.get('Basic', 'Secret_Key') 17 SECRET_KEY = config.get('Basic', 'Secret_Key')
18 break 18 break
19 except ConfigParser.NoSectionError: 19 except NoSectionError:
20 utils.default_ini() 20 utils.default_ini()
21 #-- koniec konfiguracji 21 #-- koniec konfiguracji
22 22
23 app = flask.Flask(__name__) 23 app = flask.Flask(__name__)
24 app.register_module(frontend) 24 app.register_module(frontend)