-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfix2.py
More file actions
23 lines (19 loc) · 763 Bytes
/
fix2.py
File metadata and controls
23 lines (19 loc) · 763 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
with open('cli/piqrypt_start.py', encoding='utf-8') as f:
content = f.read()
method = ''' def _check_auth_middleware(self):
auth_path = _PACKAGE_ROOT / "auth_middleware.py"
if not auth_path.exists():
auth_path = _LAUNCHER_DIR / "auth_middleware.py"
if not auth_path.exists():
self.errors.append(
f"auth_middleware.py introuvable dans {_PACKAGE_ROOT} ni dans {_LAUNCHER_DIR}. "
"Reinstallez piqrypt : pip install piqrypt --upgrade"
)
'''
content = content.replace(
' def _check_python_version(self):',
method + ' def _check_python_version(self):'
)
with open('cli/piqrypt_start.py', 'w', encoding='utf-8') as f:
f.write(content)
print('done')