summaryrefslogtreecommitdiff
path: root/kbas
diff options
context:
space:
mode:
authorPaul Sherwood <paul.sherwood@codethink.co.uk>2016-02-08 23:55:29 +0000
committerPaul Sherwood <paul.sherwood@codethink.co.uk>2016-02-09 00:06:22 +0000
commitb312a956b682e19e7bfa2d2cf1e4d4e2b745d568 (patch)
treef7e1952a02cee12eac214d360fe8e7dcaeb521ee /kbas
parentd7b565e7de2ca596d81e8b0da15aae6362a2eac7 (diff)
downloadybd-b312a956b682e19e7bfa2d2cf1e4d4e2b745d568.tar.gz
Hopefully a fix for 'template not found'
Diffstat (limited to 'kbas')
-rwxr-xr-xkbas/__main__.py13
1 files changed, 7 insertions, 6 deletions
diff --git a/kbas/__main__.py b/kbas/__main__.py
index deaa507..7ffca44 100755
--- a/kbas/__main__.py
+++ b/kbas/__main__.py
@@ -66,16 +66,17 @@ class KeyedBinaryArtifactServer(object):
@bottle.get('/<name>')
@bottle.get('/artifacts/<name>')
def list(name=""):
- current_dir = os.getcwd()
- os.chdir(app.config['artifact-dir'])
- names = glob.glob('*' + name + '*')
+ names = glob.glob(os.path.join(app.config['artifact-dir'],
+ '*' + name + '*'))
try:
content = [[strftime('%y-%m-%d', gmtime(os.path.getctime(x))),
- cache.check(x), x] for x in names]
+ cache.check(os.path.basename(x)),
+ os.path.basename(x)] for x in names]
except:
- content = [['--------', cache.check(x), x] for x in names]
+ content = [['--------',
+ cache.check(os.path.basename(x)),
+ os.path.basename(x)] for x in names]
- os.chdir(current_dir)
return template('kbas',
title='Available Artifacts:',
content=reversed(sorted(content)),