9. Tools

Besides the scripts from section 2.5, Document administration, there are a couple of local tools available.

The script bin/inst.sh installs the programs in the appropriate places. See section Activity Diagrams for bin/inst.sh.

Python modules:

9.1. Document Generation Issues

  • ImageMagick permissions problems with PDF (see imagemagick - convert:not authorized aaaa @ error/constitute.c/ReadImage/453):

    In file /etc/ImageMagick-6/policy.xml (or /etc/ImageMagick/policy.xml)

    1. comment line

      <!-- <policy domain="coder" rights="none" pattern="MVG" /> -->
      
    2. change lines

      <policy domain="coder" rights="none" pattern="PS" />
      <policy domain="coder" rights="none" pattern="EPS" />
      <policy domain="coder" rights="none" pattern="PDF" />
      

      to

      <policy domain="coder" rights="read|write" pattern="PS" />
      <policy domain="coder" rights="read|write" pattern="EPS" />
      <policy domain="coder" rights="read|write" pattern="PDF" />
      
    3. add line

      <policy domain="coder" rights="read|write" pattern="LABEL" />
      
  • ImageMagick conversion problems SVG -> PNG with inkscape (see convert aus ImageMagick verhält sich anders)

    In file /etc/ImageMagick-6/policy.xml (or /etc/ImageMagick/policy.xml)

    1. comment line

      <delegate decode="svg:decode" stealth="True" command="&quot;inkscape&quot; &quot;%s&quot; --export-eps=&quot;%s&quot; --export-dpi=&quot;%s&quot; --export-background=&quot;%s&quot; --export-background-opacity=&quot;%s&quot; &gt; &quot;%s&quot; 2&gt;&amp;1"/>
      

9.2. Activity Diagrams for rst2md.sh

@startuml /' a0 '/
skinparam padding 1
partition "rst2md.sh" {
start
floating note right
rst2md.sh - convert ReST to Markdown using pandoc

usage: rst2md.sh [FILE ..]

Removes ://rem//: comments before conversion.
end note
if (no arguments supplied?) then (yes)
:use standard input,;
endif
while (for each file argument) is (do)
    :remove ://rem//: comments;
    :convert with pandoc to markdown_github;
    :write to stdout;
endwhile
stop
} /' move before //stop//, if there are subsections '/
@enduml

9.3. Activity Diagrams for sphinx-doc-locate.sh

@startuml /' a0 '/
skinparam padding 1
partition "sphinx-doc-locate.sh" {
start
floating note right
sphinx-doc-locate.sh - locate documentation directories

usage: sphinx-doc-locate.sh [OPTIONS]

OPTIONS
--grep  ARG ..  run grep-find in directories with ARGS
--home          special -sed FILTER: only directories in ${HOME}
--sed   FILTER  sed(1) script for filtering directories
end note
:setup options;
while (for each document directory) is (do)
if (directory passes //--sed// filter) then (yes)
    :print directory path;
    if (//--grep//) then (yes)
        :run grep-find in directory;
    endif
endif
endwhile
stop
}
@enduml

9.4. Activity Diagrams for bin/inst.sh

@startuml /' a1 '/
skinparam padding 1
partition "Install System Packages" {
:setup needed and wanted system packages;
:show host info;
:setup ws-local repository;
:determine missing packages;
:install missing packages;
}
@enduml

@startuml /' a2 '/
skinparam padding 1
partition "Extra Application Setup" {
:PlantUML update;
:Install webvector (CSSBox);
}
@enduml

@startuml /' a3 '/
skinparam padding 1
partition "Python Environment Configuration" {
:set PY_PACKAGE_DIRS;
while (**for** env **in** SYSTEM PYRAMID) is (set)
:    set PY_BIN_DIR_env, PY_VER_env, PY_LIB_DIRS_env;
:    set PY_PACKAGE_PARAM_env with
    **make_package_param** env|
endwhile
:  set PY_PACKAGE_PARAM_ALL;
note right
PY_PACKAGE_PARAM_ALL:
system /usr/bin /usr/lib/python2.7/dist-packages ...
pyramid /usr/local/pyramid/bin /usr/local/pyramid/...
end note
:Setup Python 2 Site Customization;
}
@enduml

@startuml /' a4 '/
skinparam padding 1
partition "Select and Install Python Packages" {
:  generate install programs
  **py_add_install_package_command**
  **py_add_install_src_package_command**|
note right
py_install_system_packages:
/usr/bin/easy_install 'src/Sphinx-1.7.4.tar.gz'
/usr/bin/easy_install 'src/sphinx-bootstrap-theme-0.6.5.tar.gz'

py_install_pyramid_packages:
/usr/local/pyramid/bin/easy_install 'src/Sphinx-1.7.4.tar.gz'
/usr/local/pyramid/bin/easy_install 'src/python-sphinxcontrib...
/usr/local/pyramid/bin/easy_install 'src/sphinx-bootstrap...
end note
:execute install programs;
 :check fallback packages;
 :execute install programs;
}
@enduml