Commit 0e1af63d authored by Etienne Nadji's avatar Etienne Nadji
Browse files

modifié : _modules/pyscribus/colors.html

	modifié :         _modules/pyscribus/common/xml.html
	modifié :         _modules/pyscribus/dimensions.html
	modifié :         _modules/pyscribus/pageobjects.html
	modifié :         _modules/pyscribus/pages.html
	modifié :         _modules/pyscribus/styles.html
	modifié :         _sources/articles/en/spec.rst.txt
	modifié :         articles/en/spec.html
	modifié :         pyscribus.html
	modifié :         searchindex.js
parent ea201f75
......@@ -707,7 +707,7 @@
<span class="bp">self</span><span class="o">.</span><span class="n">color</span> <span class="o">=</span> <span class="n">color</span>
<span class="k">if</span> <span class="p">(</span><span class="n">shade</span> <span class="p">:</span><span class="o">=</span> <span class="n">xml</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">&quot;SHADE&quot;</span><span class="p">))</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span>
<span class="bp">self</span><span class="o">.</span><span class="n">shade</span> <span class="o">=</span> <span class="n">dimensions</span><span class="o">.</span><span class="n">Dim</span><span class="p">(</span><span class="nb">float</span><span class="p">(</span><span class="n">opacity</span><span class="p">),</span> <span class="s2">&quot;pc&quot;</span><span class="p">)</span>
<span class="bp">self</span><span class="o">.</span><span class="n">shade</span> <span class="o">=</span> <span class="n">dimensions</span><span class="o">.</span><span class="n">Dim</span><span class="p">(</span><span class="nb">float</span><span class="p">(</span><span class="n">shade</span><span class="p">),</span> <span class="s2">&quot;pc&quot;</span><span class="p">)</span>
<span class="k">if</span> <span class="p">(</span><span class="n">ramp</span> <span class="p">:</span><span class="o">=</span> <span class="n">xml</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">&quot;RAMP&quot;</span><span class="p">))</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span>
<span class="bp">self</span><span class="o">.</span><span class="n">position</span> <span class="o">=</span> <span class="n">dimensions</span><span class="o">.</span><span class="n">Dim</span><span class="p">(</span><span class="nb">float</span><span class="p">(</span><span class="n">ramp</span><span class="p">),</span> <span class="s2">&quot;pcdecim&quot;</span><span class="p">)</span>
......
......@@ -193,9 +193,8 @@
<span class="c1"># Imports ===============================================================#</span>
<span class="kn">import</span> <span class="nn">pprint</span>
<span class="kn">import</span> <span class="nn">copy</span>
<span class="kn">import</span> <span class="nn">pprint</span>
<span class="kn">import</span> <span class="nn">lxml</span>
<span class="kn">import</span> <span class="nn">lxml.etree</span> <span class="k">as</span> <span class="nn">ET</span>
......@@ -599,7 +598,7 @@
<div class="viewcode-block" id="all_undocumented_to_xml"><a class="viewcode-back" href="../../../pyscribus.html#pyscribus.common.xml.all_undocumented_to_xml">[docs]</a><span class="k">def</span> <span class="nf">all_undocumented_to_xml</span><span class="p">(</span>
<span class="n">xml</span><span class="p">:</span> <span class="n">ET</span><span class="o">.</span><span class="n">_Element</span><span class="p">,</span> <span class="n">undocumented</span><span class="p">:</span> <span class="nb">dict</span><span class="p">,</span>
<span class="n">report</span><span class="p">:</span> <span class="nb">bool</span> <span class="o">=</span> <span class="kc">True</span><span class="p">,</span> <span class="n">msg</span><span class="p">:</span> <span class="nb">str</span> <span class="o">=</span> <span class="s2">&quot;&quot;</span><span class="p">):</span>
<span class="n">report</span><span class="p">:</span> <span class="nb">bool</span> <span class="o">=</span> <span class="kc">True</span><span class="p">,</span> <span class="n">msg</span><span class="p">:</span> <span class="nb">str</span> <span class="o">=</span> <span class="s2">&quot;&quot;</span><span class="p">,</span> <span class="n">passattr</span><span class="p">:</span> <span class="nb">list</span> <span class="o">=</span> <span class="p">[],</span> <span class="n">logger</span><span class="o">=</span><span class="kc">False</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Function to manage the export of undocumented</span>
<span class="sd"> XML/SLA attributes.</span>
......@@ -617,6 +616,11 @@
<span class="sd"> :type msg: str</span>
<span class="sd"> :param msg: Human readable name for the xml element when report parameter </span>
<span class="sd"> is True.</span>
<span class="sd"> :type passattr: list</span>
<span class="sd"> :param passattr: List of SLA attributes names to not report. For debug.</span>
<span class="sd"> :type logger: logging.Logger, bool</span>
<span class="sd"> :param logger: Logger object to use if report. If False, report is printed </span>
<span class="sd"> in STDOUT.</span>
<span class="sd"> :returns: List containing LXML element and undocumented attributes</span>
<span class="sd"> names list.</span>
<span class="sd"> :rtype: list</span>
......@@ -633,11 +637,24 @@
<span class="k">if</span> <span class="n">att_name</span> <span class="ow">not</span> <span class="ow">in</span> <span class="n">xml</span><span class="o">.</span><span class="n">attrib</span><span class="p">:</span>
<span class="n">xml</span><span class="o">.</span><span class="n">attrib</span><span class="p">[</span><span class="n">att_name</span><span class="p">]</span> <span class="o">=</span> <span class="n">att_value</span>
<span class="n">undoc_attribs</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">att_name</span><span class="p">)</span>
<span class="k">if</span> <span class="ow">not</span> <span class="n">passattr</span> <span class="ow">or</span> <span class="n">att_name</span> <span class="ow">not</span> <span class="ow">in</span> <span class="n">passattr</span><span class="p">:</span>
<span class="n">undoc_attribs</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">att_name</span><span class="p">)</span>
<span class="k">if</span> <span class="n">report</span> <span class="ow">and</span> <span class="n">undoc_attribs</span><span class="p">:</span>
<span class="nb">print</span><span class="p">(</span><span class="s2">&quot;Undocumented XML attributes in </span><span class="si">{}</span><span class="s2"> :&quot;</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">msg</span><span class="p">))</span>
<span class="n">pprint</span><span class="o">.</span><span class="n">pprint</span><span class="p">(</span><span class="n">undoc_attribs</span><span class="p">,</span> <span class="n">width</span><span class="o">=</span><span class="mi">80</span><span class="p">,</span> <span class="n">compact</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
<span class="n">msg</span> <span class="o">=</span> <span class="n">msg</span><span class="o">.</span><span class="n">strip</span><span class="p">()</span>
<span class="n">undocstr</span> <span class="o">=</span> <span class="s2">&quot;Undoc. XML attributes: </span><span class="si">{}</span><span class="s2">: &quot;</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">msg</span><span class="p">)</span>
<span class="k">if</span> <span class="n">logger</span><span class="p">:</span>
<span class="n">logger</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span>
<span class="n">undocstr</span> <span class="o">+</span> <span class="n">pprint</span><span class="o">.</span><span class="n">pformat</span><span class="p">(</span><span class="n">undoc_attribs</span><span class="p">,</span> <span class="n">compact</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
<span class="p">)</span>
<span class="k">else</span><span class="p">:</span>
<span class="nb">print</span><span class="p">(</span><span class="n">undocstr</span><span class="p">)</span>
<span class="n">pprint</span><span class="o">.</span><span class="n">pprint</span><span class="p">(</span><span class="n">undoc_attribs</span><span class="p">,</span> <span class="n">width</span><span class="o">=</span><span class="mi">80</span><span class="p">,</span> <span class="n">compact</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
<span class="k">return</span> <span class="p">[</span><span class="n">xml</span><span class="p">,</span> <span class="n">undoc_attribs</span><span class="p">]</span></div>
......
......@@ -194,6 +194,7 @@
<span class="kn">from</span> <span class="nn">pyscribus.common.math</span> <span class="k">import</span> <span class="n">PICA_TO_MM</span><span class="p">,</span><span class="n">INCH_TO_MM</span>
<span class="kn">import</span> <span class="nn">pyscribus.logs</span> <span class="k">as</span> <span class="nn">logs</span>
<span class="kn">import</span> <span class="nn">pyscribus.exceptions</span> <span class="k">as</span> <span class="nn">exceptions</span>
<span class="kn">import</span> <span class="nn">pyscribus.papers.ansi</span> <span class="k">as</span> <span class="nn">ansipaper</span>
......@@ -370,7 +371,8 @@
<span class="sd"> +-------------------------+---------------+</span>
<span class="sd"> | Percentage (0 to 100) | perc, pc |</span>
<span class="sd"> +-------------------------+---------------+</span>
<span class="sd"> | Percentage (0.0 to 1) | pcdecim, pcd |</span>
<span class="sd"> | Percentage (0.0 to 1, | pcdecim, pcd |</span>
<span class="sd"> | also negative) | |</span>
<span class="sd"> +-------------------------+---------------+</span>
<span class="sd"> | Calligraphic pen degree | cdeg |</span>
<span class="sd"> +-------------------------+---------------+</span>
......@@ -1175,9 +1177,18 @@
<span class="c1"># XML, only original box coords and rotation angle value</span>
<span class="c1"># are saved.</span>
<span class="c1"># FIXME Remove that after implementation</span>
<span class="nb">print</span><span class="p">(</span><span class="s2">&quot;PyScribus - Box rotation not implemented.&quot;</span><span class="p">)</span>
<span class="c1"># print(&quot;Rotation degree :&quot;, degree)</span>
<span class="c1"># FIXME Remove that after implementation -------</span>
<span class="n">logger</span><span class="o">=</span><span class="n">logs</span><span class="o">.</span><span class="n">getLogger</span><span class="p">()</span>
<span class="k">if</span> <span class="n">logger</span><span class="p">:</span>
<span class="n">logger</span><span class="o">.</span><span class="n">debug</span><span class="p">(</span><span class="s2">&quot;Box rotation not implemented.&quot;</span><span class="p">)</span>
<span class="c1"># logger.debug(&quot;Rotation degree : {}&quot;.format(degree))</span>
<span class="k">else</span><span class="p">:</span>
<span class="nb">print</span><span class="p">(</span><span class="s2">&quot;PyScribus - Box rotation not implemented.&quot;</span><span class="p">)</span>
<span class="c1"># print(&quot;Rotation degree :&quot;, degree)</span>
<span class="c1"># ----------------------------------------------</span>
<span class="n">valid</span> <span class="o">=</span> <span class="kc">True</span>
......
......@@ -200,6 +200,7 @@
<span class="kn">import</span> <span class="nn">svg.path</span> <span class="k">as</span> <span class="nn">svg</span>
<span class="kn">import</span> <span class="nn">pyscribus.common.xml</span> <span class="k">as</span> <span class="nn">xmlc</span>
<span class="kn">import</span> <span class="nn">pyscribus.logs</span> <span class="k">as</span> <span class="nn">logs</span>
<span class="kn">import</span> <span class="nn">pyscribus.exceptions</span> <span class="k">as</span> <span class="nn">exceptions</span>
<span class="kn">import</span> <span class="nn">pyscribus.dimensions</span> <span class="k">as</span> <span class="nn">dimensions</span>
<span class="kn">import</span> <span class="nn">pyscribus.itemattribute</span> <span class="k">as</span> <span class="nn">itemattribute</span>
......@@ -326,7 +327,7 @@
<span class="c1"># Undocumented box from gXpos, gYpos, gWidth, gHeight</span>
<span class="bp">self</span><span class="o">.</span><span class="n">gbox</span> <span class="o">=</span> <span class="n">dimensions</span><span class="o">.</span><span class="n">DimBox</span><span class="p">()</span>
<span class="bp">self</span><span class="o">.</span><span class="n">use_embedded_icc</span> <span class="o">=</span> <span class="kc">False</span>
<span class="bp">self</span><span class="o">.</span><span class="n">embedded_icc</span> <span class="o">=</span> <span class="p">{</span><span class="s2">&quot;use&quot;</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span> <span class="s2">&quot;profile&quot;</span><span class="p">:</span> <span class="kc">False</span><span class="p">}</span>
<span class="c1"># --- Page object own_page and linking/id --------------------</span>
......@@ -667,6 +668,10 @@
<span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">ptype</span> <span class="ow">in</span> <span class="p">[</span><span class="s2">&quot;polyline&quot;</span><span class="p">,</span> <span class="s2">&quot;polygon&quot;</span><span class="p">]:</span>
<span class="c1"># TODO FIXME Undocumented in polyline, polygon</span>
<span class="k">if</span> <span class="p">(</span><span class="n">fillrule</span> <span class="p">:</span><span class="o">=</span> <span class="n">xml</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">&quot;fillRule&quot;</span><span class="p">))</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span>
<span class="k">pass</span>
<span class="k">if</span> <span class="p">(</span><span class="n">line_end</span> <span class="p">:</span><span class="o">=</span> <span class="n">xml</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">&quot;PLINEEND&quot;</span><span class="p">))</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span>
<span class="k">for</span> <span class="n">human</span><span class="p">,</span> <span class="n">code</span> <span class="ow">in</span> <span class="n">PageObject</span><span class="o">.</span><span class="n">line_endcap_xml</span><span class="o">.</span><span class="n">items</span><span class="p">():</span>
<span class="k">if</span> <span class="n">line_end</span> <span class="o">==</span> <span class="n">code</span><span class="p">:</span>
......@@ -684,7 +689,10 @@
<span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">ptype</span> <span class="ow">in</span> <span class="p">[</span><span class="s2">&quot;image&quot;</span><span class="p">,</span> <span class="s2">&quot;render&quot;</span><span class="p">]:</span>
<span class="k">if</span> <span class="p">(</span><span class="n">embedded</span> <span class="p">:</span><span class="o">=</span> <span class="n">xml</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">&quot;EMBEDDED&quot;</span><span class="p">))</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span>
<span class="bp">self</span><span class="o">.</span><span class="n">use_embedded_icc</span> <span class="o">=</span> <span class="n">xmlc</span><span class="o">.</span><span class="n">num_to_bool</span><span class="p">(</span><span class="n">embedded</span><span class="p">)</span>
<span class="bp">self</span><span class="o">.</span><span class="n">embedded_icc</span><span class="p">[</span><span class="s2">&quot;use&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="n">xmlc</span><span class="o">.</span><span class="n">num_to_bool</span><span class="p">(</span><span class="n">embedded</span><span class="p">)</span>
<span class="k">if</span> <span class="p">(</span><span class="n">img_embedded_icc</span> <span class="p">:</span><span class="o">=</span> <span class="n">xml</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">&quot;EPROF&quot;</span><span class="p">))</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span>
<span class="bp">self</span><span class="o">.</span><span class="n">embedded_icc</span><span class="p">[</span><span class="s2">&quot;profile&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="n">img_embedded_icc</span>
<span class="c1"># --- Symbol attributes --------------------------------------</span>
......@@ -828,7 +836,10 @@
<span class="c1"># ------------------------------------------------------------</span>
<span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">ptype</span> <span class="ow">in</span> <span class="p">[</span><span class="s2">&quot;image&quot;</span><span class="p">,</span> <span class="s2">&quot;render&quot;</span><span class="p">]:</span>
<span class="n">xml</span><span class="o">.</span><span class="n">attrib</span><span class="p">[</span><span class="s2">&quot;EMBEDDED&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="n">xmlc</span><span class="o">.</span><span class="n">bool_to_num</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">use_embedded_icc</span><span class="p">)</span>
<span class="n">xml</span><span class="o">.</span><span class="n">attrib</span><span class="p">[</span><span class="s2">&quot;EMBEDDED&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="n">xmlc</span><span class="o">.</span><span class="n">bool_to_num</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">embedded_icc</span><span class="p">[</span><span class="s2">&quot;use&quot;</span><span class="p">])</span>
<span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">embedded_icc</span><span class="p">[</span><span class="s2">&quot;profile&quot;</span><span class="p">]:</span>
<span class="n">xml</span><span class="o">.</span><span class="n">attrib</span><span class="p">[</span><span class="s2">&quot;EPROF&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">embedded_icc</span><span class="p">[</span><span class="s2">&quot;profile&quot;</span><span class="p">]</span>
<span class="c1"># --- Previous / Next item -----------------------------------</span>
......@@ -855,7 +866,10 @@
<span class="k">try</span><span class="p">:</span>
<span class="n">xml</span><span class="p">,</span> <span class="n">undoc_attribs</span> <span class="o">=</span> <span class="n">xmlc</span><span class="o">.</span><span class="n">all_undocumented_to_xml</span><span class="p">(</span>
<span class="n">xml</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">undocumented</span><span class="p">,</span> <span class="kc">True</span><span class="p">,</span>
<span class="bp">self</span><span class="o">.</span><span class="n">ptype</span> <span class="o">+</span> <span class="s2">&quot; frame &#39;&quot;</span> <span class="o">+</span> <span class="bp">self</span><span class="o">.</span><span class="n">name</span> <span class="o">+</span> <span class="s2">&quot;&#39;&quot;</span>
<span class="bp">self</span><span class="o">.</span><span class="n">ptype</span> <span class="o">+</span> <span class="s2">&quot; &#39;</span><span class="si">{}</span><span class="s2">&#39;&quot;</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">name</span><span class="o">.</span><span class="n">strip</span><span class="p">()),</span>
<span class="c1"># FIXME This disable debug for path, copath attributes</span>
<span class="c1"># [&quot;path&quot;, &quot;copath&quot;]</span>
<span class="n">logger</span><span class="o">=</span><span class="n">logs</span><span class="o">.</span><span class="n">getLogger</span><span class="p">()</span>
<span class="p">)</span>
<span class="k">except</span> <span class="ne">AttributeError</span><span class="p">:</span>
......@@ -1417,7 +1431,8 @@
<span class="k">try</span><span class="p">:</span>
<span class="n">xml</span><span class="p">,</span> <span class="n">undoc_attribs</span> <span class="o">=</span> <span class="n">xmlc</span><span class="o">.</span><span class="n">all_undocumented_to_xml</span><span class="p">(</span>
<span class="n">xml</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">undocumented</span><span class="p">,</span> <span class="kc">True</span><span class="p">,</span>
<span class="bp">self</span><span class="o">.</span><span class="n">ptype</span> <span class="o">+</span> <span class="s2">&quot; frame &#39;&quot;</span> <span class="o">+</span> <span class="bp">self</span><span class="o">.</span><span class="n">name</span> <span class="o">+</span> <span class="s2">&quot;&#39;&quot;</span>
<span class="bp">self</span><span class="o">.</span><span class="n">ptype</span> <span class="o">+</span> <span class="s2">&quot; &#39;</span><span class="si">{}</span><span class="s2">&#39;&quot;</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">name</span><span class="o">.</span><span class="n">strip</span><span class="p">()),</span>
<span class="n">logger</span><span class="o">=</span><span class="n">logs</span><span class="o">.</span><span class="n">getLogger</span><span class="p">()</span>
<span class="p">)</span>
<span class="k">except</span> <span class="ne">AttributeError</span><span class="p">:</span>
......@@ -1608,7 +1623,8 @@
<span class="k">try</span><span class="p">:</span>
<span class="n">xml</span><span class="p">,</span> <span class="n">undoc_attribs</span> <span class="o">=</span> <span class="n">xmlc</span><span class="o">.</span><span class="n">all_undocumented_to_xml</span><span class="p">(</span>
<span class="n">xml</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">undocumented</span><span class="p">,</span> <span class="kc">True</span><span class="p">,</span>
<span class="bp">self</span><span class="o">.</span><span class="n">ptype</span> <span class="o">+</span> <span class="s2">&quot; frame &#39;&quot;</span> <span class="o">+</span> <span class="bp">self</span><span class="o">.</span><span class="n">name</span> <span class="o">+</span> <span class="s2">&quot;&#39;&quot;</span>
<span class="bp">self</span><span class="o">.</span><span class="n">ptype</span> <span class="o">+</span> <span class="s2">&quot; &#39;</span><span class="si">{}</span><span class="s2">&#39;&quot;</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">name</span><span class="o">.</span><span class="n">strip</span><span class="p">()),</span>
<span class="n">logger</span><span class="o">=</span><span class="n">logs</span><span class="o">.</span><span class="n">getLogger</span><span class="p">()</span>
<span class="p">)</span>
<span class="k">except</span> <span class="ne">AttributeError</span><span class="p">:</span>
......@@ -1958,7 +1974,8 @@
<span class="k">try</span><span class="p">:</span>
<span class="n">xml</span><span class="p">,</span> <span class="n">undoc_attribs</span> <span class="o">=</span> <span class="n">xmlc</span><span class="o">.</span><span class="n">all_undocumented_to_xml</span><span class="p">(</span>
<span class="n">xml</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">undocumented</span><span class="p">,</span> <span class="kc">True</span><span class="p">,</span>
<span class="bp">self</span><span class="o">.</span><span class="n">ptype</span> <span class="o">+</span> <span class="s2">&quot; frame &#39;&quot;</span> <span class="o">+</span> <span class="bp">self</span><span class="o">.</span><span class="n">name</span> <span class="o">+</span> <span class="s2">&quot;&#39;&quot;</span>
<span class="bp">self</span><span class="o">.</span><span class="n">ptype</span> <span class="o">+</span> <span class="s2">&quot; &#39;</span><span class="si">{}</span><span class="s2">&#39;&quot;</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">name</span><span class="o">.</span><span class="n">strip</span><span class="p">()),</span>
<span class="n">logger</span><span class="o">=</span><span class="n">logs</span><span class="o">.</span><span class="n">getLogger</span><span class="p">()</span>
<span class="p">)</span>
<span class="k">except</span> <span class="ne">AttributeError</span><span class="p">:</span>
......
......@@ -200,6 +200,7 @@
<span class="kn">import</span> <span class="nn">lxml</span>
<span class="kn">import</span> <span class="nn">lxml.etree</span> <span class="k">as</span> <span class="nn">ET</span>
<span class="kn">import</span> <span class="nn">pyscribus.logs</span> <span class="k">as</span> <span class="nn">logs</span>
<span class="kn">import</span> <span class="nn">pyscribus.exceptions</span> <span class="k">as</span> <span class="nn">exceptions</span>
<span class="kn">import</span> <span class="nn">pyscribus.dimensions</span> <span class="k">as</span> <span class="nn">dimensions</span>
......@@ -702,7 +703,8 @@
<span class="k">try</span><span class="p">:</span>
<span class="c1"># xml = undocumented_to_xml(xml, self.undocumented)</span>
<span class="n">xml</span><span class="p">,</span> <span class="n">undoc_attribs</span> <span class="o">=</span> <span class="n">all_undocumented_to_xml</span><span class="p">(</span>
<span class="n">xml</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">undocumented</span><span class="p">,</span> <span class="kc">True</span><span class="p">,</span> <span class="n">tag</span>
<span class="n">xml</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">undocumented</span><span class="p">,</span> <span class="kc">True</span><span class="p">,</span> <span class="n">tag</span><span class="p">,</span>
<span class="n">logger</span><span class="o">=</span><span class="n">logs</span><span class="o">.</span><span class="n">getLogger</span><span class="p">()</span>
<span class="p">)</span>
<span class="k">except</span> <span class="ne">AttributeError</span><span class="p">:</span>
......
This diff is collapsed.
......@@ -48,19 +48,23 @@ DOCUMENT/CHARSTYLE
Omitted XPath : ``/SCRIBUSUTF8NEW/DOCUMENT``.
+------------------------------+--------------------+------------+---------+----------+
| XML | Explanation | Value | Default | Optional |
| element/attribute | | | | |
+==============================+====================+============+=========+==========+
| ``/CHARSTYLE/@DefaultStyle`` | Same as STYLE, but | string | | |
| | not documented | | | |
+------------------------------+--------------------+------------+---------+----------+
| ``/CHARSTYLE/@wordTrack`` | Space width | Percentage | | |
| | | 0 -> 1 | | |
+------------------------------+--------------------+------------+---------+----------+
| ``/CHARSTYLE/@KERN`` | Kerning | Percentage | | |
| | | 0 -> 100 | | |
+------------------------------+--------------------+------------+---------+----------+
+-------------------------------+--------------------+------------+---------+----------+
| XML | Explanation | Value | Default | Optional |
| element/attribute | | | | |
+===============================+====================+============+=========+==========+
| ``/CHARSTYLE/@DefaultStyle`` | Same as STYLE, but | String | | |
| | not documented | | | |
+-------------------------------+--------------------+------------+---------+----------+
| ``/CHARSTYLE/@wordTrack`` | Space width | Percentage | | |
| | | 0 -> 1 | | |
+-------------------------------+--------------------+------------+---------+----------+
| ``/CHARSTYLE/@KERN`` | Kerning | Percentage | | |
| | | 0 -> 100 | | |
+-------------------------------+--------------------+------------+---------+----------+
| ``/CHARSTYLE/@HyphenWordMin`` | Minimal number of | Integer | | |
| | caracters for word | >= 3 | | |
| | hyphenation | | | |
+-------------------------------+--------------------+------------+---------+----------+
DOCUMENT/Sections
-----------------
......
......@@ -288,8 +288,8 @@ layer’s frames</td>
<p>Omitted XPath : <code class="docutils literal notranslate"><span class="pre">/SCRIBUSUTF8NEW/DOCUMENT</span></code>.</p>
<table border="1" class="docutils">
<colgroup>
<col width="37%" />
<col width="25%" />
<col width="38%" />
<col width="24%" />
<col width="15%" />
<col width="11%" />
<col width="12%" />
......@@ -307,7 +307,7 @@ element/attribute</th>
<tr class="row-even"><td><code class="docutils literal notranslate"><span class="pre">/CHARSTYLE/&#64;DefaultStyle</span></code></td>
<td>Same as STYLE, but
not documented</td>
<td>string</td>
<td>String</td>
<td>&#160;</td>
<td>&#160;</td>
</tr>
......@@ -325,6 +325,15 @@ not documented</td>
<td>&#160;</td>
<td>&#160;</td>
</tr>
<tr class="row-odd"><td><code class="docutils literal notranslate"><span class="pre">/CHARSTYLE/&#64;HyphenWordMin</span></code></td>
<td>Minimal number of
caracters for word
hyphenation</td>
<td>Integer
&gt;= 3</td>
<td>&#160;</td>
<td>&#160;</td>
</tr>
</tbody>
</table>
</div>
......
......@@ -449,7 +449,7 @@ export.</p>
<dl class="function">
<dt id="pyscribus.common.xml.all_undocumented_to_xml">
<code class="descclassname">pyscribus.common.xml.</code><code class="descname">all_undocumented_to_xml</code><span class="sig-paren">(</span><em>xml: lxml.etree._Element</em>, <em>undocumented: dict</em>, <em>report: bool = True</em>, <em>msg: str = ''</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pyscribus/common/xml.html#all_undocumented_to_xml"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyscribus.common.xml.all_undocumented_to_xml" title="Permalink to this definition"></a></dt>
<code class="descclassname">pyscribus.common.xml.</code><code class="descname">all_undocumented_to_xml</code><span class="sig-paren">(</span><em>xml: lxml.etree._Element</em>, <em>undocumented: dict</em>, <em>report: bool = True</em>, <em>msg: str = ''</em>, <em>passattr: list = []</em>, <em>logger=False</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pyscribus/common/xml.html#all_undocumented_to_xml"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyscribus.common.xml.all_undocumented_to_xml" title="Permalink to this definition"></a></dt>
<dd><p>Function to manage the export of undocumented
XML/SLA attributes.</p>
<p>Used in PyScribus toxml() methods until there is
......@@ -465,6 +465,9 @@ Return of all_undocumented_to_python()</li>
<li><strong>report</strong> (<em>bool</em>) – Print all undocumented attributes found in xml element.</li>
<li><strong>msg</strong> (<em>str</em>) – Human readable name for the xml element when report parameter
is True.</li>
<li><strong>passattr</strong> (<em>list</em>) – List of SLA attributes names to not report. For debug.</li>
<li><strong>logger</strong> (<em>logging.Logger</em><em>, </em><em>bool</em>) – Logger object to use if report. If False, report is printed
in STDOUT.</li>
</ul>
</td>
</tr>
......@@ -960,7 +963,8 @@ classes) has a unknown or empty type, as it is not in
<tr class="row-even"><td>Percentage (0 to 100)</td>
<td>perc, pc</td>
</tr>
<tr class="row-odd"><td>Percentage (0.0 to 1)</td>
<tr class="row-odd"><td>Percentage (0.0 to 1,
also negative)</td>
<td>pcdecim, pcd</td>
</tr>
<tr class="row-even"><td>Calligraphic pen degree</td>
......
This diff is collapsed.
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment