mirror of
https://github.com/varun-r-mallya/py-libp2p.git
synced 2026-02-12 16:10:57 +00:00
template cleanup following initial merge with py-evm (#80)
* template cleanup following initial merge with py-evm * add flake8 pin comment * correct license years * add pin note to mypy
This commit is contained in:
@ -7,7 +7,7 @@ from pathlib import Path
|
||||
|
||||
|
||||
def _find_files(project_root):
|
||||
path_exclude_pattern = r"\.git($|\/)|venv|_build|\.tox"
|
||||
path_exclude_pattern = r"\.git($|\/)|venv|_build"
|
||||
file_exclude_pattern = r"fill_template_vars\.py|\.swp$"
|
||||
filepaths = []
|
||||
for dir_path, _dir_names, file_names in os.walk(project_root):
|
||||
@ -22,11 +22,14 @@ def _find_files(project_root):
|
||||
def _replace(pattern, replacement, project_root):
|
||||
print(f"Replacing values: {pattern}")
|
||||
for file in _find_files(project_root):
|
||||
with open(file) as f:
|
||||
content = f.read()
|
||||
content = re.sub(pattern, replacement, content)
|
||||
with open(file, "w") as f:
|
||||
f.write(content)
|
||||
try:
|
||||
with open(file) as f:
|
||||
content = f.read()
|
||||
content = re.sub(pattern, replacement, content)
|
||||
with open(file, "w") as f:
|
||||
f.write(content)
|
||||
except UnicodeDecodeError:
|
||||
pass
|
||||
|
||||
|
||||
def main():
|
||||
|
||||
Reference in New Issue
Block a user