Skip to content

Commit 48ae952

Browse files
committed
fix import scripts
1 parent 126ca7d commit 48ae952

File tree

4 files changed

+10
-6
lines changed

4 files changed

+10
-6
lines changed

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ EXPOSE 5555
77
ENV UWSGI_INI uwsgi.ini
88

99
# Set the folder where uwsgi looks for the app
10-
WORKDIR /paws-data-pipeline
10+
WORKDIR /paws-data-pipeline/
1111

1212
# Copy the app contents to the image
13-
COPY . /paws-data-pipeline
13+
COPY . /paws-data-pipeline/
1414

1515
RUN chmod 777 /paws-data-pipeline
1616

run_local.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ run:
88

99
API:
1010
run http GET request like:
11-
- http://localhost:5555
11+
- http://localhost:5555/listFiles
1212
- http://localhost:5555/file/{fileName}
1313
- http://localhost:5555/executeScript/{scriptName}
1414
- http://localhost:5555/allFiles

src/api_server/api_app.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,13 @@
22
import flask
33
from flask import send_file
44
import shutil
5+
import sys
56

6-
from ..scripts import sample_script
7+
# get scripts folder to relative path
8+
sys.path.append(os.path.join(os.path.dirname(__file__), '..'))
9+
from scripts import sample_script
710

11+
sys.path.insert(1, '../scripts')
812
dir_path = os.path.dirname(os.path.realpath(__file__))
913

1014
SCRIPT_PATH = dir_path + '/../scripts'

src/scripts/sample_script.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
def run():
2-
f = open('test.txt', 'w')
3-
f.write('test script')
2+
f = open('../api_server/test.txt', 'w')
3+
f.write('test script')

0 commit comments

Comments
 (0)