forked from swee/MeowNex
fix paths
This commit is contained in:
parent
209c87c29f
commit
0adfe7fcb9
2 changed files with 6 additions and 4 deletions
|
@ -3,6 +3,7 @@ from flask import send_file
|
||||||
from flask import request
|
from flask import request
|
||||||
from flask import redirect
|
from flask import redirect
|
||||||
import os
|
import os
|
||||||
|
from pathlib import Path
|
||||||
from time import sleep as wait
|
from time import sleep as wait
|
||||||
app = Flask(__name__)
|
app = Flask(__name__)
|
||||||
|
|
||||||
|
@ -12,11 +13,11 @@ def index():
|
||||||
@app.route('/run.txt')
|
@app.route('/run.txt')
|
||||||
def run():
|
def run():
|
||||||
wait(2)
|
wait(2)
|
||||||
return send_file("run.txt", mimetype='text/html')
|
return send_file(str(Path.home()) + "/run.txt", mimetype='text/html')
|
||||||
@app.route('/block.txt')
|
@app.route('/block.txt')
|
||||||
def block():
|
def block():
|
||||||
wait(2)
|
wait(2)
|
||||||
return send_file("block.txt", mimetype='text/html')
|
return send_file(str(Path.home()) + "/block.txt", mimetype='text/html')
|
||||||
@app.route('/script.js')
|
@app.route('/script.js')
|
||||||
def script():
|
def script():
|
||||||
return send_file("script.js", mimetype='application/javascript')
|
return send_file("script.js", mimetype='application/javascript')
|
||||||
|
|
|
@ -9,6 +9,7 @@ import re
|
||||||
from random import choice, randint as random
|
from random import choice, randint as random
|
||||||
import traceback
|
import traceback
|
||||||
import threading
|
import threading
|
||||||
|
from pathlib import Path
|
||||||
class config:
|
class config:
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.conn = sqlite3.connect(environ["SBconfig"])
|
self.conn = sqlite3.connect(environ["SBconfig"])
|
||||||
|
@ -147,8 +148,8 @@ block = 0
|
||||||
global times
|
global times
|
||||||
times = 0
|
times = 0
|
||||||
def update():
|
def update():
|
||||||
open("/home/swee/run.txt", 'w').write(str(run))
|
open(str(Path.home()) + "/run.txt", 'w').write(str(run))
|
||||||
open("/home/swee/block.txt", 'w').write(str(block))
|
open(str(Path.home()) + "/block.txt", 'w').write(str(block))
|
||||||
|
|
||||||
update()
|
update()
|
||||||
def irci2():
|
def irci2():
|
||||||
|
|
Loading…
Reference in a new issue