--- a/src/eric7/Documentation/Source/eric7.EricUtilities.__init__.html Thu Sep 26 09:48:49 2024 +0200 +++ b/src/eric7/Documentation/Source/eric7.EricUtilities.__init__.html Thu Sep 26 15:49:36 2024 +0200 @@ -13,7 +13,11 @@ <h3>Global Attributes</h3> <table> -<tr><td>None</td></tr> +<tr><td>_configDir</td></tr> +<tr><td>_escape</td></tr> +<tr><td>_escape_map</td></tr> +<tr><td>_uescape</td></tr> +<tr><td>_uunescape</td></tr> </table> <h3>Classes</h3> @@ -28,6 +32,46 @@ <td>Function to generate a formatted size string.</td> </tr> <tr> +<td><a href="#decodeBytes">decodeBytes</a></td> +<td>Function to decode some byte text into a string.</td> +</tr> +<tr> +<td><a href="#decodeString">decodeString</a></td> +<td>Function to decode a string containing Unicode encoded characters.</td> +</tr> +<tr> +<td><a href="#escape_entities">escape_entities</a></td> +<td>Function to encode html entities.</td> +</tr> +<tr> +<td><a href="#escape_uentities">escape_uentities</a></td> +<td>Function to encode html entities.</td> +</tr> +<tr> +<td><a href="#getConfigDir">getConfigDir</a></td> +<td>Module function to get the name of the directory storing the config data.</td> +</tr> +<tr> +<td><a href="#html_encode">html_encode</a></td> +<td>Function to correctly encode a text for html.</td> +</tr> +<tr> +<td><a href="#html_udecode">html_udecode</a></td> +<td>Function to correctly decode a html text to a unicode text.</td> +</tr> +<tr> +<td><a href="#html_uencode">html_uencode</a></td> +<td>Function to correctly encode a unicode text for html.</td> +</tr> +<tr> +<td><a href="#readStringFromStream">readStringFromStream</a></td> +<td>Module function to read a string from the given stream.</td> +</tr> +<tr> +<td><a href="#setConfigDir">setConfigDir</a></td> +<td>Module function to set the name of the directory storing the config data.</td> +</tr> +<tr> <td><a href="#strGroup">strGroup</a></td> <td>Function to group a string into sub-strings separated by a separator.</td> </tr> @@ -52,6 +96,10 @@ <td>Function to convert a value to a list.</td> </tr> <tr> +<td><a href="#unescape_uentities">unescape_uentities</a></td> +<td>Function to decode html entities.</td> +</tr> +<tr> <td><a href="#versionIsValid">versionIsValid</a></td> <td>Function to check, if the given version string is valid.</td> </tr> @@ -96,6 +144,293 @@ <div align="right"><a href="#top">Up</a></div> <hr /> <hr /> +<a NAME="decodeBytes" ID="decodeBytes"></a> +<h2>decodeBytes</h2> +<b>decodeBytes</b>(<i>buffer</i>) +<p> + Function to decode some byte text into a string. +</p> + +<dl> + +<dt><i>buffer</i> (bytes)</dt> +<dd> +byte buffer to decode +</dd> +</dl> +<dl> +<dt>Return:</dt> +<dd> +decoded text +</dd> +</dl> +<dl> +<dt>Return Type:</dt> +<dd> +str +</dd> +</dl> +<div align="right"><a href="#top">Up</a></div> +<hr /> +<hr /> +<a NAME="decodeString" ID="decodeString"></a> +<h2>decodeString</h2> +<b>decodeString</b>(<i>text</i>) +<p> + Function to decode a string containing Unicode encoded characters. +</p> + +<dl> + +<dt><i>text</i> (str)</dt> +<dd> +text containing encoded chars +</dd> +</dl> +<dl> +<dt>Return:</dt> +<dd> +decoded text +</dd> +</dl> +<dl> +<dt>Return Type:</dt> +<dd> +str +</dd> +</dl> +<div align="right"><a href="#top">Up</a></div> +<hr /> +<hr /> +<a NAME="escape_entities" ID="escape_entities"></a> +<h2>escape_entities</h2> +<b>escape_entities</b>(<i>m, escmap=_escape_map</i>) +<p> + Function to encode html entities. +</p> + +<dl> + +<dt><i>m</i> (re.Match)</dt> +<dd> +the match object +</dd> +<dt><i>escmap</i> (dict)</dt> +<dd> +the map of entities to encode +</dd> +</dl> +<dl> +<dt>Return:</dt> +<dd> +the converted text +</dd> +</dl> +<dl> +<dt>Return Type:</dt> +<dd> +str +</dd> +</dl> +<div align="right"><a href="#top">Up</a></div> +<hr /> +<hr /> +<a NAME="escape_uentities" ID="escape_uentities"></a> +<h2>escape_uentities</h2> +<b>escape_uentities</b>(<i>m</i>) +<p> + Function to encode html entities. +</p> + +<dl> + +<dt><i>m</i> (re.Match)</dt> +<dd> +the match object +</dd> +</dl> +<dl> +<dt>Return:</dt> +<dd> +the converted text +</dd> +</dl> +<dl> +<dt>Return Type:</dt> +<dd> +str +</dd> +</dl> +<div align="right"><a href="#top">Up</a></div> +<hr /> +<hr /> +<a NAME="getConfigDir" ID="getConfigDir"></a> +<h2>getConfigDir</h2> +<b>getConfigDir</b>(<i></i>) +<p> + Module function to get the name of the directory storing the config data. +</p> + +<dl> +<dt>Return:</dt> +<dd> +directory name of the config dir +</dd> +</dl> +<dl> +<dt>Return Type:</dt> +<dd> +str +</dd> +</dl> +<div align="right"><a href="#top">Up</a></div> +<hr /> +<hr /> +<a NAME="html_encode" ID="html_encode"></a> +<h2>html_encode</h2> +<b>html_encode</b>(<i>text, pattern=_escape</i>) +<p> + Function to correctly encode a text for html. +</p> + +<dl> + +<dt><i>text</i> (str)</dt> +<dd> +text to be encoded +</dd> +<dt><i>pattern</i> (str)</dt> +<dd> +search pattern for text to be encoded +</dd> +</dl> +<dl> +<dt>Return:</dt> +<dd> +the encoded text +</dd> +</dl> +<dl> +<dt>Return Type:</dt> +<dd> +str +</dd> +</dl> +<div align="right"><a href="#top">Up</a></div> +<hr /> +<hr /> +<a NAME="html_udecode" ID="html_udecode"></a> +<h2>html_udecode</h2> +<b>html_udecode</b>(<i>text, pattern=_uunescape</i>) +<p> + Function to correctly decode a html text to a unicode text. +</p> + +<dl> + +<dt><i>text</i> (str)</dt> +<dd> +text to be decoded +</dd> +<dt><i>pattern</i> (str)</dt> +<dd> +search pattern for text to be decoded +</dd> +</dl> +<dl> +<dt>Return:</dt> +<dd> +the decoded text +</dd> +</dl> +<dl> +<dt>Return Type:</dt> +<dd> +str +</dd> +</dl> +<div align="right"><a href="#top">Up</a></div> +<hr /> +<hr /> +<a NAME="html_uencode" ID="html_uencode"></a> +<h2>html_uencode</h2> +<b>html_uencode</b>(<i>text, pattern=_uescape</i>) +<p> + Function to correctly encode a unicode text for html. +</p> + +<dl> + +<dt><i>text</i> (str)</dt> +<dd> +text to be encoded +</dd> +<dt><i>pattern</i> (str)</dt> +<dd> +search pattern for text to be encoded +</dd> +</dl> +<dl> +<dt>Return:</dt> +<dd> +the encoded text +</dd> +</dl> +<dl> +<dt>Return Type:</dt> +<dd> +str +</dd> +</dl> +<div align="right"><a href="#top">Up</a></div> +<hr /> +<hr /> +<a NAME="readStringFromStream" ID="readStringFromStream"></a> +<h2>readStringFromStream</h2> +<b>readStringFromStream</b>(<i>stream</i>) +<p> + Module function to read a string from the given stream. +</p> + +<dl> + +<dt><i>stream</i> (QDataStream)</dt> +<dd> +data stream opened for reading +</dd> +</dl> +<dl> +<dt>Return:</dt> +<dd> +string read from the stream +</dd> +</dl> +<dl> +<dt>Return Type:</dt> +<dd> +str +</dd> +</dl> +<div align="right"><a href="#top">Up</a></div> +<hr /> +<hr /> +<a NAME="setConfigDir" ID="setConfigDir"></a> +<h2>setConfigDir</h2> +<b>setConfigDir</b>(<i>d</i>) +<p> + Module function to set the name of the directory storing the config data. +</p> + +<dl> + +<dt><i>d</i> (str)</dt> +<dd> +name of an existing directory +</dd> +</dl> +<div align="right"><a href="#top">Up</a></div> +<hr /> +<hr /> <a NAME="strGroup" ID="strGroup"></a> <h2>strGroup</h2> <b>strGroup</b>(<i>txt, sep, groupLen=4</i>) @@ -279,6 +614,35 @@ <div align="right"><a href="#top">Up</a></div> <hr /> <hr /> +<a NAME="unescape_uentities" ID="unescape_uentities"></a> +<h2>unescape_uentities</h2> +<b>unescape_uentities</b>(<i>m</i>) +<p> + Function to decode html entities. +</p> + +<dl> + +<dt><i>m</i> (re.Match)</dt> +<dd> +the match object +</dd> +</dl> +<dl> +<dt>Return:</dt> +<dd> +the converted text +</dd> +</dl> +<dl> +<dt>Return Type:</dt> +<dd> +str +</dd> +</dl> +<div align="right"><a href="#top">Up</a></div> +<hr /> +<hr /> <a NAME="versionIsValid" ID="versionIsValid"></a> <h2>versionIsValid</h2> <b>versionIsValid</b>(<i>version</i>)