aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRunasSudo <runassudo@yingtongli.me>2017-08-20 22:43:51 +1000
committerRunasSudo <runassudo@yingtongli.me>2017-08-20 22:46:59 +1000
commit2785b02eee78cce8e027d389aaa66d265f8006c2 (patch)
tree22d47127917203bd9e5683739213b911e70663da
parentce73df9633417644203dfdcd509dda8b6c1fb85e (diff)
Use relative paths for files
-rw-r--r--.gitignore2
-rw-r--r--pblive/__init__.py4
2 files changed, 3 insertions, 3 deletions
diff --git a/.gitignore b/.gitignore
index c8e795b..0d3188d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,4 +1,4 @@
/data
/venv
__pycache__
-.#*
+.*
diff --git a/pblive/__init__.py b/pblive/__init__.py
index 423ec7a..55469e1 100644
--- a/pblive/__init__.py
+++ b/pblive/__init__.py
@@ -24,7 +24,7 @@ try:
except ImportError:
import data
-import os
+import os, os.path
import random
import socket
import sys
@@ -65,7 +65,7 @@ def session(session_name):
@app.route('/image/<location>')
def image(location):
# TODO: Relative path
- return flask.send_from_directory('/home/runassudo/Documents/pblive/data/img', location)
+ return flask.send_from_directory(os.path.join(os.getcwd(), 'data/img'), location)
@app.route('/admin/session/<session_name>')
def admin_session(session_name):
Contact (issues, pull requests, etc.) at git@yingtongli.me. Generated by cgit.