Update app.py
Browse files
app.py
CHANGED
@@ -75,28 +75,7 @@ def modify_index_html():
|
|
75 |
# 関数を実行
|
76 |
modify_index_html()
|
77 |
#=======
|
78 |
-
#2
|
79 |
-
import re
|
80 |
|
81 |
-
# main.jsファイルのパスを指定
|
82 |
-
file_path = '/cookieclicker_repo/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 |
|
|
|
75 |
# 関数を実行
|
76 |
modify_index_html()
|
77 |
#=======
|
|
|
|
|
78 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
79 |
|
80 |
#修正用コードここまで============================
|
81 |
|