summaryrefslogtreecommitdiffstats
path: root/punani
diff options
context:
space:
mode:
authorEUcancER <root@euer.krebsco.de>2011-11-16 22:56:47 +0100
committerEUcancER <root@euer.krebsco.de>2011-11-16 22:56:47 +0100
commit4e8fa61ec02b6f05134e8b95239d1821a46de57c (patch)
tree4c98bf52e63c2003b6ac280884371848cad4cff2 /punani
parent1b0c87879d80fd7e70edb10a93b6010a014bbd15 (diff)
//tightnani-web: add error message:
Diffstat (limited to 'punani')
-rwxr-xr-xpunani/tightnani/tightnani-web.py13
1 files changed, 9 insertions, 4 deletions
diff --git a/punani/tightnani/tightnani-web.py b/punani/tightnani/tightnani-web.py
index 4386bbae..4e6a64a4 100755
--- a/punani/tightnani/tightnani-web.py
+++ b/punani/tightnani/tightnani-web.py
@@ -12,8 +12,9 @@ urls = (
PDB_FILE="tightnani_db"
-
-pdb= json.load(open(PDB_FILE))
+f = open(PDB_FILE)
+pdb= json.load(f)
+f.close()
class Index:
def GET(self):
@@ -23,7 +24,9 @@ Retrieve a package name for your distribution with: /PACKER/PKG"""
class Reload:
def GET(self):
- pdb= json.load(open(PDB_FILE))
+ f = open(PDB_FILE)
+ pdb= json.load(f)
+ f.close()
return "DB reloaded"
@@ -40,7 +43,9 @@ class ArchFinder:
ret = pdb.get(package,{}).get(packer,False)
ret = ret if ret else pdb.get(package,{}).get(super_packer,False)
- if not ret: web.NotFound()
+ if not ret:
+ web.NotFound()
+ return "not found. i'm so sorry :("
else: return ret