Skip to content

Commit 09ce8bc

Browse files
authored
Merge pull request #1204 from holta/roles-needing-docs
Tweaks to roles-needing-docs.py & unmaintained-roles.txt
2 parents 9765963 + 7a890fd commit 09ce8bc

File tree

3 files changed

+32
-30
lines changed

3 files changed

+32
-30
lines changed

scripts/roles-needing-docs.py

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#!/usr/bin/env python3
2+
3+
'''
4+
This script checks every role in the (Internet-in-a-Box) project and prints its
5+
name to stdout if (1) the role directory does not contain a README file, and
6+
(2) the role is not listed in /opt/iiab/iiab/unmaintained-roles.txt
7+
8+
For ease of use, you can pipe the output of this script to a file or to a
9+
clipboard utility (e.g. pbcopy on macOS, xclip on Linux).
10+
'''
11+
12+
import os
13+
from os.path import join as make_path
14+
from glob import glob
15+
16+
def included_roles():
17+
all_roles = set(os.listdir("/opt/iiab/iiab/roles"))
18+
excluded_roles = \
19+
map(str.rstrip,
20+
open(make_path("/opt/iiab/iiab/scripts",
21+
"/opt/iiab/iiab/unmaintained-roles.txt")))
22+
included_roles = list(all_roles.difference(excluded_roles))
23+
included_roles.sort()
24+
return included_roles
25+
26+
for role in included_roles():
27+
readme = make_path("/opt/iiab/iiab/roles", role, "README.*")
28+
if not glob(readme):
29+
print(role)

scripts/roles_needing_docs.py

Lines changed: 0 additions & 27 deletions
This file was deleted.
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1+
ajenti
12
authserver
23
debian_schooltool
4+
docker
35
ejabberd_xs
46
idmgr
5-
ajenti
67
moodle-1.9
8+
nodogsplash
79
pathagar
810
schooltool
9-
nodogsplash
10-
docker
1111
sugar-stats

0 commit comments

Comments
 (0)