Linux ip-148-66-134-25.ip.secureserver.net 3.10.0-1160.119.1.el7.tuxcare.els10.x86_64 #1 SMP Fri Oct 11 21:40:41 UTC 2024 x86_64
Apache
: 148.66.134.25 | : 3.14.132.178
66 Domain
8.0.30
amvm
www.github.com/MadExploits
Terminal
AUTO ROOT
Adminer
Backdoor Destroyer
Linux Exploit
Lock Shell
Lock File
Create User
CREATE RDP
PHP Mailer
BACKCONNECT
UNLOCK SHELL
HASH IDENTIFIER
CPANEL RESET
BLACK DEFEND!
README
+ Create Folder
+ Create File
/
usr /
share /
doc /
python-babel-0.9.6 /
doc /
api /
[ HOME SHELL ]
Name
Size
Permission
Action
api-objects.txt
28.73
KB
-rw-r--r--
babel-module.html
8.79
KB
-rw-r--r--
babel.core-module.html
23.42
KB
-rw-r--r--
babel.core.Locale-class.html
67.38
KB
-rw-r--r--
babel.core.UnknownLocaleError-...
7.81
KB
-rw-r--r--
babel.dates-module.html
34.05
KB
-rw-r--r--
babel.localedata-module.html
10.42
KB
-rw-r--r--
babel.messages-module.html
6.66
KB
-rw-r--r--
babel.messages.catalog-module....
5
KB
-rw-r--r--
babel.messages.catalog.Catalog...
48.08
KB
-rw-r--r--
babel.messages.catalog.Message...
19.95
KB
-rw-r--r--
babel.messages.catalog.Transla...
6.08
KB
-rw-r--r--
babel.messages.checkers-module...
6.48
KB
-rw-r--r--
babel.messages.extract-module....
27.71
KB
-rw-r--r--
babel.messages.frontend-module...
9.14
KB
-rw-r--r--
babel.messages.frontend.Comman...
17.97
KB
-rw-r--r--
babel.messages.frontend.compil...
18
KB
-rw-r--r--
babel.messages.frontend.extrac...
19.74
KB
-rw-r--r--
babel.messages.frontend.init_c...
17.69
KB
-rw-r--r--
babel.messages.frontend.update...
18.76
KB
-rw-r--r--
babel.messages.jslexer-module....
24.12
KB
-rw-r--r--
babel.messages.jslexer.Token-c...
11.49
KB
-rw-r--r--
babel.messages.mofile-module.h...
9.78
KB
-rw-r--r--
babel.messages.plurals-module....
13.51
KB
-rw-r--r--
babel.messages.pofile-module.h...
15.93
KB
-rw-r--r--
babel.numbers-module.html
26.44
KB
-rw-r--r--
babel.numbers.NumberFormatErro...
6.19
KB
-rw-r--r--
babel.support-module.html
5.08
KB
-rw-r--r--
babel.support.Format-class.htm...
22.92
KB
-rw-r--r--
babel.support.LazyProxy-class....
27.34
KB
-rw-r--r--
babel.support.Translations-cla...
22.91
KB
-rw-r--r--
babel.util-module.html
14.88
KB
-rw-r--r--
babel.util.odict-class.html
28.24
KB
-rw-r--r--
class-tree.html
9.4
KB
-rw-r--r--
crarr.png
340
B
-rw-r--r--
epydoc.css
5.53
KB
-rw-r--r--
epydoc.js
10.33
KB
-rw-r--r--
help.html
10.6
KB
-rw-r--r--
identifier-index.html
74.71
KB
-rw-r--r--
index.html
8.79
KB
-rw-r--r--
module-tree.html
6.73
KB
-rw-r--r--
redirect.html
1.89
KB
-rw-r--r--
since-index.html
6.37
KB
-rw-r--r--
Delete
Unzip
Zip
${this.title}
Close
Code Editor : babel.messages.catalog.Catalog-class.html
<?xml version="1.0" encoding="ascii"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <title>babel.messages.catalog.Catalog</title> <link rel="stylesheet" href="epydoc.css" type="text/css" /> <script type="text/javascript" src="epydoc.js"></script> </head> <body bgcolor="white" text="black" link="blue" vlink="#204080" alink="#204080"> <!-- ==================== NAVIGATION BAR ==================== --> <table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0"> <tr valign="middle"> <!-- Home link --> <th> <a href="babel-module.html">Home</a> </th> <!-- Tree link --> <th> <a href="module-tree.html">Trees</a> </th> <!-- Index link --> <th> <a href="identifier-index.html">Indices</a> </th> <!-- Help link --> <th> <a href="help.html">Help</a> </th> <!-- Project homepage --> <th class="navbar" align="right" width="100%"> <table border="0" cellpadding="0" cellspacing="0"> <tr><th class="navbar" align="center" ><a class="navbar" target="_top" href="../index.html">Documentation Index</a></th> </tr></table></th> </tr> </table> <table width="100%" cellpadding="0" cellspacing="0"> <tr valign="top"> <td width="100%"> <span class="breadcrumbs"> <a href="babel-module.html">Package babel</a> :: <a href="babel.messages-module.html">Package messages</a> :: <a href="babel.messages.catalog-module.html">Module catalog</a> :: Class Catalog </span> </td> <td> <table cellpadding="0" cellspacing="0"> <!-- hide/show private --> </table> </td> </tr> </table> <!-- ==================== CLASS DESCRIPTION ==================== --> <h1 class="epydoc">Class Catalog</h1><p class="nomargin-top"></p> <pre class="base-tree"> object --+ | <strong class="uidshort">Catalog</strong> </pre> <hr /> Representation of a message catalog. <!-- ==================== INSTANCE METHODS ==================== --> <a name="section-InstanceMethods"></a> <table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> <tr bgcolor="#70b0f0" class="table-header"> <td align="left" colspan="2" class="table-header"> <span class="table-header">Instance Methods</span></td> </tr> <tr> <td width="15%" align="right" valign="top" class="summary"> <span class="summary-type"> </span> </td><td class="summary"> <table width="100%" cellpadding="0" cellspacing="0" border="0"> <tr> <td><span class="summary-sig"><a href="babel.messages.catalog.Catalog-class.html#__init__" class="summary-sig-name">__init__</a>(<span class="summary-sig-arg">self</span>, <span class="summary-sig-arg">locale</span>=<span class="summary-sig-default">None</span>, <span class="summary-sig-arg">domain</span>=<span class="summary-sig-default">None</span>, <span class="summary-sig-arg">header_comment</span>=<span class="summary-sig-default"><code class="variable-quote">u'</code><code class="variable-string"># Translations template for PROJE</code><code class="variable-ellipsis">...</code></span>, <span class="summary-sig-arg">project</span>=<span class="summary-sig-default">None</span>, <span class="summary-sig-arg">version</span>=<span class="summary-sig-default">None</span>, <span class="summary-sig-arg">copyright_holder</span>=<span class="summary-sig-default">None</span>, <span class="summary-sig-arg">msgid_bugs_address</span>=<span class="summary-sig-default">None</span>, <span class="summary-sig-arg">creation_date</span>=<span class="summary-sig-default">None</span>, <span class="summary-sig-arg">revision_date</span>=<span class="summary-sig-default">None</span>, <span class="summary-sig-arg">last_translator</span>=<span class="summary-sig-default">None</span>, <span class="summary-sig-arg">language_team</span>=<span class="summary-sig-default">None</span>, <span class="summary-sig-arg">charset</span>=<span class="summary-sig-default"><code class="variable-quote">'</code><code class="variable-string">utf-8</code><code class="variable-quote">'</code></span>, <span class="summary-sig-arg">fuzzy</span>=<span class="summary-sig-default">True</span>)</span><br /> Initialize the catalog object.</td> <td align="right" valign="top"> </td> </tr> </table> </td> </tr> <tr> <td width="15%" align="right" valign="top" class="summary"> <span class="summary-type"> </span> </td><td class="summary"> <table width="100%" cellpadding="0" cellspacing="0" border="0"> <tr> <td><span class="summary-sig"><a name="__contains__"></a><span class="summary-sig-name">__contains__</span>(<span class="summary-sig-arg">self</span>, <span class="summary-sig-arg">id</span>)</span><br /> Return whether the catalog has a message with the specified ID.</td> <td align="right" valign="top"> </td> </tr> </table> </td> </tr> <tr> <td width="15%" align="right" valign="top" class="summary"> <span class="summary-type"> </span> </td><td class="summary"> <table width="100%" cellpadding="0" cellspacing="0" border="0"> <tr> <td><span class="summary-sig"><a href="babel.messages.catalog.Catalog-class.html#__len__" class="summary-sig-name">__len__</a>(<span class="summary-sig-arg">self</span>)</span><br /> The number of messages in the catalog.</td> <td align="right" valign="top"> </td> </tr> </table> </td> </tr> <tr> <td width="15%" align="right" valign="top" class="summary"> <span class="summary-type"><tt class="rst-docutils literal">iterator</tt></span> </td><td class="summary"> <table width="100%" cellpadding="0" cellspacing="0" border="0"> <tr> <td><span class="summary-sig"><a name="__iter__"></a><span class="summary-sig-name">__iter__</span>(<span class="summary-sig-arg">self</span>)</span><br /> Iterates through all the entries in the catalog, in the order they were added, yielding a <a href="babel.messages.catalog.Message-class.html" class="link">Message</a> object for every entry.</td> <td align="right" valign="top"> </td> </tr> </table> </td> </tr> <tr> <td width="15%" align="right" valign="top" class="summary"> <span class="summary-type"> </span> </td><td class="summary"> <table width="100%" cellpadding="0" cellspacing="0" border="0"> <tr> <td><span class="summary-sig"><a href="babel.messages.catalog.Catalog-class.html#__repr__" class="summary-sig-name">__repr__</a>(<span class="summary-sig-arg">self</span>)</span><br /> repr(x)</td> <td align="right" valign="top"> </td> </tr> </table> </td> </tr> <tr> <td width="15%" align="right" valign="top" class="summary"> <span class="summary-type"> </span> </td><td class="summary"> <table width="100%" cellpadding="0" cellspacing="0" border="0"> <tr> <td><span class="summary-sig"><a name="__delitem__"></a><span class="summary-sig-name">__delitem__</span>(<span class="summary-sig-arg">self</span>, <span class="summary-sig-arg">id</span>)</span><br /> Delete the message with the specified ID.</td> <td align="right" valign="top"> </td> </tr> </table> </td> </tr> <tr> <td width="15%" align="right" valign="top" class="summary"> <span class="summary-type"><a href="babel.messages.catalog.Message-class.html" class="link">Message</a></span> </td><td class="summary"> <table width="100%" cellpadding="0" cellspacing="0" border="0"> <tr> <td><span class="summary-sig"><a href="babel.messages.catalog.Catalog-class.html#__getitem__" class="summary-sig-name">__getitem__</a>(<span class="summary-sig-arg">self</span>, <span class="summary-sig-arg">id</span>)</span><br /> Return the message with the specified ID.</td> <td align="right" valign="top"> </td> </tr> </table> </td> </tr> <tr> <td width="15%" align="right" valign="top" class="summary"> <span class="summary-type"> </span> </td><td class="summary"> <table width="100%" cellpadding="0" cellspacing="0" border="0"> <tr> <td><span class="summary-sig"><a href="babel.messages.catalog.Catalog-class.html#__setitem__" class="summary-sig-name">__setitem__</a>(<span class="summary-sig-arg">self</span>, <span class="summary-sig-arg">id</span>, <span class="summary-sig-arg">message</span>)</span><br /> Add or update the message with the specified ID.</td> <td align="right" valign="top"> </td> </tr> </table> </td> </tr> <tr> <td width="15%" align="right" valign="top" class="summary"> <span class="summary-type"> </span> </td><td class="summary"> <table width="100%" cellpadding="0" cellspacing="0" border="0"> <tr> <td><span class="summary-sig"><a href="babel.messages.catalog.Catalog-class.html#add" class="summary-sig-name">add</a>(<span class="summary-sig-arg">self</span>, <span class="summary-sig-arg">id</span>, <span class="summary-sig-arg">string</span>=<span class="summary-sig-default">None</span>, <span class="summary-sig-arg">locations</span>=<span class="summary-sig-default"><code class="variable-group">(</code><code class="variable-group">)</code></span>, <span class="summary-sig-arg">flags</span>=<span class="summary-sig-default"><code class="variable-group">(</code><code class="variable-group">)</code></span>, <span class="summary-sig-arg">auto_comments</span>=<span class="summary-sig-default"><code class="variable-group">(</code><code class="variable-group">)</code></span>, <span class="summary-sig-arg">user_comments</span>=<span class="summary-sig-default"><code class="variable-group">(</code><code class="variable-group">)</code></span>, <span class="summary-sig-arg">previous_id</span>=<span class="summary-sig-default"><code class="variable-group">(</code><code class="variable-group">)</code></span>, <span class="summary-sig-arg">lineno</span>=<span class="summary-sig-default">None</span>)</span><br /> Add or update the message with the specified ID.</td> <td align="right" valign="top"> </td> </tr> </table> </td> </tr> <tr> <td width="15%" align="right" valign="top" class="summary"> <span class="summary-type"><tt class="rst-docutils literal">iterator</tt></span> </td><td class="summary"> <table width="100%" cellpadding="0" cellspacing="0" border="0"> <tr> <td><span class="summary-sig"><a href="babel.messages.catalog.Catalog-class.html#check" class="summary-sig-name">check</a>(<span class="summary-sig-arg">self</span>)</span><br /> Run various validation checks on the translations in the catalog.</td> <td align="right" valign="top"> </td> </tr> </table> </td> </tr> <tr> <td width="15%" align="right" valign="top" class="summary"> <span class="summary-type"> </span> </td><td class="summary"> <table width="100%" cellpadding="0" cellspacing="0" border="0"> <tr> <td><span class="summary-sig"><a href="babel.messages.catalog.Catalog-class.html#update" class="summary-sig-name">update</a>(<span class="summary-sig-arg">self</span>, <span class="summary-sig-arg">template</span>, <span class="summary-sig-arg">no_fuzzy_matching</span>=<span class="summary-sig-default">False</span>)</span><br /> Update the catalog based on the given template catalog.</td> <td align="right" valign="top"> </td> </tr> </table> </td> </tr> <tr> <td colspan="2" class="summary"> <p class="indent-wrapped-lines"><b>Inherited from <code>object</code></b>: <code>__delattr__</code>, <code>__format__</code>, <code>__getattribute__</code>, <code>__hash__</code>, <code>__new__</code>, <code>__reduce__</code>, <code>__reduce_ex__</code>, <code>__setattr__</code>, <code>__sizeof__</code>, <code>__str__</code>, <code>__subclasshook__</code> </p> </td> </tr> </table> <!-- ==================== INSTANCE VARIABLES ==================== --> <a name="section-InstanceVariables"></a> <table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> <tr bgcolor="#70b0f0" class="table-header"> <td align="left" colspan="2" class="table-header"> <span class="table-header">Instance Variables</span></td> </tr> <tr> <td width="15%" align="right" valign="top" class="summary"> <span class="summary-type"> </span> </td><td class="summary"> <a name="domain"></a><span class="summary-name">domain</span><br /> The message domain </td> </tr> <tr> <td width="15%" align="right" valign="top" class="summary"> <span class="summary-type"> </span> </td><td class="summary"> <a name="locale"></a><span class="summary-name">locale</span><br /> The locale or <code class="link">None</code> </td> </tr> <tr> <td width="15%" align="right" valign="top" class="summary"> <span class="summary-type"> </span> </td><td class="summary"> <a name="project"></a><span class="summary-name">project</span><br /> The project name </td> </tr> <tr> <td width="15%" align="right" valign="top" class="summary"> <span class="summary-type"> </span> </td><td class="summary"> <a name="version"></a><span class="summary-name">version</span><br /> The project version </td> </tr> <tr> <td width="15%" align="right" valign="top" class="summary"> <span class="summary-type"> </span> </td><td class="summary"> <a name="last_translator"></a><span class="summary-name">last_translator</span><br /> Name and email address of the last translator. </td> </tr> <tr> <td width="15%" align="right" valign="top" class="summary"> <span class="summary-type"> </span> </td><td class="summary"> <a name="language_team"></a><span class="summary-name">language_team</span><br /> Name and email address of the language team. </td> </tr> <tr> <td width="15%" align="right" valign="top" class="summary"> <span class="summary-type"> </span> </td><td class="summary"> <a name="creation_date"></a><span class="summary-name">creation_date</span><br /> Creation date of the template </td> </tr> <tr> <td width="15%" align="right" valign="top" class="summary"> <span class="summary-type"> </span> </td><td class="summary"> <a name="revision_date"></a><span class="summary-name">revision_date</span><br /> Last revision date of the catalog </td> </tr> <tr> <td width="15%" align="right" valign="top" class="summary"> <span class="summary-type"> </span> </td><td class="summary"> <a name="fuzzy"></a><span class="summary-name">fuzzy</span><br /> Catalog header fuzzy bit (<code class="link">True</code> or <code class="link">False</code>) </td> </tr> <tr> <td width="15%" align="right" valign="top" class="summary"> <span class="summary-type"> </span> </td><td class="summary"> <a name="obsolete"></a><span class="summary-name">obsolete</span><br /> Dictionary of obsolete messages </td> </tr> </table> <!-- ==================== PROPERTIES ==================== --> <a name="section-Properties"></a> <table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> <tr bgcolor="#70b0f0" class="table-header"> <td align="left" colspan="2" class="table-header"> <span class="table-header">Properties</span></td> </tr> <tr> <td width="15%" align="right" valign="top" class="summary"> <span class="summary-type"><code class="link">unicode</code></span> </td><td class="summary"> <a href="babel.messages.catalog.Catalog-class.html#header_comment" class="summary-name">header_comment</a><br /> The header comment for the catalog. </td> </tr> <tr> <td width="15%" align="right" valign="top" class="summary"> <span class="summary-type"><code class="link">list</code></span> </td><td class="summary"> <a href="babel.messages.catalog.Catalog-class.html#mime_headers" class="summary-name">mime_headers</a><br /> The MIME headers of the catalog, used for the special <tt class="rst-docutils literal">msgid ""</tt> entry. </td> </tr> <tr> <td width="15%" align="right" valign="top" class="summary"> <span class="summary-type"><code class="link">int</code></span> </td><td class="summary"> <a href="babel.messages.catalog.Catalog-class.html#num_plurals" class="summary-name">num_plurals</a><br /> The number of plurals used by the catalog or locale. </td> </tr> <tr> <td width="15%" align="right" valign="top" class="summary"> <span class="summary-type"><code class="link">basestring</code></span> </td><td class="summary"> <a href="babel.messages.catalog.Catalog-class.html#plural_expr" class="summary-name">plural_expr</a><br /> The plural expression used by the catalog or locale. </td> </tr> <tr> <td width="15%" align="right" valign="top" class="summary"> <span class="summary-type"><code class="link">str</code></span> </td><td class="summary"> <a href="babel.messages.catalog.Catalog-class.html#plural_forms" class="summary-name">plural_forms</a><br /> Return the plural forms declaration for the locale. </td> </tr> <tr> <td colspan="2" class="summary"> <p class="indent-wrapped-lines"><b>Inherited from <code>object</code></b>: <code>__class__</code> </p> </td> </tr> </table> <!-- ==================== METHOD DETAILS ==================== --> <a name="section-MethodDetails"></a> <table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> <tr bgcolor="#70b0f0" class="table-header"> <td align="left" colspan="2" class="table-header"> <span class="table-header">Method Details</span></td> </tr> </table> <a name="__init__"></a> <div> <table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> <tr><td> <table width="100%" cellpadding="0" cellspacing="0" border="0"> <tr valign="top"><td> <h3 class="epydoc"><span class="sig"><span class="sig-name">__init__</span>(<span class="sig-arg">self</span>, <span class="sig-arg">locale</span>=<span class="sig-default">None</span>, <span class="sig-arg">domain</span>=<span class="sig-default">None</span>, <span class="sig-arg">header_comment</span>=<span class="sig-default"><code class="variable-quote">u'</code><code class="variable-string"># Translations template for PROJE</code><code class="variable-ellipsis">...</code></span>, <span class="sig-arg">project</span>=<span class="sig-default">None</span>, <span class="sig-arg">version</span>=<span class="sig-default">None</span>, <span class="sig-arg">copyright_holder</span>=<span class="sig-default">None</span>, <span class="sig-arg">msgid_bugs_address</span>=<span class="sig-default">None</span>, <span class="sig-arg">creation_date</span>=<span class="sig-default">None</span>, <span class="sig-arg">revision_date</span>=<span class="sig-default">None</span>, <span class="sig-arg">last_translator</span>=<span class="sig-default">None</span>, <span class="sig-arg">language_team</span>=<span class="sig-default">None</span>, <span class="sig-arg">charset</span>=<span class="sig-default"><code class="variable-quote">'</code><code class="variable-string">utf-8</code><code class="variable-quote">'</code></span>, <span class="sig-arg">fuzzy</span>=<span class="sig-default">True</span>)</span> <br /><em class="fname">(Constructor)</em> </h3> </td><td align="right" valign="top" > </td> </tr></table> Initialize the catalog object. <dl class="fields"> <dt>Parameters:</dt> <dd><ul class="nomargin-top"> <li><strong class="pname"><code>locale</code></strong> - the locale identifier or <a href="babel.core.Locale-class.html" class="link">Locale</a> object, or <code class="link">None</code> if the catalog is not bound to a locale (which basically means it's a template)</li> <li><strong class="pname"><code>domain</code></strong> - the message domain</li> <li><strong class="pname"><code>header_comment</code></strong> - the header comment as string, or <code class="link">None</code> for the default header</li> <li><strong class="pname"><code>project</code></strong> - the project's name</li> <li><strong class="pname"><code>version</code></strong> - the project's version</li> <li><strong class="pname"><code>copyright_holder</code></strong> - the copyright holder of the catalog</li> <li><strong class="pname"><code>msgid_bugs_address</code></strong> - the email address or URL to submit bug reports to</li> <li><strong class="pname"><code>creation_date</code></strong> - the date the catalog was created</li> <li><strong class="pname"><code>revision_date</code></strong> - the date the catalog was revised</li> <li><strong class="pname"><code>last_translator</code></strong> - the name and email of the last translator</li> <li><strong class="pname"><code>language_team</code></strong> - the name and email of the language team</li> <li><strong class="pname"><code>charset</code></strong> - the encoding to use in the output</li> <li><strong class="pname"><code>fuzzy</code></strong> - the fuzzy bit on the catalog header</li> </ul></dd> <dt>Overrides: object.__init__ </dt> </dl> </td></tr></table> </div> <a name="__len__"></a> <div> <table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> <tr><td> <table width="100%" cellpadding="0" cellspacing="0" border="0"> <tr valign="top"><td> <h3 class="epydoc"><span class="sig"><span class="sig-name">__len__</span>(<span class="sig-arg">self</span>)</span> <br /><em class="fname">(Length operator)</em> </h3> </td><td align="right" valign="top" > </td> </tr></table> <p>The number of messages in the catalog.</p> <p>This does not include the special <tt class="rst-docutils literal">msgid ""</tt> entry.</p> <dl class="fields"> </dl> </td></tr></table> </div> <a name="__repr__"></a> <div> <table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> <tr><td> <table width="100%" cellpadding="0" cellspacing="0" border="0"> <tr valign="top"><td> <h3 class="epydoc"><span class="sig"><span class="sig-name">__repr__</span>(<span class="sig-arg">self</span>)</span> <br /><em class="fname">(Representation operator)</em> </h3> </td><td align="right" valign="top" > </td> </tr></table> repr(x) <dl class="fields"> <dt>Overrides: object.__repr__ <dd><em class="note">(inherited documentation)</em></dd> </dt> </dl> </td></tr></table> </div> <a name="__getitem__"></a> <div> <table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> <tr><td> <table width="100%" cellpadding="0" cellspacing="0" border="0"> <tr valign="top"><td> <h3 class="epydoc"><span class="sig"><span class="sig-name">__getitem__</span>(<span class="sig-arg">self</span>, <span class="sig-arg">id</span>)</span> <br /><em class="fname">(Indexing operator)</em> </h3> </td><td align="right" valign="top" > </td> </tr></table> Return the message with the specified ID. <dl class="fields"> <dt>Parameters:</dt> <dd><ul class="nomargin-top"> <li><strong class="pname"><code>id</code></strong> - the message ID</li> </ul></dd> <dt>Returns: <a href="babel.messages.catalog.Message-class.html" class="link">Message</a></dt> <dd>the message with the specified ID, or <code class="link">None</code> if no such message is in the catalog</dd> </dl> </td></tr></table> </div> <a name="__setitem__"></a> <div> <table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> <tr><td> <table width="100%" cellpadding="0" cellspacing="0" border="0"> <tr valign="top"><td> <h3 class="epydoc"><span class="sig"><span class="sig-name">__setitem__</span>(<span class="sig-arg">self</span>, <span class="sig-arg">id</span>, <span class="sig-arg">message</span>)</span> <br /><em class="fname">(Index assignment operator)</em> </h3> </td><td align="right" valign="top" > </td> </tr></table> <p>Add or update the message with the specified ID.</p> <pre class="py-doctest"> <span class="py-prompt">>>> </span>catalog = Catalog() <span class="py-prompt">>>> </span>catalog[u<span class="py-string">'foo'</span>] = Message(u<span class="py-string">'foo'</span>) <span class="py-prompt">>>> </span>catalog[u<span class="py-string">'foo'</span>] <span class="py-output"><Message u'foo' (flags: [])></span></pre> <p>If a message with that ID is already in the catalog, it is updated to include the locations and flags of the new message.</p> <pre class="py-doctest"> <span class="py-prompt">>>> </span>catalog = Catalog() <span class="py-prompt">>>> </span>catalog[u<span class="py-string">'foo'</span>] = Message(u<span class="py-string">'foo'</span>, locations=[(<span class="py-string">'main.py'</span>, 1)]) <span class="py-prompt">>>> </span>catalog[u<span class="py-string">'foo'</span>].locations <span class="py-output">[('main.py', 1)]</span> <span class="py-output"></span><span class="py-prompt">>>> </span>catalog[u<span class="py-string">'foo'</span>] = Message(u<span class="py-string">'foo'</span>, locations=[(<span class="py-string">'utils.py'</span>, 5)]) <span class="py-prompt">>>> </span>catalog[u<span class="py-string">'foo'</span>].locations <span class="py-output">[('main.py', 1), ('utils.py', 5)]</span></pre> <dl class="fields"> <dt>Parameters:</dt> <dd><ul class="nomargin-top"> <li><strong class="pname"><code>id</code></strong> - the message ID</li> <li><strong class="pname"><code>message</code></strong> - the <a href="babel.messages.catalog.Message-class.html" class="link">Message</a> object</li> </ul></dd> </dl> </td></tr></table> </div> <a name="add"></a> <div> <table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> <tr><td> <table width="100%" cellpadding="0" cellspacing="0" border="0"> <tr valign="top"><td> <h3 class="epydoc"><span class="sig"><span class="sig-name">add</span>(<span class="sig-arg">self</span>, <span class="sig-arg">id</span>, <span class="sig-arg">string</span>=<span class="sig-default">None</span>, <span class="sig-arg">locations</span>=<span class="sig-default"><code class="variable-group">(</code><code class="variable-group">)</code></span>, <span class="sig-arg">flags</span>=<span class="sig-default"><code class="variable-group">(</code><code class="variable-group">)</code></span>, <span class="sig-arg">auto_comments</span>=<span class="sig-default"><code class="variable-group">(</code><code class="variable-group">)</code></span>, <span class="sig-arg">user_comments</span>=<span class="sig-default"><code class="variable-group">(</code><code class="variable-group">)</code></span>, <span class="sig-arg">previous_id</span>=<span class="sig-default"><code class="variable-group">(</code><code class="variable-group">)</code></span>, <span class="sig-arg">lineno</span>=<span class="sig-default">None</span>)</span> </h3> </td><td align="right" valign="top" > </td> </tr></table> <p>Add or update the message with the specified ID.</p> <pre class="py-doctest"> <span class="py-prompt">>>> </span>catalog = Catalog() <span class="py-prompt">>>> </span>catalog.add(u<span class="py-string">'foo'</span>) <span class="py-prompt">>>> </span>catalog[u<span class="py-string">'foo'</span>] <span class="py-output"><Message u'foo' (flags: [])></span></pre> <p>This method simply constructs a <a href="babel.messages.catalog.Message-class.html" class="link">Message</a> object with the given arguments and invokes <a href="babel.messages.catalog.Catalog-class.html#__setitem__" class="link">__setitem__</a> with that object.</p> <dl class="fields"> <dt>Parameters:</dt> <dd><ul class="nomargin-top"> <li><strong class="pname"><code>id</code></strong> - the message ID, or a <tt class="rst-docutils literal">(singular, plural)</tt> tuple for pluralizable messages</li> <li><strong class="pname"><code>string</code></strong> - the translated message string, or a <tt class="rst-docutils literal">(singular, plural)</tt> tuple for pluralizable messages</li> <li><strong class="pname"><code>locations</code></strong> - a sequence of <tt class="rst-docutils literal">(filenname, lineno)</tt> tuples</li> <li><strong class="pname"><code>flags</code></strong> - a set or sequence of flags</li> <li><strong class="pname"><code>auto_comments</code></strong> - a sequence of automatic comments</li> <li><strong class="pname"><code>user_comments</code></strong> - a sequence of user comments</li> <li><strong class="pname"><code>previous_id</code></strong> - the previous message ID, or a <tt class="rst-docutils literal">(singular, plural)</tt> tuple for pluralizable messages</li> <li><strong class="pname"><code>lineno</code></strong> - the line number on which the msgid line was found in the PO file, if any</li> </ul></dd> </dl> </td></tr></table> </div> <a name="check"></a> <div> <table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> <tr><td> <table width="100%" cellpadding="0" cellspacing="0" border="0"> <tr valign="top"><td> <h3 class="epydoc"><span class="sig"><span class="sig-name">check</span>(<span class="sig-arg">self</span>)</span> </h3> </td><td align="right" valign="top" > </td> </tr></table> <p>Run various validation checks on the translations in the catalog.</p> <p>For every message which fails validation, this method yield a <tt class="rst-docutils literal">(message, errors)</tt> tuple, where <tt class="rst-docutils literal">message</tt> is the <a href="babel.messages.catalog.Message-class.html" class="link">Message</a> object and <tt class="rst-docutils literal">errors</tt> is a sequence of <a href="babel.messages.catalog.TranslationError-class.html" class="link">TranslationError</a> objects.</p> <dl class="fields"> <dt>Returns: <tt class="rst-rst-docutils literal rst-docutils literal">iterator</tt></dt> </dl> </td></tr></table> </div> <a name="update"></a> <div> <table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> <tr><td> <table width="100%" cellpadding="0" cellspacing="0" border="0"> <tr valign="top"><td> <h3 class="epydoc"><span class="sig"><span class="sig-name">update</span>(<span class="sig-arg">self</span>, <span class="sig-arg">template</span>, <span class="sig-arg">no_fuzzy_matching</span>=<span class="sig-default">False</span>)</span> </h3> </td><td align="right" valign="top" > </td> </tr></table> <p>Update the catalog based on the given template catalog.</p> <pre class="py-doctest"> <span class="py-prompt">>>> </span><span class="py-keyword">from</span> babel.messages <span class="py-keyword">import</span> Catalog <span class="py-prompt">>>> </span>template = Catalog() <span class="py-prompt">>>> </span>template.add(<span class="py-string">'green'</span>, locations=[(<span class="py-string">'main.py'</span>, 99)]) <span class="py-prompt">>>> </span>template.add(<span class="py-string">'blue'</span>, locations=[(<span class="py-string">'main.py'</span>, 100)]) <span class="py-prompt">>>> </span>template.add((<span class="py-string">'salad'</span>, <span class="py-string">'salads'</span>), locations=[(<span class="py-string">'util.py'</span>, 42)]) <span class="py-prompt">>>> </span>catalog = Catalog(locale=<span class="py-string">'de_DE'</span>) <span class="py-prompt">>>> </span>catalog.add(<span class="py-string">'blue'</span>, u<span class="py-string">'blau'</span>, locations=[(<span class="py-string">'main.py'</span>, 98)]) <span class="py-prompt">>>> </span>catalog.add(<span class="py-string">'head'</span>, u<span class="py-string">'Kopf'</span>, locations=[(<span class="py-string">'util.py'</span>, 33)]) <span class="py-prompt">>>> </span>catalog.add((<span class="py-string">'salad'</span>, <span class="py-string">'salads'</span>), (u<span class="py-string">'Salat'</span>, u<span class="py-string">'Salate'</span>), <span class="py-more">... </span> locations=[(<span class="py-string">'util.py'</span>, 38)])</pre> <pre class="py-doctest"> <span class="py-prompt">>>> </span>catalog.update(template) <span class="py-prompt">>>> </span>len(catalog) <span class="py-output">3</span></pre> <pre class="py-doctest"> <span class="py-prompt">>>> </span>msg1 = catalog[<span class="py-string">'green'</span>] <span class="py-prompt">>>> </span>msg1.string <span class="py-prompt">>>> </span>msg1.locations <span class="py-output">[('main.py', 99)]</span></pre> <pre class="py-doctest"> <span class="py-prompt">>>> </span>msg2 = catalog[<span class="py-string">'blue'</span>] <span class="py-prompt">>>> </span>msg2.string <span class="py-output">u'blau'</span> <span class="py-output"></span><span class="py-prompt">>>> </span>msg2.locations <span class="py-output">[('main.py', 100)]</span></pre> <pre class="py-doctest"> <span class="py-prompt">>>> </span>msg3 = catalog[<span class="py-string">'salad'</span>] <span class="py-prompt">>>> </span>msg3.string <span class="py-output">(u'Salat', u'Salate')</span> <span class="py-output"></span><span class="py-prompt">>>> </span>msg3.locations <span class="py-output">[('util.py', 42)]</span></pre> <p>Messages that are in the catalog but not in the template are removed from the main collection, but can still be accessed via the <a href="babel.messages.catalog.Catalog-class.html#obsolete" class="link">obsolete</a> member:</p> <pre class="py-doctest"> <span class="py-prompt">>>> </span><span class="py-string">'head'</span> <span class="py-keyword">in</span> catalog <span class="py-output">False</span> <span class="py-output"></span><span class="py-prompt">>>> </span>catalog.obsolete.values() <span class="py-output">[<Message 'head' (flags: [])>]</span></pre> <dl class="fields"> <dt>Parameters:</dt> <dd><ul class="nomargin-top"> <li><strong class="pname"><code>template</code></strong> - the reference catalog, usually read from a POT file</li> <li><strong class="pname"><code>no_fuzzy_matching</code></strong> - whether to use fuzzy matching of message IDs</li> </ul></dd> </dl> </td></tr></table> </div> <br /> <!-- ==================== PROPERTY DETAILS ==================== --> <a name="section-PropertyDetails"></a> <table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> <tr bgcolor="#70b0f0" class="table-header"> <td align="left" colspan="2" class="table-header"> <span class="table-header">Property Details</span></td> </tr> </table> <a name="header_comment"></a> <div> <table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> <tr><td> <h3 class="epydoc">header_comment</h3> <p>The header comment for the catalog.</p> <pre class="py-doctest"> <span class="py-prompt">>>> </span>catalog = Catalog(project=<span class="py-string">'Foobar'</span>, version=<span class="py-string">'1.0'</span>, <span class="py-more">... </span> copyright_holder=<span class="py-string">'Foo Company'</span>) <span class="py-prompt">>>> </span><span class="py-keyword">print</span> catalog.header_comment <span class="py-comment">#doctest: +ELLIPSIS</span> <span class="py-output"># Translations template for Foobar.</span> <span class="py-output"># Copyright (C) ... Foo Company</span> <span class="py-output"># This file is distributed under the same license as the Foobar project.</span> <span class="py-output"># FIRST AUTHOR <EMAIL@ADDRESS>, ....</span> <span class="py-output">#</span></pre> <p>The header can also be set from a string. Any known upper-case variables will be replaced when the header is retrieved again:</p> <pre class="py-doctest"> <span class="py-prompt">>>> </span>catalog = Catalog(project=<span class="py-string">'Foobar'</span>, version=<span class="py-string">'1.0'</span>, <span class="py-more">... </span> copyright_holder=<span class="py-string">'Foo Company'</span>) <span class="py-prompt">>>> </span>catalog.header_comment = <span class="py-string">'''\</span> <span class="py-more">... </span><span class="py-string"># The POT for my really cool PROJECT project.</span> <span class="py-more">... </span><span class="py-string"># Copyright (C) 1990-2003 ORGANIZATION</span> <span class="py-more">... </span><span class="py-string"># This file is distributed under the same license as the PROJECT</span> <span class="py-more">... </span><span class="py-string"># project.</span> <span class="py-more">... </span><span class="py-string">#'''</span> <span class="py-prompt">>>> </span><span class="py-keyword">print</span> catalog.header_comment <span class="py-output"># The POT for my really cool Foobar project.</span> <span class="py-output"># Copyright (C) 1990-2003 Foo Company</span> <span class="py-output"># This file is distributed under the same license as the Foobar</span> <span class="py-output"># project.</span> <span class="py-output">#</span></pre> <dl class="fields"> <dt>Get Method:</dt> <dd class="value"><span class="summary-sig"><a href="babel.messages.catalog.Catalog-class.html#_get_header_comment" class="summary-sig-name" onclick="show_private();">_get_header_comment</a>(<span class="summary-sig-arg">self</span>)</span> </dd> <dt>Set Method:</dt> <dd class="value"><span class="summary-sig"><a href="babel.messages.catalog.Catalog-class.html#_set_header_comment" class="summary-sig-name" onclick="show_private();">_set_header_comment</a>(<span class="summary-sig-arg">self</span>, <span class="summary-sig-arg">string</span>)</span> </dd> <dt>Type:</dt> <dd><code class="link">unicode</code></dd> </dl> </td></tr></table> </div> <a name="mime_headers"></a> <div> <table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> <tr><td> <h3 class="epydoc">mime_headers</h3> <p>The MIME headers of the catalog, used for the special <tt class="rst-rst-docutils literal rst-docutils literal">msgid ""</tt> entry.</p> <p>The behavior of this property changes slightly depending on whether a locale is set or not, the latter indicating that the catalog is actually a template for actual translations.</p> <p>Here's an example of the output for such a catalog template:</p> <pre class="py-doctest"> <span class="py-prompt">>>> </span>created = datetime(1990, 4, 1, 15, 30, tzinfo=UTC) <span class="py-prompt">>>> </span>catalog = Catalog(project=<span class="py-string">'Foobar'</span>, version=<span class="py-string">'1.0'</span>, <span class="py-more">... </span> creation_date=created) <span class="py-prompt">>>> </span><span class="py-keyword">for</span> name, value <span class="py-keyword">in</span> catalog.mime_headers: <span class="py-more">... </span> <span class="py-keyword">print</span> <span class="py-string">'%s: %s'</span> % (name, value) <span class="py-output">Project-Id-Version: Foobar 1.0</span> <span class="py-output">Report-Msgid-Bugs-To: EMAIL@ADDRESS</span> <span class="py-output">POT-Creation-Date: 1990-04-01 15:30+0000</span> <span class="py-output">PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE</span> <span class="py-output">Last-Translator: FULL NAME <EMAIL@ADDRESS></span> <span class="py-output">Language-Team: LANGUAGE <LL@li.org></span> <span class="py-output">MIME-Version: 1.0</span> <span class="py-output">Content-Type: text/plain; charset=utf-8</span> <span class="py-output">Content-Transfer-Encoding: 8bit</span> <span class="py-output">Generated-By: Babel ...</span></pre> <p>And here's an example of the output when the locale is set:</p> <pre class="py-doctest"> <span class="py-prompt">>>> </span>revised = datetime(1990, 8, 3, 12, 0, tzinfo=UTC) <span class="py-prompt">>>> </span>catalog = Catalog(locale=<span class="py-string">'de_DE'</span>, project=<span class="py-string">'Foobar'</span>, version=<span class="py-string">'1.0'</span>, <span class="py-more">... </span> creation_date=created, revision_date=revised, <span class="py-more">... </span> last_translator=<span class="py-string">'John Doe <jd@example.com>'</span>, <span class="py-more">... </span> language_team=<span class="py-string">'de_DE <de@example.com>'</span>) <span class="py-prompt">>>> </span><span class="py-keyword">for</span> name, value <span class="py-keyword">in</span> catalog.mime_headers: <span class="py-more">... </span> <span class="py-keyword">print</span> <span class="py-string">'%s: %s'</span> % (name, value) <span class="py-output">Project-Id-Version: Foobar 1.0</span> <span class="py-output">Report-Msgid-Bugs-To: EMAIL@ADDRESS</span> <span class="py-output">POT-Creation-Date: 1990-04-01 15:30+0000</span> <span class="py-output">PO-Revision-Date: 1990-08-03 12:00+0000</span> <span class="py-output">Last-Translator: John Doe <jd@example.com></span> <span class="py-output">Language-Team: de_DE <de@example.com></span> <span class="py-output">Plural-Forms: nplurals=2; plural=(n != 1)</span> <span class="py-output">MIME-Version: 1.0</span> <span class="py-output">Content-Type: text/plain; charset=utf-8</span> <span class="py-output">Content-Transfer-Encoding: 8bit</span> <span class="py-output">Generated-By: Babel ...</span></pre> <dl class="fields"> <dt>Get Method:</dt> <dd class="value"><span class="summary-sig"><a href="babel.messages.catalog.Catalog-class.html#_get_mime_headers" class="summary-sig-name" onclick="show_private();">_get_mime_headers</a>(<span class="summary-sig-arg">self</span>)</span> </dd> <dt>Set Method:</dt> <dd class="value"><span class="summary-sig"><a href="babel.messages.catalog.Catalog-class.html#_set_mime_headers" class="summary-sig-name" onclick="show_private();">_set_mime_headers</a>(<span class="summary-sig-arg">self</span>, <span class="summary-sig-arg">headers</span>)</span> </dd> <dt>Type:</dt> <dd><code class="link">list</code></dd> </dl> </td></tr></table> </div> <a name="num_plurals"></a> <div> <table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> <tr><td> <h3 class="epydoc">num_plurals</h3> <p>The number of plurals used by the catalog or locale.</p> <pre class="py-doctest"> <span class="py-prompt">>>> </span>Catalog(locale=<span class="py-string">'en'</span>).num_plurals <span class="py-output">2</span> <span class="py-output"></span><span class="py-prompt">>>> </span>Catalog(locale=<span class="py-string">'ga'</span>).num_plurals <span class="py-output">3</span></pre> <dl class="fields"> <dt>Get Method:</dt> <dd class="value"><span class="summary-sig"><i>unreachable</i>.num_plurals(<span class="summary-sig-arg">self</span>)</span> </dd> <dt>Type:</dt> <dd><code class="link">int</code></dd> </dl> </td></tr></table> </div> <a name="plural_expr"></a> <div> <table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> <tr><td> <h3 class="epydoc">plural_expr</h3> <p>The plural expression used by the catalog or locale.</p> <pre class="py-doctest"> <span class="py-prompt">>>> </span>Catalog(locale=<span class="py-string">'en'</span>).plural_expr <span class="py-output">'(n != 1)'</span> <span class="py-output"></span><span class="py-prompt">>>> </span>Catalog(locale=<span class="py-string">'ga'</span>).plural_expr <span class="py-output">'(n==1 ? 0 : n==2 ? 1 : 2)'</span></pre> <dl class="fields"> <dt>Get Method:</dt> <dd class="value"><span class="summary-sig"><i>unreachable</i>.plural_expr(<span class="summary-sig-arg">self</span>)</span> </dd> <dt>Type:</dt> <dd><code class="link">basestring</code></dd> </dl> </td></tr></table> </div> <a name="plural_forms"></a> <div> <table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> <tr><td> <h3 class="epydoc">plural_forms</h3> <p>Return the plural forms declaration for the locale.</p> <pre class="py-doctest"> <span class="py-prompt">>>> </span>Catalog(locale=<span class="py-string">'en'</span>).plural_forms <span class="py-output">'nplurals=2; plural=(n != 1)'</span> <span class="py-output"></span><span class="py-prompt">>>> </span>Catalog(locale=<span class="py-string">'pt_BR'</span>).plural_forms <span class="py-output">'nplurals=2; plural=(n > 1)'</span></pre> <dl class="fields"> <dt>Get Method:</dt> <dd class="value"><span class="summary-sig"><i>unreachable</i>.plural_forms(<span class="summary-sig-arg">self</span>)</span> </dd> <dt>Type:</dt> <dd><code class="link">str</code></dd> </dl> </td></tr></table> </div> <br /> <!-- ==================== NAVIGATION BAR ==================== --> <table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0"> <tr valign="middle"> <!-- Home link --> <th> <a href="babel-module.html">Home</a> </th> <!-- Tree link --> <th> <a href="module-tree.html">Trees</a> </th> <!-- Index link --> <th> <a href="identifier-index.html">Indices</a> </th> <!-- Help link --> <th> <a href="help.html">Help</a> </th> <!-- Project homepage --> <th class="navbar" align="right" width="100%"> <table border="0" cellpadding="0" cellspacing="0"> <tr><th class="navbar" align="center" ><a class="navbar" target="_top" href="../index.html">Documentation Index</a></th> </tr></table></th> </tr> </table> <table border="0" cellpadding="0" cellspacing="0" width="100%%"> <tr> <td align="left" class="footer"> Generated by Epydoc 3.0.1 on Thu Mar 17 15:12:44 2011 </td> <td align="right" class="footer"> <a target="mainFrame" href="http://epydoc.sourceforge.net" >http://epydoc.sourceforge.net</a> </td> </tr> </table> <script type="text/javascript"> <!-- // Private objects are initially displayed (because if // javascript is turned off then we want them to be // visible); but by default, we want to hide them. So hide // them unless we have a cookie that says to show them. checkCookie(); // --> </script> </body> </html>
Close