Skip to content

Instantly share code, notes, and snippets.

@SphinxKnight
Created October 27, 2021 06:28
Show Gist options
  • Save SphinxKnight/15356658bef60d5f3a64409b387ff180 to your computer and use it in GitHub Desktop.
Save SphinxKnight/15356658bef60d5f3a64409b387ff180 to your computer and use it in GitHub Desktop.
Python helper script
import os
import urllib.request
locale = 'ru'
path = './files/' + locale + '/'
urls = []
for r, d, f in os.walk(path):
for file in f:
if '.md' in file or '.html' in file:
full_path = os.path.join(r, file)
url = "http://localhost:5000/" + locale + "/docs/" + urllib.parse.quote(full_path.replace(path,"").replace("/" + file,"")).replace("%40","@").replace("%2C",",")
urls.append(url)
for url in urls:
try:
contents = urllib.request.urlopen(url).read()
if("MacroLiveSampleError".encode("utf-8") in contents):
print(url)
except:
print("Error with " + url)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment