summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNils Gillmann <ng0@n0.is>2018-08-17 21:00:31 +0000
committerNils Gillmann <ng0@n0.is>2018-08-17 21:00:31 +0000
commit773080555f3273e48f8f66af607e0085ec3abac4 (patch)
tree702c221eafd9e07ac19720e1c4898b2891b1bece
parentf83e9b6d011748429539516ba549507385c73590 (diff)
downloadznc-log-viewer-master.tar
znc-log-viewer-master.tar.gz
Signed-off-by: Nils Gillmann <ng0@n0.is>
-rw-r--r--.gitignore2
-rwxr-xr-xrun.py7
2 files changed, 6 insertions, 3 deletions
diff --git a/.gitignore b/.gitignore
index a348e50..173abc8 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1 +1,3 @@
/__pycache__/
+daftenenv/
+test/ \ No newline at end of file
diff --git a/run.py b/run.py
index 9b9067b..90ecb44 100755
--- a/run.py
+++ b/run.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
from flask import Flask, send_from_directory, render_template, session, abort
from classes import Network, Channel, Log
from urllib.parse import quote_plus
@@ -13,8 +13,9 @@ app.jinja_env.extend(jinja2_highlight_cssclass = 'codehilite')
def get_files(directory):
- files = glob.glob(directory + '/**/*.log', recursive=True)
- files.sort()
+ kfiles = glob.glob(directory + '/**/*.log', recursive=True)
+ kfiles.sort()
+ files = {x.replace(os.getcwd(), '/') for x in kfiles}
return files
@app.route('/')