Skip to content

Instantly share code, notes, and snippets.

@Recursing
Created March 30, 2022 12:16
Show Gist options
  • Save Recursing/2fd09e4aa4eeb1b65afa51a94bbcc6b4 to your computer and use it in GitHub Desktop.
Save Recursing/2fd09e4aa4eeb1b65afa51a94bbcc6b4 to your computer and use it in GitHub Desktop.
for path in cwd.rglob("*.py"):
if 'pipstrap' in str(path):
continue
if str(path).count('/dev/') > 1:
continue
text = path.read_text()
if 'analytics_view_id' not in text:
continue
print('replacing in ', path)
for k, v in d.items():
text = text.replace(f"analytics_view_id = '{k}", f"analytics_view_id = '{v}")
path.write_text(text)
print('done', path)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment