From 4e8fa61ec02b6f05134e8b95239d1821a46de57c Mon Sep 17 00:00:00 2001 From: EUcancER Date: Wed, 16 Nov 2011 22:56:47 +0100 Subject: //tightnani-web: add error message: --- punani/tightnani/tightnani-web.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'punani') 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 -- cgit v1.2.3