X7ROOT File Manager
Current Path:
/opt/gsutil/third_party/charset_normalizer/bin
opt
/
gsutil
/
third_party
/
charset_normalizer
/
bin
/
π
..
π
bc.py
(3.02 KB)
π
coverage.py
(2.84 KB)
π
integration.py
(1.48 KB)
π
performance.py
(5.42 KB)
π
run_autofix.sh
(234 B)
π
run_checks.sh
(348 B)
π
serve.py
(1.07 KB)
Editing: serve.py
from flask import Flask, jsonify, send_from_directory from glob import glob app = Flask(__name__) @app.route('/raw/<path:path>') def read_file(path): return send_from_directory('../char-dataset', path, as_attachment=True), 200, {"Content-Type": "text/plain"} @app.route("/") def read_targets(): return jsonify( [ el.replace("./char-dataset", "/raw").replace("\\", "/") for el in sorted(glob("./char-dataset/**/*")) ] ) @app.route("/edge/empty/plain") def read_empty_response_plain(): return b"", 200, {"Content-Type": "text/plain"} @app.route("/edge/empty/json") def read_empty_response_json(): return b"{}", 200, {"Content-Type": "application/json"} @app.route("/edge/gb18030/json") def read_gb18030_response_json(): return '{"abc": "ζ沑ζεζ¨οΌη£η £ηεͺζ―δΈδΊζΆι΄γγδ»θ§δΏε£«δΉθ«δΉοΌδ»₯ζθεΎ·οΌδ»₯δ½ε½θ³’οΌθ²ε―θ¬εΎθ«δΉδΈι«η£οΌθζͺη²θ³θ«δΉζ·ηδΉγ"}'.encode("gb18030"), 200, {"Content-Type": "application/json"} if __name__ == "__main__": app.run(host="127.0.0.1", port=8080)
Upload File
Create Folder