summaryrefslogtreecommitdiff
path: root/tools/gendocs/source.py
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2015-10-27 16:49:10 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2015-10-27 16:49:10 (GMT)
commit51e0be89c8f94ddc1bb023a4fb7ce4161e42df98 (patch)
tree810e9249d82d527b5da88d5de103b10930a9a985 /tools/gendocs/source.py
parent602ac694fc28885a496a7cf377a8cdd08221da4d (diff)
Added a tool to update Python documentation online.
git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@601 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a
Diffstat (limited to 'tools/gendocs/source.py')
-rw-r--r--tools/gendocs/source.py54
1 files changed, 54 insertions, 0 deletions
diff --git a/tools/gendocs/source.py b/tools/gendocs/source.py
new file mode 100644
index 0000000..3de4874
--- /dev/null
+++ b/tools/gendocs/source.py
@@ -0,0 +1,54 @@
+#!/usr/bin/python3
+# -*- coding: utf-8 -*-
+
+
+class SourceReader(object):
+ """Lecteur attentif de code source."""
+
+
+ def __init__(self, parent, name, output):
+ """Initialise l'identité d'une partie de documentation."""
+
+ self._parent = parent
+ self._name = name
+ self._output_cls = output
+ self._output = output()
+
+
+ def build(self, validation):
+ """Construit de façon générique une documentation complète."""
+
+ self._output.open(self._name, self._fullname)
+
+ others, mod_desc = self.prepare_module()
+ classes = self.list_all_classes()
+
+ # Contenu du module
+
+ self._output.start_main_section('Content')
+
+ self._output.show_list_sub_modules(self._parent, self._fullname, others, self.make_path)
+
+ self._output.show_list_sub_classes(self._fullname, classes, self.make_path)
+
+ self._output.describe_module(mod_desc)
+
+ # Description des classes
+
+ if len(classes) > 0:
+
+ self._output.start_main_section('Classes')
+
+ for cls in classes:
+ self.describe_class(cls, validation)
+
+ # Eléments propres au module
+
+ self.describe_module_items()
+
+ # Fermeture et suite
+
+ self._output.close()
+
+ for o in others:
+ o.build(validation)