diff 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
line wrap: on
line diff
--- a/frontend/mfrontend/__init__.py	Tue Feb 22 18:10:18 2011 +0000
+++ b/frontend/mfrontend/__init__.py	Tue Feb 22 18:37:32 2011 +0000
@@ -2,21 +2,21 @@
 # -*- coding: utf-8 -*-
 
 import flask
-import ConfigParser
+from ConfigParser import SafeConfigParser, NoSectionError
 from mfrontend.views.frontend import frontend
 from mfrontend import db, utils
 
 
 #-- konfiguracja
-config = ConfigParser.SafeConfigParser()
-config.read('config.ini')
+config = SafeConfigParser()
 while True:
     try:
+        config.read('config.ini')
         DATABASE = config.get('Basic', 'Database')
         DEBUG = config.getboolean('Basic', 'Debug')
         SECRET_KEY = config.get('Basic', 'Secret_Key')
         break
-    except ConfigParser.NoSectionError:
+    except NoSectionError:
         utils.default_ini()
 #-- koniec konfiguracji