started statistics

This commit is contained in:
Trilarion 2017-12-11 12:05:05 +01:00
parent 8f275f5fe8
commit 3cbf42e011
5 changed files with 39 additions and 7 deletions

View File

@ -22,6 +22,8 @@ or fork this repository and submit a pull request.
Help: [MarkDown Help](https://help.github.com/articles/github-flavored-markdown), [Markdown Cheatsheet](https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet)
See also the [statistics](games/statistics.md) page showing interesting infos about code repositories, usage of licenses etc.
## Background
I love open source projects and games and I currently learn about building systems. I see the following benefits of this database

View File

@ -4,13 +4,12 @@
This script runs with Python 3, it could also with Python 2 with some minor tweaks probably, but that's not important.
TODO check for "_{One line description}_" or "- Wikipedia: {URL}" in game files and print warning
TODO print all games without license or code information
TODO for those games with github repositories get activity, number of open issues, number of merge requests and display in a health monitor file
TODO get number of games with github or bitbucket repository and list those who have neither
TODO list those with exotic licenses (not GPL, zlib, MIT, BSD) or without licenses
TODO Which C, C++ projects do not use CMake
TODO list those inactive (sort by year backwards)
TODO for those games with github repositories get activity, number of open issues, number of merge requests and display in a health monitor file
"""
import os
@ -299,6 +298,31 @@ def check_template_leftovers():
if content.find(check_string) >= 0:
print('{}: found {}'.format(os.path.basename(entry_path), check_string))
def generate_statistics():
"""
"""
statistics_path = os.path.join(games_path, 'statistics.md')
statistics = '[comment]: # (autogenerated content, do not edit)\n# Statistics\n\n'
# get category paths
category_paths = get_category_paths()
# for each category
for category_path in category_paths:
# get paths of all entries in this category
entry_paths = get_entry_paths(category_path)
for entry_path in entry_paths:
# read it line by line
with open(entry_path) as f:
content = f.read()
with open(statistics_path, 'w') as f:
f.write(statistics)
if __name__ == "__main__":
# paths
@ -311,8 +335,11 @@ if __name__ == "__main__":
# generate list in toc files
#update_category_tocs()
# generate report
generate_statistics()
# check for unfilled template lines
check_template_leftovers()
# check_template_leftovers()
# check external links (only rarely)
#check_validity_external_links()

View File

@ -5,7 +5,7 @@
- **[Argentum Online](argentum_online.md)** (VB, GPL-2.0, beta, inactive since 2014)
- **[Arx Libertatis](arx_libertatis.md)** (C++, GPL-3.0, mature)
- **[Atrinik](atrinik.md)** (C)
- **[Blades of Exile](blades_of_exile.md)** (C++, GPL-2.0, beta, mature (inactive since))
- **[Blades of Exile](blades_of_exile.md)** (C++, GPL-2.0, mature)
- **[BrowserQuest](browserquest.md)** (Javascript, MPL-2.0, matures)
- **[Catch Challenger](catch_challenger.md)** (C++)
- **[Choria](choria.md)** (C++, C, GPL-3.0)
@ -23,6 +23,7 @@
- **[Fall of Imyrin](fall_of_imiryn.md)** (Python, GPL-3.0, beta, inactive since 2009)
- **[Freedink](freedink.md)** (C++, GPL-3.0)
- **[FreedroidRPG](freedroid.md)** (C, GPL-2.0, mature)
- **[Goblin Hack](goblin_hack.md)** (C++, GPL-2.0, beta, inactive since )
- **[Hero of Allacrost](allacrost.md)** (C++, Lua, GPL-2.0, stable)
- **[Ilarion](ilarion.md)** (C++, Java, Lua, GPL-3.0, mature)
- **[Land of Fire](land_of_fire.md)** ()
@ -46,6 +47,5 @@
- **[VegaTrek](vegatrek.md)** (GPL-2.0, beta, inactive since 2013)
- **[World of Phaos](world_of_phaos.md)** (PHP, GPL-2.0, inactive since 2011)
- **[XU4](xu4.md)** (C++, GPL-2.0, mature)
- **[{NAME}](goblin_hack.md)** (C++, GPL-2.0, beta, inactive since )
[comment]: # (end of autogenerated content)

3
games/statistics.md Normal file
View File

@ -0,0 +1,3 @@
[comment]: # (autogenerated content, do not edit)
# Statistics

View File

@ -15,7 +15,7 @@
- **[FreeRails](freerails.md)** (Java, alpha)
- **[Freeciv](freeciv.md)** (C, GPL-2.0, mature)
- **[Freeciv WebGL](freeciv_web.md)** (Javascript, Java, AGPL-3.0, mature)
- **[Gigalomania](gigalomania.md)** (C++, GPL-2.0, beta, mature (inactive since))
- **[Gigalomania](gigalomania.md)** (C++, GPL-2.0)
- **[Glest](glest.md)** (C++, GPL-2.0, mature, inactive since 2009)
- **[Globulation2](globulation2.md)** (C++, GPL-3.0, mature)
- **[Heroes of Wesnoth](heroes_of_wesnoth.md)** (C++, beta)
@ -36,7 +36,7 @@
- **[TripleA](triplea.md)** (Java, GPL-2.0, mature)
- **[UFO2000](ufo2000.md)** (C++, GPL-2.0)
- **[Ufo: Alien Invasion](ufo_alien_invasion.md)** (C, C++, GPL-2.0, mature)
- **[Unknown Horizons](unknown_horizons.md)** (Python, GPL-2.0, beta, mature (inactive since))
- **[Unknown Horizons](unknown_horizons.md)** (Python, GPL-2.0, beta)
- **[Warzone 2100](warzone_2100.md)** (C++)
- **[Widelands](widelands.md)** (C++, Lua, GPL-2.0, mature)
- **[Xconq](xconq.md)** (GPL, mature)