Update app.py
Browse files
app.py
CHANGED
|
@@ -38,6 +38,7 @@ def clone_repo():
|
|
| 38 |
clone_repo()
|
| 39 |
|
| 40 |
#HTMLの自動修正==========================
|
|
|
|
| 41 |
from bs4 import BeautifulSoup
|
| 42 |
|
| 43 |
# index.htmlを読み込む関数
|
|
@@ -73,6 +74,29 @@ def modify_index_html():
|
|
| 73 |
|
| 74 |
# 関数を実行
|
| 75 |
modify_index_html()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 76 |
|
| 77 |
#修正用コードここまで============================
|
| 78 |
|
|
|
|
| 38 |
clone_repo()
|
| 39 |
|
| 40 |
#HTMLの自動修正==========================
|
| 41 |
+
#1
|
| 42 |
from bs4 import BeautifulSoup
|
| 43 |
|
| 44 |
# index.htmlを読み込む関数
|
|
|
|
| 74 |
|
| 75 |
# 関数を実行
|
| 76 |
modify_index_html()
|
| 77 |
+
#=======
|
| 78 |
+
#2
|
| 79 |
+
import re
|
| 80 |
+
|
| 81 |
+
# main.jsファイルのパスを指定
|
| 82 |
+
file_path = 'main.js'
|
| 83 |
+
|
| 84 |
+
# ファイルを読み込んで内容を置換する関数
|
| 85 |
+
def replace_code(file_path):
|
| 86 |
+
with open(file_path, 'r', encoding='utf-8') as file:
|
| 87 |
+
content = file.read()
|
| 88 |
+
|
| 89 |
+
# 置換処理
|
| 90 |
+
new_content = re.sub(r'if\s*\(\s*top\s*!=\s*self\s*\)\s*Game\.ErrorFrame\s*\(\s*\);', 'if (false) Game.ErrorFrame();', content)
|
| 91 |
+
|
| 92 |
+
# ファイルに書き込み
|
| 93 |
+
with open(file_path, 'w', encoding='utf-8') as file:
|
| 94 |
+
file.write(new_content)
|
| 95 |
+
|
| 96 |
+
print("置換が完了しました。")
|
| 97 |
+
|
| 98 |
+
# 関数を実行
|
| 99 |
+
replace_code(file_path)
|
| 100 |
|
| 101 |
#修正用コードここまで============================
|
| 102 |
|