Salome HOME
ajout doc commande init, maj sat doc
authorcrouzet <nicolas.crouzet@cea.fr>
Tue, 12 Feb 2019 16:17:46 +0000 (17:17 +0100)
committercrouzet <nicolas.crouzet@cea.fr>
Tue, 12 Feb 2019 16:17:46 +0000 (17:17 +0100)
commands/doc.py
doc/Makefile
doc/src/commands/init.rst [new file with mode: 0644]
doc/src/index.rst

index 6191e0a0e3be6f93a3eda9acd1c920b687a5fbe5..0c9b44881b807698f208719607bd97816135b85d 100644 (file)
@@ -59,22 +59,27 @@ def run(args, runner, logger):
     logger.write("docdir %s\n" % docDir, 6)
     logger.write("options %s\n" % options, 6)
 
-    somethingDone = False
-    if options.xml:
-        src.system.show_in_editor(runner.cfg.USER.browser, htmlFile, logger)
-        somethingDone = True
     if options.pdf:
+        if not os.path.isfile(pdfFile):
+            msg = "\npdf documentation not found. Please build it inside doc directory\n"\
+                  "(follow README instructions in doc directory)\n"
+            logger.error(msg)
+            return 1
         src.system.show_in_editor(runner.cfg.USER.pdf_viewer, pdfFile, logger)
-        somethingDone = True
-    if options.edit:
+
+    elif options.edit:
         src.system.show_in_editor(runner.cfg.USER.editor, rstFiles, logger)
         src.system.show_in_editor(runner.cfg.USER.editor, rstFilesCommands, logger)
-        somethingDone = True
-    if options.compile:
+
+    elif options.compile:
         logger.write("How to compile documentation:\n%s" % open(readmeFile,"r").read(), 3)
-        somethingDone = True
 
-    if not somethingDone:
+    else:
+        if not os.path.isfile(htmlFile):
+            msg = "\nhtml documentation not found. Please build it inside doc directory\n"\
+                  "(follow README instructions in doc directory)\n"
+            logger.error(msg)
+            return 1
         src.system.show_in_editor(runner.cfg.USER.browser, htmlFile, logger)
 
     return 0
index da3be1c69d1521f6ea634b64569ae30c41375ad5..249ef66c0670cddcc5553aef05bd71d657139f46 100644 (file)
@@ -105,8 +105,9 @@ latex:
 latexpdf:
        $(SPHINXBUILD) -q -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
        @echo "Running LaTeX files through pdflatex..."
-       make -C $(BUILDDIR)/latex all-pdf $(SILENT)
-       @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
+       make -C $(BUILDDIR)/latex all-pdf
+       @echo
+       @echo "pdflatex available in $(BUILDDIR)/latex/salomeTools.pdf"
 
 
 clean-pdf:
diff --git a/doc/src/commands/init.rst b/doc/src/commands/init.rst
new file mode 100644 (file)
index 0000000..0486d46
--- /dev/null
@@ -0,0 +1,54 @@
+.. include:: ../../rst_prolog.rst
+
+Command config
+******************
+
+Description
+===========
+The **init** command manages the sat local configuration (which is stored in the data/local.pyconf file).
+It allows to initialise the content of this file.
+
+Usage
+=====
+* A sat project provides all the pyconf files relatives to a project (salome for example). Use the *--add_project* command to add a sat project locally, in data/local.pyconf (by default sat comes without any project). It is possible to add  as many projects as required. ::
+
+    sat init --add_project <path/to/a/sat/project/project.pyconf>
+
+
+* If you need to remove a sat project from the local configuration, use the *--reset_projects* command to remove all projects and then add the nex ones with *--add_project*: ::
+  
+    sat init --reset_projects
+    sat init --add_project <path/to/a/new/sat/project/project.pyconf>
+
+* By default the product archives are stored locally within the directory containing salomeTool, in a subdirectory called ARCHIVES. If you want to change the default, use the *--archive_dir* option: ::
+
+    sat init --archive_dir  <local/path/where/to/store/product/archives>
+
+* sat enable a **base** mode, which allow to mutualize product builds between several applications. By defaut, the mutualised builds are stored locally within the directory containing salomeTool, in a subdirectory called  BASE. To change the default, use the *--base* option: ::
+  
+    sat init --base <local/path/where/to/store/product/mutualised/product/builds>
+
+* In the same way, you can use the *--workdir* and *--log_dir* commands to change the default directories used to store the application builds, and sat logs: ::
+  
+    sat init --workdir <local/path/where/to/store/applications>
+    sat init --log_dir <local/path/where/to/store/sat/logs>
+
+
+
+Some useful configuration pathes
+=================================
+
+All the sat init commands update the local pyconf salomeTool file data/local.pyconf. The same result can be achieved by editing the file directly. 
+The content of data/local.pyconf is dumped into two sat configuration variables:
+
+* **LOCAL**: Contains notably all the default paths in the fields archive_dir, base, log_dir and workdir.
+
+* **PROJECTS**: The field project_file_paths contains all the project files that have been included with --add_project option.
+
+sat commands: ::
+
+  sat config -v LOCAL
+  sat config -v PROJECTS
+
+
+
index 5b2a111a2fbd7cdace8a1d377bffe3909952c9e0..4052fdf756022ecb7b7181290c6f4e07a0fd56af 100644 (file)
@@ -55,6 +55,7 @@ List of Commands
    clean <commands/clean>
    package <commands/package>
    generate <commands/generate>
+   init <commands/init>
 
 Developer documentation
 =======================