mirror of
https://github.com/xiaoyaDev/xiaoya-alist.git
synced 2026-10-16 21:50:48 +08:00
fix: added python code formatting
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
# pylint: disable=C0103
|
||||
# pylint: disable=C0114
|
||||
#!/usr/local/bin/python3
|
||||
|
||||
__author__ = "ChenyangGao <https://chenyanggao.github.io>"
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
# pylint: disable=C0114
|
||||
#!/usr/local/bin/python3
|
||||
|
||||
import time
|
||||
@@ -99,16 +100,25 @@ def poll_qrcode_status(data, log_print):
|
||||
|
||||
@app.route("/")
|
||||
def index():
|
||||
"""
|
||||
网页扫码首页
|
||||
"""
|
||||
return render_template('index.html')
|
||||
|
||||
|
||||
@app.route('/image')
|
||||
def serve_image():
|
||||
"""
|
||||
获取二维码图片
|
||||
"""
|
||||
return send_file(QRCODE_DIR, mimetype='image/png')
|
||||
|
||||
|
||||
@app.route('/status')
|
||||
def status():
|
||||
"""
|
||||
扫码状态获取
|
||||
"""
|
||||
if LAST_STATUS == 1:
|
||||
return jsonify({'status': 'success'})
|
||||
elif LAST_STATUS == 2:
|
||||
@@ -119,6 +129,9 @@ def status():
|
||||
|
||||
@app.route('/shutdown_server', methods=['GET'])
|
||||
def shutdown():
|
||||
"""
|
||||
退出进程
|
||||
"""
|
||||
if os.path.isfile(QRCODE_DIR):
|
||||
os.remove(QRCODE_DIR)
|
||||
os._exit(0)
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
# pylint: disable=C0114
|
||||
#!/usr/local/bin/python3
|
||||
|
||||
import time
|
||||
@@ -65,16 +66,25 @@ def poll_qrcode_status(data, log_print):
|
||||
|
||||
@app.route("/")
|
||||
def index():
|
||||
"""
|
||||
网页扫码首页
|
||||
"""
|
||||
return render_template('index.html')
|
||||
|
||||
|
||||
@app.route('/image')
|
||||
def serve_image():
|
||||
"""
|
||||
获取二维码图片
|
||||
"""
|
||||
return send_file(QRCODE_DIR, mimetype='image/png')
|
||||
|
||||
|
||||
@app.route('/status')
|
||||
def status():
|
||||
"""
|
||||
扫码状态获取
|
||||
"""
|
||||
if LAST_STATUS == 1:
|
||||
return jsonify({'status': 'success'})
|
||||
elif LAST_STATUS == 2:
|
||||
@@ -85,6 +95,9 @@ def status():
|
||||
|
||||
@app.route('/shutdown_server', methods=['GET'])
|
||||
def shutdown():
|
||||
"""
|
||||
退出进程
|
||||
"""
|
||||
if os.path.isfile(QRCODE_DIR):
|
||||
os.remove(QRCODE_DIR)
|
||||
os._exit(0)
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
# pylint: disable=C0114
|
||||
#!/usr/local/bin/python3
|
||||
|
||||
import json
|
||||
@@ -71,16 +72,25 @@ def poll_qrcode_status(_data, log_print):
|
||||
|
||||
@app.route("/")
|
||||
def index():
|
||||
"""
|
||||
网页扫码首页
|
||||
"""
|
||||
return render_template('index.html')
|
||||
|
||||
|
||||
@app.route('/image')
|
||||
def serve_image():
|
||||
"""
|
||||
获取二维码图片
|
||||
"""
|
||||
return send_file(QRCODE_DIR, mimetype='image/png')
|
||||
|
||||
|
||||
@app.route('/status')
|
||||
def status():
|
||||
"""
|
||||
扫码状态获取
|
||||
"""
|
||||
if LAST_STATUS == 1:
|
||||
return jsonify({'status': 'success'})
|
||||
elif LAST_STATUS == 2:
|
||||
@@ -91,6 +101,9 @@ def status():
|
||||
|
||||
@app.route('/shutdown_server', methods=['GET'])
|
||||
def shutdown():
|
||||
"""
|
||||
退出进程
|
||||
"""
|
||||
if os.path.isfile(QRCODE_DIR):
|
||||
os.remove(QRCODE_DIR)
|
||||
os._exit(0)
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
# pylint: disable=C0114
|
||||
#!/usr/local/bin/python3
|
||||
|
||||
import json
|
||||
@@ -54,16 +55,25 @@ def poll_qrcode_status(_data, log_print):
|
||||
|
||||
@app.route("/")
|
||||
def index():
|
||||
"""
|
||||
网页扫码首页
|
||||
"""
|
||||
return render_template('index.html')
|
||||
|
||||
|
||||
@app.route('/image')
|
||||
def serve_image():
|
||||
"""
|
||||
获取二维码图片
|
||||
"""
|
||||
return send_file(QRCODE_DIR, mimetype='image/png')
|
||||
|
||||
|
||||
@app.route('/status')
|
||||
def status():
|
||||
"""
|
||||
扫码状态获取
|
||||
"""
|
||||
if LAST_STATUS == 1:
|
||||
return jsonify({'status': 'success'})
|
||||
elif LAST_STATUS == 2:
|
||||
@@ -74,6 +84,9 @@ def status():
|
||||
|
||||
@app.route('/shutdown_server', methods=['GET'])
|
||||
def shutdown():
|
||||
"""
|
||||
退出进程
|
||||
"""
|
||||
if os.path.isfile(QRCODE_DIR):
|
||||
os.remove(QRCODE_DIR)
|
||||
os._exit(0)
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
# pylint: disable=C0114
|
||||
#!/usr/local/bin/python3
|
||||
|
||||
import json
|
||||
@@ -57,16 +58,25 @@ def poll_qrcode_status(_data, log_print):
|
||||
|
||||
@app.route("/")
|
||||
def index():
|
||||
"""
|
||||
网页扫码首页
|
||||
"""
|
||||
return render_template('index.html')
|
||||
|
||||
|
||||
@app.route('/image')
|
||||
def serve_image():
|
||||
"""
|
||||
获取二维码图片
|
||||
"""
|
||||
return send_file(QRCODE_DIR, mimetype='image/png')
|
||||
|
||||
|
||||
@app.route('/status')
|
||||
def status():
|
||||
"""
|
||||
扫码状态获取
|
||||
"""
|
||||
if LAST_STATUS == 1:
|
||||
return jsonify({'status': 'success'})
|
||||
elif LAST_STATUS == 2:
|
||||
@@ -77,6 +87,9 @@ def status():
|
||||
|
||||
@app.route('/shutdown_server', methods=['GET'])
|
||||
def shutdown():
|
||||
"""
|
||||
退出进程
|
||||
"""
|
||||
if os.path.isfile(QRCODE_DIR):
|
||||
os.remove(QRCODE_DIR)
|
||||
os._exit(0)
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
# pylint: disable=C0114
|
||||
#!/usr/local/bin/python3
|
||||
|
||||
import time
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
# pylint: disable=C0114
|
||||
#!/usr/local/bin/python3
|
||||
|
||||
import os
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
# pylint: disable=C0114
|
||||
#!/usr/local/bin/python3
|
||||
|
||||
import json
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
# pylint: disable=C0114
|
||||
#!/usr/local/bin/python3
|
||||
|
||||
import time
|
||||
|
||||
Reference in New Issue
Block a user