From 7ad97251669963ec81eb9e808e9a8890939a1b1a Mon Sep 17 00:00:00 2001 From: emkael Date: Tue, 4 Jul 2017 15:54:31 +0200 Subject: Generating static content from common page template --- static.py | 13 +++++++++++++ static/metoda.html | 44 ++++++++++++++++++++++++++++++++++++++++++++ static/ranking.html | 15 +++++++++++++++ templates/static.html | 33 +++++++++++++++++++++++++++++++++ 4 files changed, 105 insertions(+) create mode 100644 static.py create mode 100644 static/metoda.html create mode 100644 static/ranking.html create mode 100644 templates/static.html diff --git a/static.py b/static.py new file mode 100644 index 0000000..3168843 --- /dev/null +++ b/static.py @@ -0,0 +1,13 @@ +import os, sys +from bs4 import BeautifulSoup as bs4 + +content_file = sys.argv[1] +page_header = sys.argv[2] if len(sys.argv) > 2 else '' + +template = bs4(file('templates/static.html'), 'lxml') +template.select('h2 small')[0].string = page_header +template.find('div', {'id': 'content'}).append( + bs4(file(content_file).read(), 'lxml') +) + +print template.prettify().encode('utf-8') diff --git a/static/metoda.html b/static/metoda.html new file mode 100644 index 0000000..263870c --- /dev/null +++ b/static/metoda.html @@ -0,0 +1,44 @@ +

PKL regionalne

+ +

PKL ogólnopolskie i międzynarodowe

+ +

aPKL

+ +

PM i MPM

+ +

+ Dla zwiększenia czytelności wynik podzielony jest przez 100. +

diff --git a/static/ranking.html b/static/ranking.html new file mode 100644 index 0000000..5cbea23 --- /dev/null +++ b/static/ranking.html @@ -0,0 +1,15 @@ +
+ Ranking - klasyfikacja wartościująca wg ustalonych kryteriów +
+

+ Ranking powstał na bazie zdobytych przez zawodnika PKL, wykorzystując ich różnorodność w bazie CEZaR – PKL regionalne, PKL ogólnopolskie, PKL międzynarodowe, aPKL, PM, MPM. +

+

+ Została ustalona hierarchia zdobywanych PKL i stopniowo cofając się w latach odrzucano część zdobytych przez zawodników punktów. +

+

+ Ranking ma określać aktualną siłę gry zawodników i powinien stanowić podstawę do rozstawiania w turniejach. +

+

+ Będzie ogłaszany cztery razy w roku – na początku każdego kwartału i przez trzy miesiące będzie statyczny. Oprócz klasyfikacji ogólnej pojawią się klasyfikacje szczegółowe: kobiet, juniorów, seniorów, nestorów, wojewódzkie itp. +

diff --git a/templates/static.html b/templates/static.html new file mode 100644 index 0000000..4fbb455 --- /dev/null +++ b/templates/static.html @@ -0,0 +1,33 @@ + + + + + Oficjalny Ranking Brydżowy PZBS + + + + + +
+
+
+ +
+
+
+
+
+ © 2017 - dla PZBS zrobił mkl. + Też sobie zrób. + Dane w CSV tu. +
+
+ + -- cgit v1.2.3