Commit b4a8d81b authored by alexandre's avatar alexandre
Browse files

Fix #20 Add Python < 3.6 support for rdf_index command

parent 9c6f0962
...@@ -52,16 +52,16 @@ class Command(BaseCommand): ...@@ -52,16 +52,16 @@ class Command(BaseCommand):
c = Client() c = Client()
path = reverse('pad-read', kwargs={'mode': 'r', 'slug': pad.display_slug}) path = reverse('pad-read', kwargs={'mode': 'r', 'slug': pad.display_slug})
response = c.get(path) response = c.get(path)
url = f"http://{domain}{path}" url = "http://{}{}".format(domain, path)
print(f"parsing {url}") print("parsing {}".format(url))
if response.status_code == 200: if response.status_code == 200:
try: try:
app.graph.parse(data=tidy(response.content), format="rdfa", publicID=url) app.graph.parse(data=tidy(response.content), format="rdfa", publicID=url)
except: except:
print(f"couldn't parse {url}") print("couldn't parse {}".format(url))
else: else:
print(f"failed to parse {url}") print("failed to parse {}".format(url))
# for quad in graph.quads(): # for quad in graph.quads():
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment