# HG changeset patch # User souliane # Date 1432765982 -7200 # Node ID 2ff373d2571a80bb6edaee1c8af149078907a0cb # Parent 459795d1ab312bad654c4d2943290f12858708a3 add decentralisation schemas + script for listing the plugins diff -r 459795d1ab31 -r 2ff373d2571a schemas/decentralisation/1_physical.dia Binary file schemas/decentralisation/1_physical.dia has changed diff -r 459795d1ab31 -r 2ff373d2571a schemas/decentralisation/1_physical.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/schemas/decentralisation/1_physical.svg Thu May 28 00:33:02 2015 +0200 @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Internet user (client) + + + Internet service provider (server) + + + client-to-server physical link + + + server-to-server physical link + + + + + diff -r 459795d1ab31 -r 2ff373d2571a schemas/decentralisation/2_logical_centralised.dia Binary file schemas/decentralisation/2_logical_centralised.dia has changed diff -r 459795d1ab31 -r 2ff373d2571a schemas/decentralisation/2_logical_centralised.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/schemas/decentralisation/2_logical_centralised.svg Thu May 28 00:33:02 2015 +0200 @@ -0,0 +1,126 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + client-to-server logical link (centralised) + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 459795d1ab31 -r 2ff373d2571a schemas/decentralisation/3_logical_decentralised.dia Binary file schemas/decentralisation/3_logical_decentralised.dia has changed diff -r 459795d1ab31 -r 2ff373d2571a schemas/decentralisation/3_logical_decentralised.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/schemas/decentralisation/3_logical_decentralised.svg Thu May 28 00:33:02 2015 +0200 @@ -0,0 +1,147 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + client-to-server logical link (decentralised) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + server-to-server logical link (decentralised) + + + + + + + + + + + + + + + + + diff -r 459795d1ab31 -r 2ff373d2571a schemas/decentralisation/4_logical_decentralised_self_hosting.dia Binary file schemas/decentralisation/4_logical_decentralised_self_hosting.dia has changed diff -r 459795d1ab31 -r 2ff373d2571a schemas/decentralisation/4_logical_decentralised_self_hosting.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/schemas/decentralisation/4_logical_decentralised_self_hosting.svg Thu May 28 00:33:02 2015 +0200 @@ -0,0 +1,160 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Internet user hosting his own communication server + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 459795d1ab31 -r 2ff373d2571a scripts/list_plugins/list_plugins.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/scripts/list_plugins/list_plugins.py Thu May 28 00:33:02 2015 +0200 @@ -0,0 +1,109 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- +""" +SàT website: Salut à Toi's presentation website +Copyright (C) 2015 Jérôme Poisson (goffi@goffi.org) +Copyright (C) 2015 Adrien Cossa (souliane@mailoo.org) + +This file is part of SàT website. + +SàT website is free software: you can redistribute it and/or modify +it under the terms of the GNU Affero General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +Foobar is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU Affero General Public License for more details. + +You should have received a copy of the GNU Affero General Public License +along with Foobar. If not, see . +""" + + +from sat import plugins +import pkgutil + +WEBSITE = "/home/souliane/workspace/sat_website" + +HEADER = u""" +{% comment %} +SàT website: Salut à Toi's presentation website +Copyright (C) 2012 Jérôme Poisson (goffi@goffi.org) +Copyright (C) 2015 Adrien Cossa (souliane@mailoo.org) + +This file is part of SàT website. + +SàT website is free software: you can redistribute it and/or modify +it under the terms of the GNU Affero General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +Foobar is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU Affero General Public License for more details. + +You should have received a copy of the GNU Affero General Public License +along with Foobar. If not, see . + + +NOTE: this file has been automatically generated by the following script: +http://repos.goffi.org/sat_docs/file/tip/scripts/list_plugins/list_plugins.py + +Please avoid manual modification, try to update the script instead! Before / +after a regeneration, don't forget to save / merge the manual modifications. + +{% endcomment %} +{% load i18n %} +""" + +import urllib2 +import lxml.html + +# use it to retrieve the XEP name from the official list +XEPS_URL = "http://xmpp.org/xmpp-protocols/xmpp-extensions/" + +def get_infos(): + result = {} + doc = lxml.html.parse(XEPS_URL) + + for loader, module_name, is_pkg in pkgutil.walk_packages(plugins.__path__): + module = loader.find_module(module_name).load_module(module_name) + infos = getattr(module, 'PLUGIN_INFO') + + if infos['type'] == 'XEP': + name = infos['import_name'] + url = "http://xmpp.org/extensions/%s.html" % name.lower() + key = "xep" + # use the XEP name as description + desc = doc.xpath("//tr[@id='%s']/td" % name.lower().replace("-", ""))[1].text + else: + name = '{% trans "' + infos['name'] + '" %}' + url = None + key = "exp" + desc = infos['description'] + if desc.startswith('Implementation of '): + desc = desc[18:] + desc = '{% trans "' + desc.replace('"', '\\"') + '" %}' + result.setdefault(key, []).append((name, url, desc)) + + return result + + +def print_infos(infos, file): + with open(file, 'w',) as f: + f.write(HEADER.encode("utf-8")) + for name, url, desc in infos: + name = ('%s' % (url, name)) if url else name + entry = u""" +
+
%s
+
%s
+
""" % (name, desc) + f.write(entry.encode("utf-8")) + +infos = get_infos() +for type_ in ("xep", "exp"): + print_infos(infos[type_], "%s/templates/sat_website/specifications_%s.html" % (WEBSITE, type_))