Added update script
This commit is contained in:
@@ -21,8 +21,6 @@ for index in indices:
|
||||
count = int(count_regex.match(item.text).group(1))
|
||||
|
||||
tags[tag] = count
|
||||
|
||||
break
|
||||
|
||||
tag_regex = re.compile(r".+:(.+)$")
|
||||
def clean(tag):
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
import json
|
||||
import sys
|
||||
|
||||
tags = {tag: u'' for tag in json.loads(''.join(sys.stdin.readlines()))}
|
||||
|
||||
try:
|
||||
with open(sys.argv[1], encoding='utf-8') as f:
|
||||
lang = json.load(f)
|
||||
except:
|
||||
lang = dict()
|
||||
|
||||
for tag in tags:
|
||||
if tag in lang and lang[tag]:
|
||||
tags[tag] = lang[tag]
|
||||
|
||||
with open(sys.argv[1], 'w', encoding='utf-8') as f:
|
||||
json.dump(tags, f, indent=4, ensure_ascii=False)
|
||||
@@ -0,0 +1,13 @@
|
||||
#!/bin/bash
|
||||
|
||||
TAGS_PYTHON=/home/tom5079/.virtualenvs/tags/bin/python
|
||||
TAGS_FOLDER=/mnt/d/Workspace/Pupil-gh-pages
|
||||
|
||||
$TAGS_PYTHON -m pip install -r $TAGS_FOLDER/scripts/requirements.txt > NUL
|
||||
|
||||
tags=$($TAGS_PYTHON $TAGS_FOLDER/scripts/tags.py)
|
||||
|
||||
for file in "$(ls $TAGS_FOLDER/*.json)"
|
||||
do
|
||||
echo "$tags" | $TAGS_PYTHON $TAGS_FOLDER/scripts/update.py $file
|
||||
done
|
||||
@@ -0,0 +1 @@
|
||||
{}
|
||||
Reference in New Issue
Block a user