Mercurial > libervia-website
comparison tasks/task_social_contract.py @ 0:09d66acc7c73
initial commit, website first draft:
- presentation page
- documentation (generated from backend and Libervia)
- social contract (HTML generated from sat repository)
- press/conferences (adapted from former website)
- association page (adpated from former website)
- news (a selected blog is displayed)
- fr i18n
author | Goffi <goffi@goffi.org> |
---|---|
date | Sun, 26 May 2019 22:26:30 +0200 |
parents | |
children | 9ce41ef66dfa |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:09d66acc7c73 |
---|---|
1 #!/ur/bin/env python2 | |
2 | |
3 import glob | |
4 import markdown | |
5 import os.path | |
6 from sat.core.i18n import _ | |
7 from sat.core.log import getLogger | |
8 log = getLogger(__name__) | |
9 | |
10 | |
11 def start(self): | |
12 sat_path = self.getConfig("sat_repos_path") | |
13 for filepath in glob.glob(os.path.join(sat_path, "CONTRAT_SOCIAL*")): | |
14 filename = os.path.basename(filepath) | |
15 with open(filepath) as f: | |
16 md = markdown.markdown(f.read().decode('utf-8')) | |
17 build_path = os.path.join(self.build_path, filename + '.html') | |
18 with open(build_path, 'w') as f: | |
19 f.write(md.encode('utf-8')) | |
20 | |
21 log.info(_(u"social contract has been converted to HTML")) |