1 Star 0 Fork 0

kkk913/shuffle-apps

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
fix_async.py 1.02 KB
一键复制 编辑 原始数据 按行查看 历史
import os
basedir = "."
folders = os.listdir(basedir)
for folder in folders:
try:
subfolders = os.listdir(f"{basedir}/{folder}")
except:
continue
for subfolder in subfolders:
filename = f"{basedir}/{folder}/{subfolder}/src/app.py"
data = ""
try:
with open(f"{filename}", "r") as tmp:
data = tmp.read()
data = data.replace("async def", "def", -1)
data = data.replace("await ", "", -1)
data = data.replace("asyncio.run(", "", -1)
data = data.replace(", debug=True)", "", -1)
data = data.replace(", debug=False)", "", -1)
data = data.replace(",debug=True)", "", -1)
data = data.replace(",debug=False)", "", -1)
if len(data) > 0:
with open(f"{filename}", "w+") as tmp:
tmp.write(data)
print("Fixed: %s" % filename)
except:
print("Skipped: %s" % filename)
#break
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/dkori/shuffle-apps.git
[email protected]:dkori/shuffle-apps.git
dkori
shuffle-apps
shuffle-apps
master

搜索帮助