diff options
| author | root <root@kremium> | 2011-12-01 20:59:27 +0100 |
|---|---|---|
| committer | root <root@kremium> | 2011-12-01 20:59:27 +0100 |
| commit | 2d733f93b82a1c11a014af1a3dd07d3540282356 (patch) | |
| tree | ec23111722523ec03ec7d35e708735cf787c6f79 /punani/tightnani/tightnani-web.py | |
| parent | bfa204a580a503a216cedbedd36586fb00458181 (diff) | |
| parent | 4be0c81eafe0f315b91eb13d5d9aa8886faef308 (diff) | |
Merge branch 'master' of http://github.com/krebscode/painload
Diffstat (limited to 'punani/tightnani/tightnani-web.py')
| -rwxr-xr-x | punani/tightnani/tightnani-web.py | 48 |
1 files changed, 0 insertions, 48 deletions
diff --git a/punani/tightnani/tightnani-web.py b/punani/tightnani/tightnani-web.py deleted file mode 100755 index 52f5004f..00000000 --- a/punani/tightnani/tightnani-web.py +++ /dev/null @@ -1,48 +0,0 @@ -#!/usr/bin/python - -import web -import json - -urls = ( - '/', 'Index', - '/dump','Dump', - '/reload','Reload', - '/(.+)/(.+)', 'ArchFinder', -) - - -PDB_FILE="tightnani_db" - -pdb= json.load(open(PDB_FILE)) - -class Index: - def GET(self): - ret = """Welcome to the Tightnani API<br/> -Retrieve a package name for your distribution with: /ARCH/PKG""" - return ret - -class Reload: - def GET(self): - pdb= json.load(open(PDB_FILE)) - return "DB reloaded" - - -class Dump: - def GET(self): - return json.dumps(pdb,sort_keys=True,indent=4) - -class ArchFinder: - def GET(self,packer,package): - if not packer or not package: web.BadRequest() - else: - packer = pdb['packer-symlinks'].get(packer,packer) #try to resolve similar packers - ret = pdb.get(package,{}).get(packer,False) - if not ret: web.NotFound() - else: return ret - - - -if __name__ == "__main__": - app = web.application(urls,globals()) - app.internalerror = web.debugerror - app.run() |
