mirror of
https://github.com/open-goal/jak-project.git
synced 2024-10-20 00:57:44 -04:00
7117a512c7
* docs: refresh the homepage * docs: basic gallery support added * homepage background image back to jpg * docs: remove data file tracker, as it's soon to be removed
36 lines
925 B
Python
36 lines
925 B
Python
import glob
|
|
|
|
src_files = glob.glob("./goal_src/**/*.g[cs]", recursive=True)
|
|
|
|
# Find how many of each have been started
|
|
|
|
src_files_started = 0
|
|
src_files_finished = 0
|
|
data_files_started = 0
|
|
|
|
for f in src_files:
|
|
with open(f, "r") as temp_file:
|
|
lines = temp_file.readlines()
|
|
line_count = len(lines)
|
|
if line_count > 7:
|
|
# Check to see if there are any TODOs
|
|
if any("TODO" in string for string in lines):
|
|
src_files_finished = src_files_finished + 1
|
|
else:
|
|
src_files_started = src_files_started + 1
|
|
|
|
import json
|
|
with open('./docs/gh-pages-proj/src/config/progress.json', 'r+', encoding='utf-8') as f:
|
|
data = {
|
|
'jak1': {
|
|
'fileProgress': {
|
|
'src_files_total': len(src_files),
|
|
'src_files_finished': src_files_finished,
|
|
'src_files_started': src_files_started
|
|
}
|
|
}
|
|
}
|
|
f.seek(0)
|
|
json.dump(data, f, ensure_ascii=False, indent=2)
|
|
f.truncate()
|