Commits (1)
  • Etienne Nadji's avatar
    modifié : _modules/pyscribus/colors.html · 9b2c51f0
    Etienne Nadji authored
    	modifié :         _modules/pyscribus/common/math.html
    	modifié :         _modules/pyscribus/common/xml.html
    	modifié :         _modules/pyscribus/dimensions.html
    	modifié :         _modules/pyscribus/document.html
    	modifié :         _modules/pyscribus/exceptions.html
    	modifié :         _modules/pyscribus/itemattribute.html
    	modifié :         _modules/pyscribus/marks.html
    	modifié :         _modules/pyscribus/pageobjects.html
    	modifié :         _modules/pyscribus/pages.html
    	modifié :         _modules/pyscribus/patterns.html
    	modifié :         _modules/pyscribus/sla.html
    	modifié :         _modules/pyscribus/stories.html
    	modifié :         pyscribus.html
    	modifié :         searchindex.js
    9b2c51f0
......@@ -275,7 +275,7 @@
<span class="c1">#--- Color management --------------------------------------</span>
<div class="viewcode-block" id="Color.set_space_colors"><a class="viewcode-back" href="../../pyscribus.html#pyscribus.colors.Color.set_space_colors">[docs]</a> <span class="k">def</span> <span class="nf">set_space_colors</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">space</span><span class="p">,</span> <span class="n">colors</span><span class="p">):</span>
<div class="viewcode-block" id="Color.set_space_colors"><a class="viewcode-back" href="../../pyscribus.html#pyscribus.colors.Color.set_space_colors">[docs]</a> <span class="k">def</span> <span class="nf">set_space_colors</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">space</span><span class="p">:</span> <span class="nb">str</span><span class="p">,</span> <span class="n">colors</span><span class="p">:</span> <span class="nb">list</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Set color space and color inks of the colors.</span>
......@@ -301,7 +301,13 @@
<span class="k">if</span> <span class="n">spaced</span><span class="p">:</span>
<span class="bp">self</span><span class="o">.</span><span class="n">set_colors</span><span class="p">(</span><span class="n">colors</span><span class="p">)</span></div>
<div class="viewcode-block" id="Color.set_colors"><a class="viewcode-back" href="../../pyscribus.html#pyscribus.colors.Color.set_colors">[docs]</a> <span class="k">def</span> <span class="nf">set_colors</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">colors</span><span class="p">,</span> <span class="n">space</span><span class="o">=</span><span class="kc">False</span><span class="p">):</span>
<div class="viewcode-block" id="Color.set_colors"><a class="viewcode-back" href="../../pyscribus.html#pyscribus.colors.Color.set_colors">[docs]</a> <span class="k">def</span> <span class="nf">set_colors</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">colors</span><span class="p">:</span> <span class="nb">list</span><span class="p">,</span> <span class="n">space</span><span class="o">=</span><span class="kc">False</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> :type colors: list</span>
<span class="sd"> :param colors: List of inks values (float).</span>
<span class="sd"> :type space: string</span>
<span class="sd"> :param space: Optionnal. Color space. Either &quot;cmyk&quot; or &quot;rgb&quot;.</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="k">if</span> <span class="ow">not</span> <span class="n">space</span><span class="p">:</span>
<span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">is_cmyk</span><span class="p">:</span>
......@@ -350,7 +356,7 @@
<span class="k">return</span> <span class="kc">False</span></div>
<div class="viewcode-block" id="Color.set_space"><a class="viewcode-back" href="../../pyscribus.html#pyscribus.colors.Color.set_space">[docs]</a> <span class="k">def</span> <span class="nf">set_space</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">space</span><span class="p">):</span>
<div class="viewcode-block" id="Color.set_space"><a class="viewcode-back" href="../../pyscribus.html#pyscribus.colors.Color.set_space">[docs]</a> <span class="k">def</span> <span class="nf">set_space</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">space</span><span class="p">:</span> <span class="nb">str</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Set the color space (CMYK / RGB) of the color.</span>
......@@ -373,7 +379,7 @@
<span class="c1">#--- PyScribus standard methods ----------------------------</span>
<div class="viewcode-block" id="Color.fromdefault"><a class="viewcode-back" href="../../pyscribus.html#pyscribus.colors.Color.fromdefault">[docs]</a> <span class="k">def</span> <span class="nf">fromdefault</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">default</span><span class="o">=</span><span class="s2">&quot;Black&quot;</span><span class="p">):</span>
<div class="viewcode-block" id="Color.fromdefault"><a class="viewcode-back" href="../../pyscribus.html#pyscribus.colors.Color.fromdefault">[docs]</a> <span class="k">def</span> <span class="nf">fromdefault</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">default</span><span class="p">:</span> <span class="nb">str</span> <span class="o">=</span> <span class="s2">&quot;Black&quot;</span><span class="p">):</span>
<span class="k">if</span> <span class="n">default</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">pyscribus_defaults</span><span class="p">:</span>
......@@ -391,9 +397,9 @@
<span class="k">return</span> <span class="kc">False</span></div>
<div class="viewcode-block" id="Color.fromxml"><a class="viewcode-back" href="../../pyscribus.html#pyscribus.colors.Color.fromxml">[docs]</a> <span class="k">def</span> <span class="nf">fromxml</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">xml</span><span class="p">):</span>
<div class="viewcode-block" id="Color.fromxml"><a class="viewcode-back" href="../../pyscribus.html#pyscribus.colors.Color.fromxml">[docs]</a> <span class="k">def</span> <span class="nf">fromxml</span><span class="p">(</span><span class="bp">self</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="sd">&quot;&quot;&quot;</span>
<span class="sd"> :type xml: lxml._Element</span>
<span class="sd"> :type xml: lxml.etree._Element</span>
<span class="sd"> :param xml: XML source of color</span>
<span class="sd"> :rtype: boolean</span>
<span class="sd"> :returns: True if XML parsing succeed</span>
......@@ -448,7 +454,7 @@
<div class="viewcode-block" id="Color.toxml"><a class="viewcode-back" href="../../pyscribus.html#pyscribus.colors.Color.toxml">[docs]</a> <span class="k">def</span> <span class="nf">toxml</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> :rtype: lxml._Element</span>
<span class="sd"> :rtype: lxml.etree._Element</span>
<span class="sd"> :returns: Color as XML element</span>
<span class="sd"> &quot;&quot;&quot;</span>
......@@ -604,7 +610,7 @@
<span class="k">return</span> <span class="kc">True</span>
<span class="k">def</span> <span class="nf">_quick_setup</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">settings</span><span class="p">):</span>
<span class="k">def</span> <span class="nf">_quick_setup</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">settings</span><span class="p">:</span> <span class="nb">dict</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Method for defining gradient stop settings from class</span>
<span class="sd"> instanciation kwargs.</span>
......@@ -640,7 +646,7 @@
<span class="bp">self</span><span class="o">.</span><span class="n">opacity</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="mi">100</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">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="mi">0</span><span class="p">,</span> <span class="s2">&quot;pcdecim&quot;</span><span class="p">)</span></div>
<div class="viewcode-block" id="GradientColorStop.fromxml"><a class="viewcode-back" href="../../pyscribus.html#pyscribus.colors.GradientColorStop.fromxml">[docs]</a> <span class="k">def</span> <span class="nf">fromxml</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">xml</span><span class="p">):</span>
<div class="viewcode-block" id="GradientColorStop.fromxml"><a class="viewcode-back" href="../../pyscribus.html#pyscribus.colors.GradientColorStop.fromxml">[docs]</a> <span class="k">def</span> <span class="nf">fromxml</span><span class="p">(</span><span class="bp">self</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="k">if</span> <span class="n">xml</span><span class="o">.</span><span class="n">tag</span> <span class="o">==</span> <span class="s2">&quot;CSTOP&quot;</span><span class="p">:</span>
<span class="k">if</span> <span class="p">(</span><span class="n">color</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;NAME&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">color</span> <span class="o">=</span> <span class="n">color</span>
......
......@@ -216,9 +216,9 @@
<span class="c1"># Fonctions =============================================================#</span>
<div class="viewcode-block" id="necessary_float"><a class="viewcode-back" href="../../../pyscribus.html#pyscribus.common.math.necessary_float">[docs]</a><span class="k">def</span> <span class="nf">necessary_float</span><span class="p">(</span><span class="n">f</span><span class="p">):</span>
<div class="viewcode-block" id="necessary_float"><a class="viewcode-back" href="../../../pyscribus.html#pyscribus.common.math.necessary_float">[docs]</a><span class="k">def</span> <span class="nf">necessary_float</span><span class="p">(</span><span class="n">f</span><span class="p">:</span> <span class="nb">float</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Return integer if float f has no decimals.</span>
<span class="sd"> Return **integer** if float f has no decimals, else returns **float**.</span>
<span class="sd"> :type f: float</span>
<span class="sd"> :param f: Float value</span>
......@@ -234,6 +234,9 @@
<div class="viewcode-block" id="mm"><a class="viewcode-back" href="../../../pyscribus.html#pyscribus.common.math.mm">[docs]</a><span class="k">def</span> <span class="nf">mm</span><span class="p">(</span><span class="n">milimeters</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Returns milimeters in pica points.</span>
<span class="sd"> :type milimeters: int,float</span>
<span class="sd"> :param milimeters: Milimeters</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="k">return</span> <span class="nb">float</span><span class="p">(</span><span class="n">milimeters</span><span class="p">)</span> <span class="o">/</span> <span class="n">PICA_TO_MM</span></div>
......
This diff is collapsed.
This diff is collapsed.
......@@ -835,8 +835,9 @@
<span class="c1">#========================================================================</span>
<div class="viewcode-block" id="Document.fromxml"><a class="viewcode-back" href="../../pyscribus.html#pyscribus.document.Document.fromxml">[docs]</a> <span class="k">def</span> <span class="nf">fromxml</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">xml</span><span class="p">):</span>
<div class="viewcode-block" id="Document.fromxml"><a class="viewcode-back" href="../../pyscribus.html#pyscribus.document.Document.fromxml">[docs]</a> <span class="k">def</span> <span class="nf">fromxml</span><span class="p">(</span><span class="bp">self</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="c1"># --- DOCUMENT attributes ----------------------------------------</span>
<span class="c1"># TODO DOCUMENT many attribs…</span>
<span class="c1"># Metadatas</span>
......@@ -1085,7 +1086,7 @@
<span class="k">return</span> <span class="kc">True</span></div>
<div class="viewcode-block" id="Document.toxml"><a class="viewcode-back" href="../../pyscribus.html#pyscribus.document.Document.toxml">[docs]</a> <span class="k">def</span> <span class="nf">toxml</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">optional</span><span class="o">=</span><span class="kc">True</span><span class="p">):</span>
<div class="viewcode-block" id="Document.toxml"><a class="viewcode-back" href="../../pyscribus.html#pyscribus.document.Document.toxml">[docs]</a> <span class="k">def</span> <span class="nf">toxml</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">optional</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">xml</span> <span class="o">=</span> <span class="n">ET</span><span class="o">.</span><span class="n">Element</span><span class="p">(</span><span class="s2">&quot;DOCUMENT&quot;</span><span class="p">)</span>
<span class="c1"># --- DOCUMENT attributes ----------------------------------------</span>
......@@ -1328,7 +1329,17 @@
<span class="c1">#========================================================================</span>
<div class="viewcode-block" id="Document.pageobjects"><a class="viewcode-back" href="../../pyscribus.html#pyscribus.document.Document.pageobjects">[docs]</a> <span class="k">def</span> <span class="nf">pageobjects</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">object_type</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">templatable</span><span class="o">=</span><span class="kc">False</span><span class="p">):</span>
<div class="viewcode-block" id="Document.pageobjects"><a class="viewcode-back" href="../../pyscribus.html#pyscribus.document.Document.pageobjects">[docs]</a> <span class="k">def</span> <span class="nf">pageobjects</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">object_type</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">templatable</span><span class="p">:</span> <span class="nb">bool</span> <span class="o">=</span> <span class="kc">False</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Return document page objets.</span>
<span class="sd"> :type object_type: string,bool</span>
<span class="sd"> :param object_type: Page object type to filter, or do not filter at all.</span>
<span class="sd"> See pageobjects.po_type_classes for valid values.</span>
<span class="sd"> :type templatable: bool</span>
<span class="sd"> :param templatable: Only return templatable page objects.</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="n">pos_ret</span> <span class="o">=</span> <span class="p">[]</span>
<span class="c1"># If there is a object type filter, we filter before checking</span>
......@@ -1746,7 +1757,7 @@
<span class="k">else</span><span class="p">:</span>
<span class="k">return</span> <span class="kc">False</span></div>
<div class="viewcode-block" id="Profile.fromxml"><a class="viewcode-back" href="../../pyscribus.html#pyscribus.document.Profile.fromxml">[docs]</a> <span class="k">def</span> <span class="nf">fromxml</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">xml</span><span class="p">):</span>
<div class="viewcode-block" id="Profile.fromxml"><a class="viewcode-back" href="../../pyscribus.html#pyscribus.document.Profile.fromxml">[docs]</a> <span class="k">def</span> <span class="nf">fromxml</span><span class="p">(</span><span class="bp">self</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">name</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;Name&quot;</span><span class="p">)</span>
<span class="k">if</span> <span class="n">name</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span>
......@@ -1777,7 +1788,7 @@
<span class="k">return</span> <span class="kc">True</span></div>
<div class="viewcode-block" id="Profile.fromdefault"><a class="viewcode-back" href="../../pyscribus.html#pyscribus.document.Profile.fromdefault">[docs]</a> <span class="k">def</span> <span class="nf">fromdefault</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">name</span><span class="p">):</span>
<div class="viewcode-block" id="Profile.fromdefault"><a class="viewcode-back" href="../../pyscribus.html#pyscribus.document.Profile.fromdefault">[docs]</a> <span class="k">def</span> <span class="nf">fromdefault</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">name</span><span class="p">:</span> <span class="nb">str</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> &quot;&quot;&quot;</span>
......@@ -1964,7 +1975,7 @@
<span class="bp">self</span><span class="o">.</span><span class="n">flow</span> <span class="o">=</span> <span class="kc">True</span>
<span class="bp">self</span><span class="o">.</span><span class="n">selectable</span> <span class="o">=</span> <span class="kc">False</span></div>
<div class="viewcode-block" id="Layer.fromxml"><a class="viewcode-back" href="../../pyscribus.html#pyscribus.document.Layer.fromxml">[docs]</a> <span class="k">def</span> <span class="nf">fromxml</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">xml</span><span class="p">):</span>
<div class="viewcode-block" id="Layer.fromxml"><a class="viewcode-back" href="../../pyscribus.html#pyscribus.document.Layer.fromxml">[docs]</a> <span class="k">def</span> <span class="nf">fromxml</span><span class="p">(</span><span class="bp">self</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">number</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;NUMMER&quot;</span><span class="p">)</span>
<span class="k">if</span> <span class="n">number</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span>
......
......@@ -226,9 +226,9 @@
<div class="viewcode-block" id="UnknownOrEmptyItemAttributeType"><a class="viewcode-back" href="../../pyscribus.html#pyscribus.exceptions.UnknownOrEmptyItemAttributeType">[docs]</a><span class="k">class</span> <span class="nc">UnknownOrEmptyItemAttributeType</span><span class="p">(</span><span class="ne">Exception</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Exception raised when a itemattribute.ItemAttribute (and inherited</span>
<span class="sd"> Exception raised when a ``itemattribute.ItemAttribute`` (and inherited</span>
<span class="sd"> classes) has a unknown or empty type, as it is not in</span>
<span class="sd"> itemattribute.ItemAttribute.attrib_types</span>
<span class="sd"> ``itemattribute.ItemAttribute.attrib_types``</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="k">pass</span></div>
......@@ -253,8 +253,8 @@
<span class="sd"> Exception raised when color inks (CMYK or RGB) are invalid, incomplete</span>
<span class="sd"> or doesn&#39;t even exists.</span>
<span class="sd"> RGB inks must range from 0 to 255.</span>
<span class="sd"> CMYK inks must range from 0 to 100.</span>
<span class="sd"> - RGB inks must range from 0 to 255.</span>
<span class="sd"> - CMYK inks must range from 0 to 100.</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="k">pass</span></div>
......@@ -273,18 +273,20 @@
<div class="viewcode-block" id="InvalidDim"><a class="viewcode-back" href="../../pyscribus.html#pyscribus.exceptions.InvalidDim">[docs]</a><span class="k">class</span> <span class="nc">InvalidDim</span><span class="p">(</span><span class="ne">Exception</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Exception raised if a dimensions.Dim value is impossible according to its</span>
<span class="sd"> unit.</span>
<span class="sd"> Exception raised if a ``dimensions.Dim`` value is impossible according</span>
<span class="sd"> to its unit.</span>
<span class="sd"> Pica points must no be inferior to 0.</span>
<span class="sd"> (Ordinary) angle (deg unit) must range from 0 to 180.</span>
<span class="sd"> Calligraphic pen angle (cdeg unit) must range from 0 to 180.</span>
<span class="sd"> - Pica points must no be inferior to 0.</span>
<span class="sd"> - (Ordinary) angle (deg unit) must range from 0 to 180.</span>
<span class="sd"> - Calligraphic pen angle (cdeg unit) must range from 0 to 180.</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="k">pass</span></div>
<div class="viewcode-block" id="IncompatibleDim"><a class="viewcode-back" href="../../pyscribus.html#pyscribus.exceptions.IncompatibleDim">[docs]</a><span class="k">class</span> <span class="nc">IncompatibleDim</span><span class="p">(</span><span class="ne">Exception</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;Exception raised on incompatible dimensions.Dim units conversions.&quot;&quot;&quot;</span>
<span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Exception raised on incompatible ``dimensions.Dim`` units conversions.</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="k">pass</span></div>
<span class="c1"># vim:set shiftwidth=4 softtabstop=4 spl=en:</span>
......
......@@ -281,7 +281,7 @@
<span class="c1">#--- PyScribus standard methods ----------------------------</span>
<div class="viewcode-block" id="ItemAttribute.fromxml"><a class="viewcode-back" href="../../pyscribus.html#pyscribus.itemattribute.ItemAttribute.fromxml">[docs]</a> <span class="k">def</span> <span class="nf">fromxml</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">xml</span><span class="p">):</span>
<div class="viewcode-block" id="ItemAttribute.fromxml"><a class="viewcode-back" href="../../pyscribus.html#pyscribus.itemattribute.ItemAttribute.fromxml">[docs]</a> <span class="k">def</span> <span class="nf">fromxml</span><span class="p">(</span><span class="bp">self</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">name</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;Name&quot;</span><span class="p">)</span>
<span class="k">if</span> <span class="n">name</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span>
......
......@@ -230,7 +230,7 @@
<span class="bp">self</span><span class="o">.</span><span class="n">pyscribus_defaults</span> <span class="o">=</span> <span class="p">[</span><span class="n">k</span> <span class="k">for</span> <span class="n">k</span> <span class="ow">in</span> <span class="n">mark_type_xml</span><span class="o">.</span><span class="n">keys</span><span class="p">()]</span>
<div class="viewcode-block" id="DocumentMark.fromdefault"><a class="viewcode-back" href="../../pyscribus.html#pyscribus.marks.DocumentMark.fromdefault">[docs]</a> <span class="k">def</span> <span class="nf">fromdefault</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">default</span><span class="p">):</span>
<div class="viewcode-block" id="DocumentMark.fromdefault"><a class="viewcode-back" href="../../pyscribus.html#pyscribus.marks.DocumentMark.fromdefault">[docs]</a> <span class="k">def</span> <span class="nf">fromdefault</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">default</span><span class="p">:</span> <span class="nb">str</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> :type default: string</span>
<span class="sd"> :param default: Set of default settings to apply</span>
......@@ -244,13 +244,14 @@
<span class="k">else</span><span class="p">:</span>
<span class="k">return</span> <span class="kc">False</span></div>
<div class="viewcode-block" id="DocumentMark.set_type"><a class="viewcode-back" href="../../pyscribus.html#pyscribus.marks.DocumentMark.set_type">[docs]</a> <span class="k">def</span> <span class="nf">set_type</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">mtype</span><span class="p">):</span>
<div class="viewcode-block" id="DocumentMark.set_type"><a class="viewcode-back" href="../../pyscribus.html#pyscribus.marks.DocumentMark.set_type">[docs]</a> <span class="k">def</span> <span class="nf">set_type</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">mtype</span><span class="p">:</span> <span class="nb">str</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> :type mtype: string</span>
<span class="sd"> :param mtype: Mark type in pyscribus.marks.mark_type_xml keys()</span>
<span class="sd"> :rtype: boolean</span>
<span class="sd"> :returns: True if setting type succeed</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="k">global</span> <span class="n">mark_type_xml</span>
<span class="k">if</span> <span class="n">mtype</span> <span class="ow">in</span> <span class="n">mark_type_xml</span><span class="o">.</span><span class="n">keys</span><span class="p">():</span>
......@@ -305,7 +306,7 @@
<span class="k">return</span> <span class="n">xml</span></div>
<div class="viewcode-block" id="DocumentMark.fromxml"><a class="viewcode-back" href="../../pyscribus.html#pyscribus.marks.DocumentMark.fromxml">[docs]</a> <span class="k">def</span> <span class="nf">fromxml</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">xml</span><span class="p">):</span>
<div class="viewcode-block" id="DocumentMark.fromxml"><a class="viewcode-back" href="../../pyscribus.html#pyscribus.marks.DocumentMark.fromxml">[docs]</a> <span class="k">def</span> <span class="nf">fromxml</span><span class="p">(</span><span class="bp">self</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="sd">&quot;&quot;&quot;</span>
<span class="sd"> :rtype: boolean</span>
<span class="sd"> :returns: True if XML parsing succeed</span>
......
This diff is collapsed.
This diff is collapsed.
......@@ -244,7 +244,7 @@
<span class="s2">&quot;y&quot;</span><span class="p">:</span> <span class="kc">None</span>
<span class="p">}</span>
<div class="viewcode-block" id="Pattern.fromxml"><a class="viewcode-back" href="../../pyscribus.html#pyscribus.patterns.Pattern.fromxml">[docs]</a> <span class="k">def</span> <span class="nf">fromxml</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">xml</span><span class="p">):</span>
<div class="viewcode-block" id="Pattern.fromxml"><a class="viewcode-back" href="../../pyscribus.html#pyscribus.patterns.Pattern.fromxml">[docs]</a> <span class="k">def</span> <span class="nf">fromxml</span><span class="p">(</span><span class="bp">self</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="sd">&quot;&quot;&quot;</span>
<span class="sd"> &quot;&quot;&quot;</span>
......@@ -332,9 +332,7 @@
<span class="n">pageobjects</span><span class="o">.</span><span class="n">PageObject</span><span class="o">.</span><span class="fm">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="s2">&quot;polygon&quot;</span><span class="p">,</span> <span class="n">sla_parent</span><span class="p">,</span> <span class="n">doc_parent</span><span class="p">)</span>
<span class="n">pageobjects</span><span class="o">.</span><span class="n">PageObject</span><span class="o">.</span><span class="n">_quick_setup</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">kwargs</span><span class="p">)</span>
<div class="viewcode-block" id="PatternItem.fromxml"><a class="viewcode-back" href="../../pyscribus.html#pyscribus.patterns.PatternItem.fromxml">[docs]</a> <span class="k">def</span> <span class="nf">fromxml</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">xml</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> &quot;&quot;&quot;</span>
<div class="viewcode-block" id="PatternItem.fromxml"><a class="viewcode-back" href="../../pyscribus.html#pyscribus.patterns.PatternItem.fromxml">[docs]</a> <span class="k">def</span> <span class="nf">fromxml</span><span class="p">(</span><span class="bp">self</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">success</span> <span class="o">=</span> <span class="n">pageobjects</span><span class="o">.</span><span class="n">PageObject</span><span class="o">.</span><span class="n">fromxml</span><span class="p">(</span>
<span class="bp">self</span><span class="p">,</span> <span class="n">xml</span><span class="p">,</span> <span class="n">arbitrary_tag</span><span class="o">=</span><span class="s2">&quot;PatternItem&quot;</span>
......
......@@ -303,7 +303,8 @@
<span class="sd"> Add the document to SLA Documents and set its sla_parent as self</span>
<span class="sd"> :type sla_object: pyscribus.document.Document, other</span>
<span class="sd"> :param sla_object: Document or any PyScribus object appendable to a document.</span>
<span class="sd"> :param sla_object: Document or any PyScribus object appendable to a </span>
<span class="sd"> document.</span>
<span class="sd"> :type document_index: int</span>
<span class="sd"> :param document_index: Index of document if sla_object is not one</span>
<span class="sd"> :rtype: boolean</span>
......@@ -321,7 +322,7 @@
<span class="k">else</span><span class="p">:</span>
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">document</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">sla_object</span><span class="p">)</span></div>
<div class="viewcode-block" id="SLA.save"><a class="viewcode-back" href="../../pyscribus.html#pyscribus.sla.SLA.save">[docs]</a> <span class="k">def</span> <span class="nf">save</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">filepath</span><span class="p">):</span>
<div class="viewcode-block" id="SLA.save"><a class="viewcode-back" href="../../pyscribus.html#pyscribus.sla.SLA.save">[docs]</a> <span class="k">def</span> <span class="nf">save</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">filepath</span><span class="p">:</span> <span class="nb">str</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Save SLA file.</span>
......@@ -345,14 +346,14 @@
<span class="k">with</span> <span class="nb">open</span><span class="p">(</span><span class="n">filepath</span><span class="p">,</span> <span class="s2">&quot;w&quot;</span><span class="p">,</span> <span class="n">encoding</span><span class="o">=</span><span class="s2">&quot;utf8&quot;</span><span class="p">)</span> <span class="k">as</span> <span class="n">slaf</span><span class="p">:</span>
<span class="n">slaf</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="n">xml_string</span><span class="p">)</span></div>
<div class="viewcode-block" id="SLA.toxml"><a class="viewcode-back" href="../../pyscribus.html#pyscribus.sla.SLA.toxml">[docs]</a> <span class="k">def</span> <span class="nf">toxml</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">optional</span><span class="o">=</span><span class="kc">True</span><span class="p">):</span>
<div class="viewcode-block" id="SLA.toxml"><a class="viewcode-back" href="../../pyscribus.html#pyscribus.sla.SLA.toxml">[docs]</a> <span class="k">def</span> <span class="nf">toxml</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">optional</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="sd">&quot;&quot;&quot;</span>
<span class="sd"> Return SLA as lxml.etree._Element</span>
<span class="sd"> :type optional: bool</span>
<span class="sd"> :param optional: Includes optional attributes (True by default)</span>
<span class="sd"> :returns: xml</span>
<span class="sd"> :rtype: lxml._Element</span>
<span class="sd"> :rtype: lxml.etree._Element</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="n">xml</span> <span class="o">=</span> <span class="n">ET</span><span class="o">.</span><span class="n">Element</span><span class="p">(</span><span class="s2">&quot;SCRIBUSUTF8NEW&quot;</span><span class="p">)</span>
......@@ -369,7 +370,7 @@
<span class="k">return</span> <span class="n">xml</span></div>
<div class="viewcode-block" id="SLA.stories"><a class="viewcode-back" href="../../pyscribus.html#pyscribus.sla.SLA.stories">[docs]</a> <span class="k">def</span> <span class="nf">stories</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">templatable</span><span class="o">=</span><span class="kc">False</span><span class="p">):</span>
<div class="viewcode-block" id="SLA.stories"><a class="viewcode-back" href="../../pyscribus.html#pyscribus.sla.SLA.stories">[docs]</a> <span class="k">def</span> <span class="nf">stories</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">templatable</span><span class="p">:</span> <span class="nb">bool</span> <span class="o">=</span> <span class="kc">False</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Returns all stories from text frames (TextObject) in SLA.</span>
......@@ -391,8 +392,15 @@
<span class="k">return</span> <span class="n">stories</span></div>
<div class="viewcode-block" id="SLA.pageobjects"><a class="viewcode-back" href="../../pyscribus.html#pyscribus.sla.SLA.pageobjects">[docs]</a> <span class="k">def</span> <span class="nf">pageobjects</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">object_type</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">templatable</span><span class="o">=</span><span class="kc">False</span><span class="p">):</span>
<div class="viewcode-block" id="SLA.pageobjects"><a class="viewcode-back" href="../../pyscribus.html#pyscribus.sla.SLA.pageobjects">[docs]</a> <span class="k">def</span> <span class="nf">pageobjects</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">object_type</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">templatable</span><span class="p">:</span> <span class="nb">bool</span> <span class="o">=</span> <span class="kc">False</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Return document page objets.</span>
<span class="sd"> :type object_type: string,bool</span>
<span class="sd"> :param object_type: Page object type to filter, or do not filter at all.</span>
<span class="sd"> See pageobjects.po_type_classes for valid values.</span>
<span class="sd"> :type templatable: bool</span>
<span class="sd"> :param templatable: Only return templatable page objects.</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">document</span><span class="o">.</span><span class="n">pageobjects</span><span class="p">(</span><span class="n">object_type</span><span class="p">,</span> <span class="n">templatable</span><span class="p">)</span></div>
......@@ -405,7 +413,7 @@
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">stories</span><span class="p">(</span><span class="n">templatable</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span></div>
<div class="viewcode-block" id="SLA.parse"><a class="viewcode-back" href="../../pyscribus.html#pyscribus.sla.SLA.parse">[docs]</a> <span class="k">def</span> <span class="nf">parse</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">filepath</span><span class="p">,</span> <span class="n">kwargs</span><span class="p">):</span>
<div class="viewcode-block" id="SLA.parse"><a class="viewcode-back" href="../../pyscribus.html#pyscribus.sla.SLA.parse">[docs]</a> <span class="k">def</span> <span class="nf">parse</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">filepath</span><span class="p">:</span> <span class="nb">str</span><span class="p">,</span> <span class="n">kwargs</span><span class="p">:</span> <span class="nb">dict</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Import SLA data from a file path.</span>
......@@ -422,12 +430,15 @@
<span class="k">return</span> <span class="n">success</span></div>
<div class="viewcode-block" id="SLA.fromxml"><a class="viewcode-back" href="../../pyscribus.html#pyscribus.sla.SLA.fromxml">[docs]</a> <span class="k">def</span> <span class="nf">fromxml</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">xml</span><span class="p">):</span>
<div class="viewcode-block" id="SLA.fromxml"><a class="viewcode-back" href="../../pyscribus.html#pyscribus.sla.SLA.fromxml">[docs]</a> <span class="k">def</span> <span class="nf">fromxml</span><span class="p">(</span><span class="bp">self</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="sd">&quot;&quot;&quot;</span>
<span class="sd"> Set SLA content according to &lt;xml&gt; (lxml.etree._Element).</span>
<span class="sd"> Set SLA content according to an XML tree.</span>
<span class="sd"> Use SLA.parse() if you want to import from a file path.</span>
<span class="sd"> :type xml: lxml.etree._Element</span>
<span class="sd"> :param xml: SLA file XML element</span>
<span class="sd"> :returns: True if successfull parsing</span>
<span class="sd"> :rtype: boolean</span>
......
......@@ -227,7 +227,7 @@
<span class="k">return</span> <span class="n">xml</span></div>
<div class="viewcode-block" id="StoryEnding.fromxml"><a class="viewcode-back" href="../../pyscribus.html#pyscribus.stories.StoryEnding.fromxml">[docs]</a> <span class="k">def</span> <span class="nf">fromxml</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">xml</span><span class="p">):</span>
<div class="viewcode-block" id="StoryEnding.fromxml"><a class="viewcode-back" href="../../pyscribus.html#pyscribus.stories.StoryEnding.fromxml">[docs]</a> <span class="k">def</span> <span class="nf">fromxml</span><span class="p">(</span><span class="bp">self</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="k">if</span> <span class="n">xml</span><span class="o">.</span><span class="n">tag</span> <span class="o">==</span> <span class="s2">&quot;trail&quot;</span><span class="p">:</span>
<span class="k">if</span> <span class="p">(</span><span class="n">align</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;ALIGN&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>
......@@ -300,7 +300,7 @@
<span class="k">def</span> <span class="nf">__repr__</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="k">return</span> <span class="s2">&quot;PARAGEND|</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="bp">self</span><span class="o">.</span><span class="n">parent</span><span class="p">)</span>
<div class="viewcode-block" id="StoryParagraphEnding.fromxml"><a class="viewcode-back" href="../../pyscribus.html#pyscribus.stories.StoryParagraphEnding.fromxml">[docs]</a> <span class="k">def</span> <span class="nf">fromxml</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">xml</span><span class="p">,</span> <span class="n">check_style</span><span class="o">=</span><span class="kc">True</span><span class="p">):</span>
<div class="viewcode-block" id="StoryParagraphEnding.fromxml"><a class="viewcode-back" href="../../pyscribus.html#pyscribus.stories.StoryParagraphEnding.fromxml">[docs]</a> <span class="k">def</span> <span class="nf">fromxml</span><span class="p">(</span><span class="bp">self</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">check_style</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="k">if</span> <span class="p">(</span><span class="n">parentpar</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;PARENT&quot;</span><span class="p">))</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span>
<span class="bp">self</span><span class="o">.</span><span class="n">parent</span> <span class="o">=</span> <span class="kc">False</span>
<span class="k">else</span><span class="p">:</span>
......@@ -420,7 +420,7 @@
<span class="k">if</span> <span class="n">kwargs</span><span class="p">:</span>
<span class="bp">self</span><span class="o">.</span><span class="n">_quick_setup</span><span class="p">(</span><span class="n">kwargs</span><span class="p">)</span>
<span class="k">def</span> <span class="nf">_quick_setup</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">settings</span><span class="p">):</span>
<span class="k">def</span> <span class="nf">_quick_setup</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">settings</span><span class="p">:</span> <span class="nb">dict</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Method for defining story fragment settings from class</span>
<span class="sd"> instanciation kwargs.</span>
......@@ -540,7 +540,7 @@
<span class="k">return</span> <span class="n">xml</span></div>
<div class="viewcode-block" id="StoryFragment.fromxml"><a class="viewcode-back" href="../../pyscribus.html#pyscribus.stories.StoryFragment.fromxml">[docs]</a> <span class="k">def</span> <span class="nf">fromxml</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">xml</span><span class="p">):</span>
<div class="viewcode-block" id="StoryFragment.fromxml"><a class="viewcode-back" href="../../pyscribus.html#pyscribus.stories.StoryFragment.fromxml">[docs]</a> <span class="k">def</span> <span class="nf">fromxml</span><span class="p">(</span><span class="bp">self</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="k">if</span> <span class="p">(</span><span class="n">fragtext</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;CH&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="c1"># NOTE Don&#39;t do any strip, rstrip to @CH, as it may</span>
......@@ -564,7 +564,7 @@
<span class="k">else</span><span class="p">:</span>
<span class="k">return</span> <span class="kc">False</span></div>
<div class="viewcode-block" id="StoryFragment.set_features"><a class="viewcode-back" href="../../pyscribus.html#pyscribus.stories.StoryFragment.set_features">[docs]</a> <span class="k">def</span> <span class="nf">set_features</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">features</span><span class="p">):</span>
<div class="viewcode-block" id="StoryFragment.set_features"><a class="viewcode-back" href="../../pyscribus.html#pyscribus.stories.StoryFragment.set_features">[docs]</a> <span class="k">def</span> <span class="nf">set_features</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">features</span><span class="p">:</span> <span class="nb">str</span><span class="p">):</span>
<span class="c1"># TODO</span>
<span class="n">features</span> <span class="o">=</span> <span class="n">features</span><span class="o">.</span><span class="n">split</span><span class="p">()</span>
......@@ -604,7 +604,7 @@
<span class="k">return</span> <span class="n">element</span></div>
<div class="viewcode-block" id="StoryVariable.fromxml"><a class="viewcode-back" href="../../pyscribus.html#pyscribus.stories.StoryVariable.fromxml">[docs]</a> <span class="k">def</span> <span class="nf">fromxml</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">xml</span><span class="p">):</span>
<div class="viewcode-block" id="StoryVariable.fromxml"><a class="viewcode-back" href="../../pyscribus.html#pyscribus.stories.StoryVariable.fromxml">[docs]</a> <span class="k">def</span> <span class="nf">fromxml</span><span class="p">(</span><span class="bp">self</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="sd">&quot;&quot;&quot;</span>
<span class="sd"> :rtype: boolean</span>
<span class="sd"> :returns: True if XML parsing succeed</span>
......@@ -655,7 +655,7 @@
<span class="s2">&quot;italic&quot;</span><span class="p">:</span> <span class="s2">&quot;Arial Italic&quot;</span><span class="p">,</span>
<span class="s2">&quot;bold&quot;</span><span class="p">:</span> <span class="s2">&quot;Arial Bold&quot;</span><span class="p">,</span>
<span class="s2">&quot;bold-italic&quot;</span><span class="p">:</span> <span class="s2">&quot;Arial Bold Italic&quot;</span><span class="p">},</span>
<span class="n">alternate_emphasis</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span>
<span class="n">alternate_emphasis</span><span class="p">:</span> <span class="nb">bool</span> <span class="o">=</span> <span class="kc">False</span><span class="p">,</span>
<span class="n">sla_document</span><span class="o">=</span><span class="kc">False</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> :type html: string</span>
......@@ -1024,7 +1024,7 @@
<span class="k">return</span> <span class="kc">True</span></div>
<div class="viewcode-block" id="Story.append_paragraphs"><a class="viewcode-back" href="../../pyscribus.html#pyscribus.stories.Story.append_paragraphs">[docs]</a> <span class="k">def</span> <span class="nf">append_paragraphs</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">paragraphs</span><span class="o">=</span><span class="p">[]):</span>
<div class="viewcode-block" id="Story.append_paragraphs"><a class="viewcode-back" href="../../pyscribus.html#pyscribus.stories.Story.append_paragraphs">[docs]</a> <span class="k">def</span> <span class="nf">append_paragraphs</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">paragraphs</span><span class="p">:</span> <span class="nb">list</span> <span class="o">=</span> <span class="p">[]):</span>
<span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Append multiple paragraphs at the end of the story.</span>
......@@ -1063,7 +1063,7 @@
<span class="k">else</span><span class="p">:</span>
<span class="k">return</span> <span class="kc">False</span></div>
<span class="k">def</span> <span class="nf">_append_paragraph</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">kwargs</span><span class="p">):</span>
<span class="k">def</span> <span class="nf">_append_paragraph</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">kwargs</span><span class="p">:</span> <span class="nb">dict</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Private method to append paragraph.</span>
......@@ -1160,7 +1160,7 @@
<span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Return the story as XML element.</span>
<span class="sd"> :rtype: lxml._Element</span>
<span class="sd"> :rtype: lxml.etree._Element</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="n">xml</span> <span class="o">=</span> <span class="n">ET</span><span class="o">.</span><span class="n">Element</span><span class="p">(</span><span class="s2">&quot;StoryText&quot;</span><span class="p">)</span>
......@@ -1171,12 +1171,12 @@
<span class="k">return</span> <span class="n">xml</span></div>
<div class="viewcode-block" id="Story.fromxml"><a class="viewcode-back" href="../../pyscribus.html#pyscribus.stories.Story.fromxml">[docs]</a> <span class="k">def</span> <span class="nf">fromxml</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">xml</span><span class="p">,</span> <span class="n">check_style</span><span class="o">=</span><span class="kc">True</span><span class="p">):</span>
<div class="viewcode-block" id="Story.fromxml"><a class="viewcode-back" href="../../pyscribus.html#pyscribus.stories.Story.fromxml">[docs]</a> <span class="k">def</span> <span class="nf">fromxml</span><span class="p">(</span><span class="bp">self</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">check_style</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="sd">&quot;&quot;&quot;</span>
<span class="sd"> Parses XML of a SLA Story.</span>
<span class="sd"> :type xml: lxml._Element</span>
<span class="sd"> :param xml: SLA Story as lxml._Element</span>
<span class="sd"> :type xml: lxml.etree._Element</span>
<span class="sd"> :param xml: SLA Story as lxml.etree._Element</span>
<span class="sd"> :type check_style: bool</span>
<span class="sd"> :param check_style: Check if story paragraphs use known paragraph </span>
<span class="sd"> styles of Story.doc_parent Document. True by default.</span>
......@@ -1302,7 +1302,7 @@
<span class="k">return</span> <span class="kc">True</span></div>
<div class="viewcode-block" id="Story.end_contents"><a class="viewcode-back" href="../../pyscribus.html#pyscribus.stories.Story.end_contents">[docs]</a> <span class="k">def</span> <span class="nf">end_contents</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">no_trailing_paragraph</span><span class="o">=</span><span class="kc">False</span><span class="p">):</span>
<div class="viewcode-block" id="Story.end_contents"><a class="viewcode-back" href="../../pyscribus.html#pyscribus.stories.Story.end_contents">[docs]</a> <span class="k">def</span> <span class="nf">end_contents</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">no_trailing_paragraph</span><span class="p">:</span> <span class="nb">bool</span> <span class="o">=</span> <span class="kc">False</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Ends the story&#39;s content by making sure that the story sequence</span>
<span class="sd"> is valid.</span>
......@@ -1422,8 +1422,6 @@
<span class="k">return</span> <span class="n">contents</span></div>
<div class="viewcode-block" id="Story.feed_templatable"><a class="viewcode-back" href="../../pyscribus.html#pyscribus.stories.Story.feed_templatable">[docs]</a> <span class="k">def</span> <span class="nf">feed_templatable</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">datas</span><span class="o">=</span><span class="p">{}):</span>
<span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="n">elements</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">templatable</span><span class="p">()</span>
......
This diff is collapsed.
This diff is collapsed.