fix: added python code formatting

This commit is contained in:
DDSRem
2024-12-28 11:25:20 +08:00
parent acf6573ea4
commit 06510c8982
13 changed files with 77 additions and 2 deletions
+2
View File
@@ -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)
+13
View File
@@ -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
View File
@@ -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
View File
@@ -1,3 +1,4 @@
# pylint: disable=C0114
#!/usr/local/bin/python3
import json
+1
View File
@@ -1,3 +1,4 @@
# pylint: disable=C0114
#!/usr/local/bin/python3
import time