From 4bd815b87f8ec672a7dc71cd99b42d10ee2a8956 Mon Sep 17 00:00:00 2001 From: Zbigniew Jędrzejewski-Szmek Date: Nov 05 2017 20:14:10 +0000 Subject: Add intro --- diff --git a/analyze-protections.py b/analyze-protections.py index 1df8fe7..492b1ea 100755 --- a/analyze-protections.py +++ b/analyze-protections.py @@ -25,6 +25,14 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. +r"""analyze-protections.py + +Usage: +$ dnf install $(dnf repoquery --qf=%{name} -f '/usr/lib/systemd/system/*service'|grep -vE 'mesos|babeld|community-mysql-server|vdsm|cri-o|abrt-atomic|openerp$|^systemd|quagga|yum|inn|origin|pungi|odcs'|sort -u) --exclude python-fmn-consumer --exclude pungi --exclude yum-utils -y + +$ ./analyze-protections.py /usr/lib/systemd/system/*.service +""" + import argparse import collections import pathlib @@ -34,6 +42,18 @@ import subprocess import lxml from lxml.html import builder +INTRO = '''\ +

This is the rough status of all .service unit files in Fedora. + Type=oneshot and Type=idle are excluded from the analysis. +

The source code to generat this page is at + + https://pagure.io/analyze-protections. + Pull requests welcome. +

Note: this is a work in progress. +

+ https://in.waw.pl/~zbyszek/fedora/protections/protections.html +''' + CSS = '''\ .error { color: red; @@ -280,7 +300,8 @@ if __name__ == '__main__': else: title = "Status of systemd unit protections" body = builder.BODY( - builder.H1(builder.CLASS("heading"), title)) + builder.H1(builder.CLASS("heading"), title), + lxml.html.fromstring(INTRO)) html = builder.HTML( builder.HEAD( builder.LINK(rel="stylesheet", href="style.css", type="text/css"), @@ -307,8 +328,8 @@ if __name__ == '__main__': if html is not None: div = builder.DIV() div2 = builder.DIV() - body.insert(1, div) - body.insert(2, div2) + body.insert(2, div) + body.insert(3, div2) else: div = div2 = None report_counter('Type=', Types, n, html=div)