Fix, only parse valid JSON files
This commit is contained in:
@@ -15,10 +15,11 @@ templates = []
|
|||||||
for file in files:
|
for file in files:
|
||||||
# Open the file
|
# Open the file
|
||||||
with open(templates_src_dir + file) as f:
|
with open(templates_src_dir + file) as f:
|
||||||
# Load the JSON into a variable
|
if file.endswith('.json'):
|
||||||
data = json.load(f)['templates']
|
# Load the JSON into a variable
|
||||||
# Append the template object to the templates list
|
data = json.load(f)['templates']
|
||||||
templates = templates + data
|
# Append the template object to the templates list
|
||||||
|
templates = templates + data
|
||||||
|
|
||||||
# Remove duplicates
|
# Remove duplicates
|
||||||
seen_titles = set()
|
seen_titles = set()
|
||||||
|
|||||||
Reference in New Issue
Block a user