git » blitiri » commit 958d211

Relax config import to make it usable.

author Alberto Bertogli
2007-05-22 05:30:36 UTC
committer Alberto Bertogli
2007-05-22 05:30:36 UTC
parent e08e65182823a7ef54e4c69f054754ad5b424720

Relax config import to make it usable.

The os.path.isfile("config.py") check is too strict: it makes blitiri
usable from the command line only if it's ran in the directory where it
lives.

There's no point in doing that, let's just relax the import.
The chances of a config module collision are too low to be worth the
usability problem.


Signed-off-by: Alberto Bertogli <albertito@gmail.com>

blitiri.cgi +4 -5

diff --git a/blitiri.cgi b/blitiri.cgi
index c43835d..dd87387 100755
--- a/blitiri.cgi
+++ b/blitiri.cgi
@@ -51,11 +51,10 @@ import cgi
 from docutils.core import publish_parts
 
 # Load the config file, if there is one
-if os.path.isfile("config.py"):
-	try:
-		from config import *
-	except:
-		pass
+try:
+	from config import *
+except:
+	pass
 
 
 # Default template