Commits

Anonymous committed 4c4e4a1

release 0.4.1

  • Participants
  • Parent commits ac2fa20
  • Tags 0.4.1

Comments (0)

Files changed (19)

+Version 0.4.1 (2009/03/04)
+--------------------------
+    * fixed issue #0006: plural msgstrs were saved unsorted,
+    * fixed issue #0008: long comment lines broke 'save()' method,
+    * removed performance shortcuts: they were in fact inefficient, I was
+      misleaded by the python profile module, kudos to Thomas for making me
+      realise that,
+    * fixed issue #0010: wrong polib version number,
+    * fixed issue #0011: occurrences parsing is now more robust and can handle
+      weird references formats (like in eToys OLPC po files),
+    * fixed issue #0012: improved merge() method.
+
 Version 0.4.0 (2008/11/26)
 --------------------------
     * fixed bug #0005: percent_translated divide by 0 on empty po files,

docs/api/api-objects.txt

 polib	polib-module.html
-polib._strsplit	polib-module.html#_strsplit
+polib.unescape	polib-module.html#unescape
+polib.mofile	polib-module.html#mofile
 polib.default_encoding	polib-module.html#default_encoding
-polib._listpop	polib-module.html#_listpop
+polib.pofile	polib-module.html#pofile
+polib.detect_encoding	polib-module.html#detect_encoding
 polib.escape	polib-module.html#escape
-polib.pofile	polib-module.html#pofile
-polib._listappend	polib-module.html#_listappend
-polib._dictget	polib-module.html#_dictget
-polib._strstrip	polib-module.html#_strstrip
-polib._strjoin	polib-module.html#_strjoin
-polib._strreplace	polib-module.html#_strreplace
-polib.unescape	polib-module.html#unescape
-polib.detect_encoding	polib-module.html#detect_encoding
-polib.mofile	polib-module.html#mofile
 polib.MOEntry	polib.MOEntry-class.html
 polib.MOEntry.__str__	polib.MOEntry-class.html#__str__
 polib._BaseEntry.__repr__	polib._BaseEntry-class.html#__repr__
 polib.POEntry	polib.POEntry-class.html
 polib.POEntry.__str__	polib.POEntry-class.html#__str__
 polib.POEntry.__cmp__	polib.POEntry-class.html#__cmp__
+polib.POEntry.merge	polib.POEntry-class.html#merge
 polib._BaseEntry.__repr__	polib._BaseEntry-class.html#__repr__
 polib._BaseEntry._str_field	polib._BaseEntry-class.html#_str_field
 polib.POEntry.translated	polib.POEntry-class.html#translated

docs/api/class-tree.html

 <table border="0" cellpadding="0" cellspacing="0" width="100%%">
   <tr>
     <td align="left" class="footer">
-    Generated by Epydoc 3.0.1 on Wed Nov 26 19:13:55 2008
+    Generated by Epydoc 3.0.1 on Sun Mar  1 13:19:32 2009
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"

docs/api/help.html

 <table border="0" cellpadding="0" cellspacing="0" width="100%%">
   <tr>
     <td align="left" class="footer">
-    Generated by Epydoc 3.0.1 on Wed Nov 26 19:13:55 2008
+    Generated by Epydoc 3.0.1 on Sun Mar  1 13:19:32 2009
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"

docs/api/identifier-index.html

 <td valign="top">
 <table class="link-index" width="100%" border="1">
 <tr>
+<td width="33%" class="link-index"><a href="polib.POEntry-class.html#merge">merge()</a><br />
+<span class="index-where">(in&nbsp;<a href="polib.POEntry-class.html">POEntry</a>)</span></td>
+<td width="33%" class="link-index"><a href="polib._BaseFile-class.html#metadata_as_entry">metadata_as_entry()</a><br />
+<span class="index-where">(in&nbsp;<a href="polib._BaseFile-class.html" onclick="show_private();">_BaseFile</a>)</span></td>
+<td width="33%" class="link-index"><a href="polib.MOFile-class.html">MOFile</a><br />
+<span class="index-where">(in&nbsp;<a href="polib-module.html">polib</a>)</span></td>
+</tr>
+<tr>
 <td width="33%" class="link-index"><a href="polib.POFile-class.html#merge">merge()</a><br />
 <span class="index-where">(in&nbsp;<a href="polib.POFile-class.html">POFile</a>)</span></td>
 <td width="33%" class="link-index"><a href="polib.MOEntry-class.html">MOEntry</a><br />
 <td width="33%" class="link-index"><a href="polib-module.html#mofile">mofile()</a><br />
 <span class="index-where">(in&nbsp;<a href="polib-module.html">polib</a>)</span></td>
 </tr>
-<tr>
-<td width="33%" class="link-index"><a href="polib._BaseFile-class.html#metadata_as_entry">metadata_as_entry()</a><br />
-<span class="index-where">(in&nbsp;<a href="polib._BaseFile-class.html" onclick="show_private();">_BaseFile</a>)</span></td>
-<td width="33%" class="link-index"><a href="polib.MOFile-class.html">MOFile</a><br />
-<span class="index-where">(in&nbsp;<a href="polib-module.html">polib</a>)</span></td>
-<td width="33%" class="link-index">&nbsp;</td>
-</tr>
 </table>
 </td></tr>
 <tr valign="top"><td valign="top" width="1%"><h2 class="epydoc"><a name="O">O</a></h2></td>
 <table border="0" cellpadding="0" cellspacing="0" width="100%%">
   <tr>
     <td align="left" class="footer">
-    Generated by Epydoc 3.0.1 on Wed Nov 26 19:13:55 2008
+    Generated by Epydoc 3.0.1 on Sun Mar  1 13:19:32 2009
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"

docs/api/module-tree.html

 <table border="0" cellpadding="0" cellspacing="0" width="100%%">
   <tr>
     <td align="left" class="footer">
-    Generated by Epydoc 3.0.1 on Wed Nov 26 19:13:55 2008
+    Generated by Epydoc 3.0.1 on Sun Mar  1 13:19:32 2009
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"

docs/api/polib-module.html

 
 <hr />
 <div class="fields">      <p><strong>Version:</strong>
-        0.3.1
+        0.4.1
       </p>
       <p><strong>Author:</strong>
         David JEAN LOUIS &lt;izimobil@gmail.com&gt;
     </table>
   </td>
 </tr>
-<tr class="private">
-    <td width="15%" align="right" valign="top" class="summary">
-      <span class="summary-type">D[k] if k in D, else d</span>
-    </td><td class="summary">
-      <table width="100%" cellpadding="0" cellspacing="0" border="0">
-        <tr>
-          <td><span class="summary-sig"><a name="_dictget"></a><span class="summary-sig-name">_dictget</span>(<span class="summary-sig-arg">D</span>,
-        <span class="summary-sig-arg">k</span>,
-        <span class="summary-sig-arg">d</span>=<span class="summary-sig-default">...</span>)</span><br />
-      d defaults to None.</td>
-          <td align="right" valign="top">
-            <span class="codelink"><a href="polib-pysrc.html">source&nbsp;code</a></span>
-            
-          </td>
-        </tr>
-      </table>
-      
-    </td>
-  </tr>
-<tr class="private">
-    <td width="15%" align="right" valign="top" class="summary">
-      <span class="summary-type">&nbsp;</span>
-    </td><td class="summary">
-      <table width="100%" cellpadding="0" cellspacing="0" border="0">
-        <tr>
-          <td><span class="summary-sig"><a name="_listappend"></a><span class="summary-sig-name">_listappend</span>(<span class="summary-sig-arg">L</span>,
-        <span class="summary-sig-arg">object</span>)</span><br />
-      append object to end</td>
-          <td align="right" valign="top">
-            
-            
-          </td>
-        </tr>
-      </table>
-      
-    </td>
-  </tr>
-<tr class="private">
-    <td width="15%" align="right" valign="top" class="summary">
-      <span class="summary-type">item</span>
-    </td><td class="summary">
-      <table width="100%" cellpadding="0" cellspacing="0" border="0">
-        <tr>
-          <td><span class="summary-sig"><a name="_listpop"></a><span class="summary-sig-name">_listpop</span>(<span class="summary-sig-arg">L</span>,
-        <span class="summary-sig-arg">index</span>=<span class="summary-sig-default">...</span>)</span><br />
-      remove and return item at index (default last)</td>
-          <td align="right" valign="top">
-            
-            
-          </td>
-        </tr>
-      </table>
-      
-    </td>
-  </tr>
-<tr class="private">
-    <td width="15%" align="right" valign="top" class="summary">
-      <span class="summary-type">string</span>
-    </td><td class="summary">
-      <table width="100%" cellpadding="0" cellspacing="0" border="0">
-        <tr>
-          <td><span class="summary-sig"><a href="polib-module.html#_strjoin" class="summary-sig-name" onclick="show_private();">_strjoin</a>(<span class="summary-sig-arg">S</span>,
-        <span class="summary-sig-arg">sequence</span>)</span><br />
-      Return a string which is the concatenation of the strings in the 
-      sequence.</td>
-          <td align="right" valign="top">
-            <span class="codelink"><a href="polib-pysrc.html">source&nbsp;code</a></span>
-            
-          </td>
-        </tr>
-      </table>
-      
-    </td>
-  </tr>
-<tr class="private">
-    <td width="15%" align="right" valign="top" class="summary">
-      <span class="summary-type">list of strings</span>
-    </td><td class="summary">
-      <table width="100%" cellpadding="0" cellspacing="0" border="0">
-        <tr>
-          <td><span class="summary-sig"><a href="polib-module.html#_strsplit" class="summary-sig-name" onclick="show_private();">_strsplit</a>(<span class="summary-sig-arg">S</span>,
-        <span class="summary-sig-arg">sep</span>=<span class="summary-sig-default">... </span>,
-        <span class="summary-sig-arg">maxsplit</span>=<span class="summary-sig-default">...</span>)</span><br />
-      Return a list of the words in the string S, using sep as the 
-      delimiter string.</td>
-          <td align="right" valign="top">
-            <span class="codelink"><a href="polib-pysrc.html">source&nbsp;code</a></span>
-            
-          </td>
-        </tr>
-      </table>
-      
-    </td>
-  </tr>
-<tr class="private">
-    <td width="15%" align="right" valign="top" class="summary">
-      <span class="summary-type">string or unicode</span>
-    </td><td class="summary">
-      <table width="100%" cellpadding="0" cellspacing="0" border="0">
-        <tr>
-          <td><span class="summary-sig"><a href="polib-module.html#_strstrip" class="summary-sig-name" onclick="show_private();">_strstrip</a>(<span class="summary-sig-arg">S</span>,
-        <span class="summary-sig-arg">chars</span>=<span class="summary-sig-default">...</span>)</span><br />
-      Return a copy of the string S with leading and trailing whitespace 
-      removed.</td>
-          <td align="right" valign="top">
-            <span class="codelink"><a href="polib-pysrc.html">source&nbsp;code</a></span>
-            
-          </td>
-        </tr>
-      </table>
-      
-    </td>
-  </tr>
-<tr class="private">
-    <td width="15%" align="right" valign="top" class="summary">
-      <span class="summary-type">&nbsp;</span>
-    </td><td class="summary">
-      <table width="100%" cellpadding="0" cellspacing="0" border="0">
-        <tr>
-          <td><span class="summary-sig"><a href="polib-module.html#_strreplace" class="summary-sig-name" onclick="show_private();">_strreplace</a>(<span class="summary-sig-arg">...</span>)</span><br />
-      S.replace (old, new[, count]) -&gt; string</td>
-          <td align="right" valign="top">
-            <span class="codelink"><a href="polib-pysrc.html">source&nbsp;code</a></span>
-            
-          </td>
-        </tr>
-      </table>
-      
-    </td>
-  </tr>
 <tr>
     <td width="15%" align="right" valign="top" class="summary">
       <span class="summary-type">&nbsp;</span>
   </td>
 </tr>
 </table>
-<a name="_strjoin"></a>
-<div class="private">
-<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">_strjoin</span>(<span class="sig-arg">S</span>,
-        <span class="sig-arg">sequence</span>)</span>
-  </h3>
-  </td><td align="right" valign="top"
-    ><span class="codelink"><a href="polib-pysrc.html">source&nbsp;code</a></span>&nbsp;
-    </td>
-  </tr></table>
-  
-  <p>Return a string which is the concatenation of the strings in the 
-  sequence.  The separator between elements is S.</p>
-  <dl class="fields">
-    <dt>Returns: string</dt>
-  </dl>
-</td></tr></table>
-</div>
-<a name="_strsplit"></a>
-<div class="private">
-<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">_strsplit</span>(<span class="sig-arg">S</span>,
-        <span class="sig-arg">sep</span>=<span class="sig-default">... </span>,
-        <span class="sig-arg">maxsplit</span>=<span class="sig-default">...</span>)</span>
-  </h3>
-  </td><td align="right" valign="top"
-    ><span class="codelink"><a href="polib-pysrc.html">source&nbsp;code</a></span>&nbsp;
-    </td>
-  </tr></table>
-  
-  <p>Return a list of the words in the string S, using sep as the delimiter
-  string.  If maxsplit is given, at most maxsplit splits are done. If sep 
-  is not specified or is None, any whitespace string is a separator.</p>
-  <dl class="fields">
-    <dt>Returns: list of strings</dt>
-  </dl>
-</td></tr></table>
-</div>
-<a name="_strstrip"></a>
-<div class="private">
-<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">_strstrip</span>(<span class="sig-arg">S</span>,
-        <span class="sig-arg">chars</span>=<span class="sig-default">...</span>)</span>
-  </h3>
-  </td><td align="right" valign="top"
-    ><span class="codelink"><a href="polib-pysrc.html">source&nbsp;code</a></span>&nbsp;
-    </td>
-  </tr></table>
-  
-  <p>Return a copy of the string S with leading and trailing whitespace 
-  removed. If chars is given and not None, remove characters in chars 
-  instead. If chars is unicode, S will be converted to unicode before 
-  stripping</p>
-  <dl class="fields">
-    <dt>Returns: string or unicode</dt>
-  </dl>
-</td></tr></table>
-</div>
-<a name="_strreplace"></a>
-<div class="private">
-<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">_strreplace</span>(<span class="sig-arg">...</span>)</span>
-  </h3>
-  </td><td align="right" valign="top"
-    ><span class="codelink"><a href="polib-pysrc.html">source&nbsp;code</a></span>&nbsp;
-    </td>
-  </tr></table>
-  
-  <p>S.replace (old, new[, count]) -&gt; string</p>
-  <p>Return a copy of string S with all occurrences of substring old 
-  replaced by new.  If the optional argument count is given, only the first
-  count occurrences are replaced.</p>
-  <dl class="fields">
-  </dl>
-</td></tr></table>
-</div>
 <a name="pofile"></a>
 <div>
 <table class="details" border="1" cellpadding="3"
   <p>**Example**:</p>
 <pre class="py-doctest">
 <span class="py-prompt">&gt;&gt;&gt; </span><span class="py-keyword">import</span> polib
-<span class="py-prompt">&gt;&gt;&gt; </span>po = polib.pofile(<span class="py-string">'tests/test_utf8.po'</span>)
+<span class="py-prompt">&gt;&gt;&gt; </span>po = polib.pofile(<span class="py-string">'tests/test_weird_occurrences.po'</span>)
 <span class="py-prompt">&gt;&gt;&gt; </span>po <span class="py-comment">#doctest: +ELLIPSIS</span>
 <span class="py-output">&lt;POFile instance at ...&gt;</span>
 <span class="py-output"></span><span class="py-prompt">&gt;&gt;&gt; </span><span class="py-keyword">import</span> os, tempfile
 <table border="0" cellpadding="0" cellspacing="0" width="100%%">
   <tr>
     <td align="left" class="footer">
-    Generated by Epydoc 3.0.1 on Wed Nov 26 19:13:55 2008
+    Generated by Epydoc 3.0.1 on Sun Mar  1 13:19:32 2009
     </td>
     <td align="right" class="footer">
       <a target="mainFrame" href="http://epydoc.sourceforge.net"

docs/api/polib-pysrc.html

 <a name="L34"></a><tt class="py-lineno">  34</tt>  <tt class="py-line"><tt class="py-docstring">"""</tt> </tt>
 <a name="L35"></a><tt class="py-lineno">  35</tt>  <tt class="py-line"> </tt>
 <a name="L36"></a><tt class="py-lineno">  36</tt>  <tt class="py-line"><tt class="py-name">__author__</tt>    <tt class="py-op">=</tt> <tt class="py-string">'David JEAN LOUIS &lt;izimobil@gmail.com&gt;'</tt> </tt>
-<a name="L37"></a><tt class="py-lineno">  37</tt>  <tt class="py-line"><tt class="py-name">__version__</tt>   <tt class="py-op">=</tt> <tt class="py-string">'0.3.1'</tt> </tt>
+<a name="L37"></a><tt class="py-lineno">  37</tt>  <tt class="py-line"><tt class="py-name">__version__</tt>   <tt class="py-op">=</tt> <tt class="py-string">'0.4.1'</tt> </tt>
 <a name="L38"></a><tt class="py-lineno">  38</tt>  <tt class="py-line"><tt class="py-name">__all__</tt>       <tt class="py-op">=</tt> <tt class="py-op">[</tt><tt class="py-string">'pofile'</tt><tt class="py-op">,</tt> <tt class="py-string">'POFile'</tt><tt class="py-op">,</tt> <tt class="py-string">'POEntry'</tt><tt class="py-op">,</tt> <tt class="py-string">'mofile'</tt><tt class="py-op">,</tt> <tt class="py-string">'MOFile'</tt><tt class="py-op">,</tt> <tt class="py-string">'MOEntry'</tt><tt class="py-op">,</tt> </tt>
 <a name="L39"></a><tt class="py-lineno">  39</tt>  <tt class="py-line">                 <tt class="py-string">'detect_encoding'</tt><tt class="py-op">,</tt> <tt class="py-string">'escape'</tt><tt class="py-op">,</tt> <tt class="py-string">'unescape'</tt><tt class="py-op">]</tt> </tt>
 <a name="L40"></a><tt class="py-lineno">  40</tt>  <tt class="py-line"> </tt>
 <a name="L44"></a><tt class="py-lineno">  44</tt>  <tt class="py-line"> </tt>
 <a name="L45"></a><tt class="py-lineno">  45</tt>  <tt class="py-line"><tt id="link-0" class="py-name" targets="Variable polib.default_encoding=polib-module.html#default_encoding"><a title="polib.default_encoding" class="py-name" href="#" onclick="return doclink('link-0', 'default_encoding', 'link-0');">default_encoding</a></tt> <tt class="py-op">=</tt> <tt class="py-string">'utf-8'</tt> </tt>
 <a name="L46"></a><tt class="py-lineno">  46</tt>  <tt class="py-line"> </tt>
-<a name="L47"></a><tt class="py-lineno">  47</tt>  <tt class="py-line"><tt class="py-comment"># shortcuts for performance improvement {{{</tt> </tt>
+<a name="L47"></a><tt class="py-lineno">  47</tt>  <tt class="py-line"><tt class="py-comment"># function pofile() {{{</tt> </tt>
 <a name="L48"></a><tt class="py-lineno">  48</tt>  <tt class="py-line"><tt class="py-comment"></tt> </tt>
-<a name="L49"></a><tt class="py-lineno">  49</tt>  <tt class="py-line"><tt class="py-comment"># this is quite ugly but *very* efficient</tt> </tt>
-<a name="L50"></a><tt class="py-lineno">  50</tt>  <tt class="py-line"><tt class="py-comment"></tt><tt class="py-name">_dictget</tt>    <tt class="py-op">=</tt> <tt class="py-name">dict</tt><tt class="py-op">.</tt><tt class="py-name">get</tt> </tt>
-<a name="L51"></a><tt class="py-lineno">  51</tt>  <tt class="py-line"><tt class="py-name">_listappend</tt> <tt class="py-op">=</tt> <tt class="py-name">list</tt><tt class="py-op">.</tt><tt class="py-name">append</tt> </tt>
-<a name="L52"></a><tt class="py-lineno">  52</tt>  <tt class="py-line"><tt class="py-name">_listpop</tt>    <tt class="py-op">=</tt> <tt class="py-name">list</tt><tt class="py-op">.</tt><tt class="py-name">pop</tt> </tt>
-<a name="L53"></a><tt class="py-lineno">  53</tt>  <tt class="py-line"><tt class="py-name">_strjoin</tt>    <tt class="py-op">=</tt> <tt class="py-name">str</tt><tt class="py-op">.</tt><tt class="py-name">join</tt> </tt>
-<a name="L54"></a><tt class="py-lineno">  54</tt>  <tt class="py-line"><tt class="py-name">_strsplit</tt>   <tt class="py-op">=</tt> <tt class="py-name">str</tt><tt class="py-op">.</tt><tt class="py-name">split</tt> </tt>
-<a name="L55"></a><tt class="py-lineno">  55</tt>  <tt class="py-line"><tt class="py-name">_strstrip</tt>   <tt class="py-op">=</tt> <tt class="py-name">str</tt><tt class="py-op">.</tt><tt class="py-name">strip</tt> </tt>
-<a name="L56"></a><tt class="py-lineno">  56</tt>  <tt class="py-line"><tt class="py-name">_strreplace</tt> <tt class="py-op">=</tt> <tt class="py-name">str</tt><tt class="py-op">.</tt><tt class="py-name">replace</tt> </tt>
-<a name="L57"></a><tt class="py-lineno">  57</tt>  <tt class="py-line"><tt class="py-name">_textwrap</tt>   <tt class="py-op">=</tt> <tt class="py-name">textwrap</tt><tt class="py-op">.</tt><tt class="py-name">wrap</tt> </tt>
-<a name="L58"></a><tt class="py-lineno">  58</tt>  <tt class="py-line"> </tt>
-<a name="L59"></a><tt class="py-lineno">  59</tt>  <tt class="py-line"><tt class="py-comment"># }}}</tt> </tt>
-<a name="L60"></a><tt class="py-lineno">  60</tt>  <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment"># function pofile() {{{</tt> </tt>
-<a name="L61"></a><tt class="py-lineno">  61</tt>  <tt class="py-line"><tt class="py-comment"></tt> </tt>
-<a name="pofile"></a><div id="pofile-def"><a name="L62"></a><tt class="py-lineno">  62</tt> <a class="py-toggle" href="#" id="pofile-toggle" onclick="return toggle('pofile');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="polib-module.html#pofile">pofile</a><tt class="py-op">(</tt><tt class="py-param">fpath</tt><tt class="py-op">,</tt> <tt class="py-op">**</tt><tt class="py-param">kwargs</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
-</div><div id="pofile-collapsed" style="display:none;" pad="++++" indent="++++"></div><div id="pofile-expanded"><a name="L63"></a><tt class="py-lineno">  63</tt>  <tt class="py-line">    <tt class="py-docstring">"""</tt> </tt>
-<a name="L64"></a><tt class="py-lineno">  64</tt>  <tt class="py-line"><tt class="py-docstring">    Convenience function that parse the po/pot file *fpath* and return</tt> </tt>
-<a name="L65"></a><tt class="py-lineno">  65</tt>  <tt class="py-line"><tt class="py-docstring">    a POFile instance.</tt> </tt>
-<a name="L66"></a><tt class="py-lineno">  66</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
-<a name="L67"></a><tt class="py-lineno">  67</tt>  <tt class="py-line"><tt class="py-docstring">    **Keyword arguments**:</tt> </tt>
-<a name="L68"></a><tt class="py-lineno">  68</tt>  <tt class="py-line"><tt class="py-docstring">      - *fpath*: string, full or relative path to the po/pot file to parse</tt> </tt>
-<a name="L69"></a><tt class="py-lineno">  69</tt>  <tt class="py-line"><tt class="py-docstring">      - *wrapwidth*: integer, the wrap width, only useful when -w option was</tt> </tt>
-<a name="L70"></a><tt class="py-lineno">  70</tt>  <tt class="py-line"><tt class="py-docstring">        passed to xgettext (optional, default to 78)</tt> </tt>
-<a name="L71"></a><tt class="py-lineno">  71</tt>  <tt class="py-line"><tt class="py-docstring">      - *autodetect_encoding*: boolean, if set to False the function will</tt> </tt>
-<a name="L72"></a><tt class="py-lineno">  72</tt>  <tt class="py-line"><tt class="py-docstring">        not try to detect the po file encoding (optional, default to True)</tt> </tt>
-<a name="L73"></a><tt class="py-lineno">  73</tt>  <tt class="py-line"><tt class="py-docstring">      - *encoding*: string, an encoding, only relevant if autodetect_encoding</tt> </tt>
-<a name="L74"></a><tt class="py-lineno">  74</tt>  <tt class="py-line"><tt class="py-docstring">        is set to False</tt> </tt>
-<a name="L75"></a><tt class="py-lineno">  75</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
-<a name="L76"></a><tt class="py-lineno">  76</tt>  <tt class="py-line"><tt class="py-docstring">    **Example**:</tt> </tt>
-<a name="L77"></a><tt class="py-lineno">  77</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
-<a name="L78"></a><tt class="py-lineno">  78</tt>  <tt class="py-line"><tt class="py-docstring">    &gt;&gt;&gt; import polib</tt> </tt>
-<a name="L79"></a><tt class="py-lineno">  79</tt>  <tt class="py-line"><tt class="py-docstring">    &gt;&gt;&gt; po = polib.pofile('tests/test_utf8.po')</tt> </tt>
-<a name="L80"></a><tt class="py-lineno">  80</tt>  <tt class="py-line"><tt class="py-docstring">    &gt;&gt;&gt; po #doctest: +ELLIPSIS</tt> </tt>
-<a name="L81"></a><tt class="py-lineno">  81</tt>  <tt class="py-line"><tt class="py-docstring">    &lt;POFile instance at ...&gt;</tt> </tt>
-<a name="L82"></a><tt class="py-lineno">  82</tt>  <tt class="py-line"><tt class="py-docstring">    &gt;&gt;&gt; import os, tempfile</tt> </tt>
-<a name="L83"></a><tt class="py-lineno">  83</tt>  <tt class="py-line"><tt class="py-docstring">    &gt;&gt;&gt; for fname in ['test_iso-8859-15.po', 'test_utf8.po']:</tt> </tt>
-<a name="L84"></a><tt class="py-lineno">  84</tt>  <tt class="py-line"><tt class="py-docstring">    ...     orig_po = polib.pofile('tests/'+fname)</tt> </tt>
-<a name="L85"></a><tt class="py-lineno">  85</tt>  <tt class="py-line"><tt class="py-docstring">    ...     tmpf = tempfile.NamedTemporaryFile().name</tt> </tt>
-<a name="L86"></a><tt class="py-lineno">  86</tt>  <tt class="py-line"><tt class="py-docstring">    ...     orig_po.save(tmpf)</tt> </tt>
-<a name="L87"></a><tt class="py-lineno">  87</tt>  <tt class="py-line"><tt class="py-docstring">    ...     try:</tt> </tt>
-<a name="L88"></a><tt class="py-lineno">  88</tt>  <tt class="py-line"><tt class="py-docstring">    ...         new_po = polib.pofile(tmpf)</tt> </tt>
-<a name="L89"></a><tt class="py-lineno">  89</tt>  <tt class="py-line"><tt class="py-docstring">    ...         for old, new in zip(orig_po, new_po):</tt> </tt>
-<a name="L90"></a><tt class="py-lineno">  90</tt>  <tt class="py-line"><tt class="py-docstring">    ...             if old.msgid != new.msgid:</tt> </tt>
-<a name="L91"></a><tt class="py-lineno">  91</tt>  <tt class="py-line"><tt class="py-docstring">    ...                 old.msgid</tt> </tt>
-<a name="L92"></a><tt class="py-lineno">  92</tt>  <tt class="py-line"><tt class="py-docstring">    ...                 new.msgid</tt> </tt>
-<a name="L93"></a><tt class="py-lineno">  93</tt>  <tt class="py-line"><tt class="py-docstring">    ...             if old.msgstr != new.msgstr:</tt> </tt>
-<a name="L94"></a><tt class="py-lineno">  94</tt>  <tt class="py-line"><tt class="py-docstring">    ...                 old.msgid</tt> </tt>
-<a name="L95"></a><tt class="py-lineno">  95</tt>  <tt class="py-line"><tt class="py-docstring">    ...                 new.msgid</tt> </tt>
-<a name="L96"></a><tt class="py-lineno">  96</tt>  <tt class="py-line"><tt class="py-docstring">    ...     finally:</tt> </tt>
-<a name="L97"></a><tt class="py-lineno">  97</tt>  <tt class="py-line"><tt class="py-docstring">    ...         os.unlink(tmpf)</tt> </tt>
-<a name="L98"></a><tt class="py-lineno">  98</tt>  <tt class="py-line"><tt class="py-docstring">    """</tt> </tt>
-<a name="L99"></a><tt class="py-lineno">  99</tt>  <tt class="py-line">    <tt class="py-keyword">if</tt> <tt class="py-name">_dictget</tt><tt class="py-op">(</tt><tt class="py-name">kwargs</tt><tt class="py-op">,</tt> <tt class="py-string">'autodetect_encoding'</tt><tt class="py-op">,</tt> <tt class="py-name">True</tt><tt class="py-op">)</tt> <tt class="py-op">==</tt> <tt class="py-name">True</tt><tt class="py-op">:</tt> </tt>
-<a name="L100"></a><tt class="py-lineno"> 100</tt>  <tt class="py-line">        <tt class="py-name">enc</tt> <tt class="py-op">=</tt> <tt id="link-1" class="py-name" targets="Function polib.detect_encoding()=polib-module.html#detect_encoding"><a title="polib.detect_encoding" class="py-name" href="#" onclick="return doclink('link-1', 'detect_encoding', 'link-1');">detect_encoding</a></tt><tt class="py-op">(</tt><tt class="py-name">fpath</tt><tt class="py-op">)</tt> </tt>
-<a name="L101"></a><tt class="py-lineno"> 101</tt>  <tt class="py-line">    <tt class="py-keyword">else</tt><tt class="py-op">:</tt> </tt>
-<a name="L102"></a><tt class="py-lineno"> 102</tt>  <tt class="py-line">        <tt class="py-name">enc</tt> <tt class="py-op">=</tt> <tt class="py-name">_dictget</tt><tt class="py-op">(</tt><tt class="py-name">kwargs</tt><tt class="py-op">,</tt> <tt class="py-string">'encoding'</tt><tt class="py-op">,</tt> <tt id="link-2" class="py-name"><a title="polib.default_encoding" class="py-name" href="#" onclick="return doclink('link-2', 'default_encoding', 'link-0');">default_encoding</a></tt><tt class="py-op">)</tt> </tt>
-<a name="L103"></a><tt class="py-lineno"> 103</tt>  <tt class="py-line">    <tt class="py-name">parser</tt> <tt class="py-op">=</tt> <tt id="link-3" class="py-name" targets="Class polib._POFileParser=polib._POFileParser-class.html"><a title="polib._POFileParser" class="py-name" href="#" onclick="return doclink('link-3', '_POFileParser', 'link-3');">_POFileParser</a></tt><tt class="py-op">(</tt><tt class="py-name">fpath</tt><tt class="py-op">)</tt> </tt>
-<a name="L104"></a><tt class="py-lineno"> 104</tt>  <tt class="py-line">    <tt class="py-name">instance</tt> <tt class="py-op">=</tt> <tt class="py-name">parser</tt><tt class="py-op">.</tt><tt id="link-4" class="py-name" targets="Method polib._MOFileParser.parse()=polib._MOFileParser-class.html#parse,Method polib._POFileParser.parse()=polib._POFileParser-class.html#parse"><a title="polib._MOFileParser.parse
+<a name="pofile"></a><div id="pofile-def"><a name="L49"></a><tt class="py-lineno">  49</tt> <a class="py-toggle" href="#" id="pofile-toggle" onclick="return toggle('pofile');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="polib-module.html#pofile">pofile</a><tt class="py-op">(</tt><tt class="py-param">fpath</tt><tt class="py-op">,</tt> <tt class="py-op">**</tt><tt class="py-param">kwargs</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
+</div><div id="pofile-collapsed" style="display:none;" pad="++++" indent="++++"></div><div id="pofile-expanded"><a name="L50"></a><tt class="py-lineno">  50</tt>  <tt class="py-line">    <tt class="py-docstring">"""</tt> </tt>
+<a name="L51"></a><tt class="py-lineno">  51</tt>  <tt class="py-line"><tt class="py-docstring">    Convenience function that parse the po/pot file *fpath* and return</tt> </tt>
+<a name="L52"></a><tt class="py-lineno">  52</tt>  <tt class="py-line"><tt class="py-docstring">    a POFile instance.</tt> </tt>
+<a name="L53"></a><tt class="py-lineno">  53</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
+<a name="L54"></a><tt class="py-lineno">  54</tt>  <tt class="py-line"><tt class="py-docstring">    **Keyword arguments**:</tt> </tt>
+<a name="L55"></a><tt class="py-lineno">  55</tt>  <tt class="py-line"><tt class="py-docstring">      - *fpath*: string, full or relative path to the po/pot file to parse</tt> </tt>
+<a name="L56"></a><tt class="py-lineno">  56</tt>  <tt class="py-line"><tt class="py-docstring">      - *wrapwidth*: integer, the wrap width, only useful when -w option was</tt> </tt>
+<a name="L57"></a><tt class="py-lineno">  57</tt>  <tt class="py-line"><tt class="py-docstring">        passed to xgettext (optional, default to 78)</tt> </tt>
+<a name="L58"></a><tt class="py-lineno">  58</tt>  <tt class="py-line"><tt class="py-docstring">      - *autodetect_encoding*: boolean, if set to False the function will</tt> </tt>
+<a name="L59"></a><tt class="py-lineno">  59</tt>  <tt class="py-line"><tt class="py-docstring">        not try to detect the po file encoding (optional, default to True)</tt> </tt>
+<a name="L60"></a><tt class="py-lineno">  60</tt>  <tt class="py-line"><tt class="py-docstring">      - *encoding*: string, an encoding, only relevant if autodetect_encoding</tt> </tt>
+<a name="L61"></a><tt class="py-lineno">  61</tt>  <tt class="py-line"><tt class="py-docstring">        is set to False</tt> </tt>
+<a name="L62"></a><tt class="py-lineno">  62</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
+<a name="L63"></a><tt class="py-lineno">  63</tt>  <tt class="py-line"><tt class="py-docstring">    **Example**:</tt> </tt>
+<a name="L64"></a><tt class="py-lineno">  64</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
+<a name="L65"></a><tt class="py-lineno">  65</tt>  <tt class="py-line"><tt class="py-docstring">    &gt;&gt;&gt; import polib</tt> </tt>
+<a name="L66"></a><tt class="py-lineno">  66</tt>  <tt class="py-line"><tt class="py-docstring">    &gt;&gt;&gt; po = polib.pofile('tests/test_weird_occurrences.po')</tt> </tt>
+<a name="L67"></a><tt class="py-lineno">  67</tt>  <tt class="py-line"><tt class="py-docstring">    &gt;&gt;&gt; po #doctest: +ELLIPSIS</tt> </tt>
+<a name="L68"></a><tt class="py-lineno">  68</tt>  <tt class="py-line"><tt class="py-docstring">    &lt;POFile instance at ...&gt;</tt> </tt>
+<a name="L69"></a><tt class="py-lineno">  69</tt>  <tt class="py-line"><tt class="py-docstring">    &gt;&gt;&gt; import os, tempfile</tt> </tt>
+<a name="L70"></a><tt class="py-lineno">  70</tt>  <tt class="py-line"><tt class="py-docstring">    &gt;&gt;&gt; for fname in ['test_iso-8859-15.po', 'test_utf8.po']:</tt> </tt>
+<a name="L71"></a><tt class="py-lineno">  71</tt>  <tt class="py-line"><tt class="py-docstring">    ...     orig_po = polib.pofile('tests/'+fname)</tt> </tt>
+<a name="L72"></a><tt class="py-lineno">  72</tt>  <tt class="py-line"><tt class="py-docstring">    ...     tmpf = tempfile.NamedTemporaryFile().name</tt> </tt>
+<a name="L73"></a><tt class="py-lineno">  73</tt>  <tt class="py-line"><tt class="py-docstring">    ...     orig_po.save(tmpf)</tt> </tt>
+<a name="L74"></a><tt class="py-lineno">  74</tt>  <tt class="py-line"><tt class="py-docstring">    ...     try:</tt> </tt>
+<a name="L75"></a><tt class="py-lineno">  75</tt>  <tt class="py-line"><tt class="py-docstring">    ...         new_po = polib.pofile(tmpf)</tt> </tt>
+<a name="L76"></a><tt class="py-lineno">  76</tt>  <tt class="py-line"><tt class="py-docstring">    ...         for old, new in zip(orig_po, new_po):</tt> </tt>
+<a name="L77"></a><tt class="py-lineno">  77</tt>  <tt class="py-line"><tt class="py-docstring">    ...             if old.msgid != new.msgid:</tt> </tt>
+<a name="L78"></a><tt class="py-lineno">  78</tt>  <tt class="py-line"><tt class="py-docstring">    ...                 old.msgid</tt> </tt>
+<a name="L79"></a><tt class="py-lineno">  79</tt>  <tt class="py-line"><tt class="py-docstring">    ...                 new.msgid</tt> </tt>
+<a name="L80"></a><tt class="py-lineno">  80</tt>  <tt class="py-line"><tt class="py-docstring">    ...             if old.msgstr != new.msgstr:</tt> </tt>
+<a name="L81"></a><tt class="py-lineno">  81</tt>  <tt class="py-line"><tt class="py-docstring">    ...                 old.msgid</tt> </tt>
+<a name="L82"></a><tt class="py-lineno">  82</tt>  <tt class="py-line"><tt class="py-docstring">    ...                 new.msgid</tt> </tt>
+<a name="L83"></a><tt class="py-lineno">  83</tt>  <tt class="py-line"><tt class="py-docstring">    ...     finally:</tt> </tt>
+<a name="L84"></a><tt class="py-lineno">  84</tt>  <tt class="py-line"><tt class="py-docstring">    ...         os.unlink(tmpf)</tt> </tt>
+<a name="L85"></a><tt class="py-lineno">  85</tt>  <tt class="py-line"><tt class="py-docstring">    """</tt> </tt>
+<a name="L86"></a><tt class="py-lineno">  86</tt>  <tt class="py-line">    <tt class="py-keyword">if</tt> <tt class="py-name">kwargs</tt><tt class="py-op">.</tt><tt class="py-name">get</tt><tt class="py-op">(</tt><tt class="py-string">'autodetect_encoding'</tt><tt class="py-op">,</tt> <tt class="py-name">True</tt><tt class="py-op">)</tt> <tt class="py-op">==</tt> <tt class="py-name">True</tt><tt class="py-op">:</tt> </tt>
+<a name="L87"></a><tt class="py-lineno">  87</tt>  <tt class="py-line">        <tt class="py-name">enc</tt> <tt class="py-op">=</tt> <tt id="link-1" class="py-name" targets="Function polib.detect_encoding()=polib-module.html#detect_encoding"><a title="polib.detect_encoding" class="py-name" href="#" onclick="return doclink('link-1', 'detect_encoding', 'link-1');">detect_encoding</a></tt><tt class="py-op">(</tt><tt class="py-name">fpath</tt><tt class="py-op">)</tt> </tt>
+<a name="L88"></a><tt class="py-lineno">  88</tt>  <tt class="py-line">    <tt class="py-keyword">else</tt><tt class="py-op">:</tt> </tt>
+<a name="L89"></a><tt class="py-lineno">  89</tt>  <tt class="py-line">        <tt class="py-name">enc</tt> <tt class="py-op">=</tt> <tt class="py-name">kwargs</tt><tt class="py-op">.</tt><tt class="py-name">get</tt><tt class="py-op">(</tt><tt class="py-string">'encoding'</tt><tt class="py-op">,</tt> <tt id="link-2" class="py-name"><a title="polib.default_encoding" class="py-name" href="#" onclick="return doclink('link-2', 'default_encoding', 'link-0');">default_encoding</a></tt><tt class="py-op">)</tt> </tt>
+<a name="L90"></a><tt class="py-lineno">  90</tt>  <tt class="py-line">    <tt class="py-name">parser</tt> <tt class="py-op">=</tt> <tt id="link-3" class="py-name" targets="Class polib._POFileParser=polib._POFileParser-class.html"><a title="polib._POFileParser" class="py-name" href="#" onclick="return doclink('link-3', '_POFileParser', 'link-3');">_POFileParser</a></tt><tt class="py-op">(</tt><tt class="py-name">fpath</tt><tt class="py-op">)</tt> </tt>
+<a name="L91"></a><tt class="py-lineno">  91</tt>  <tt class="py-line">    <tt class="py-name">instance</tt> <tt class="py-op">=</tt> <tt class="py-name">parser</tt><tt class="py-op">.</tt><tt id="link-4" class="py-name" targets="Method polib._MOFileParser.parse()=polib._MOFileParser-class.html#parse,Method polib._POFileParser.parse()=polib._POFileParser-class.html#parse"><a title="polib._MOFileParser.parse
 polib._POFileParser.parse" class="py-name" href="#" onclick="return doclink('link-4', 'parse', 'link-4');">parse</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
-<a name="L105"></a><tt class="py-lineno"> 105</tt>  <tt class="py-line">    <tt class="py-name">instance</tt><tt class="py-op">.</tt><tt class="py-name">wrapwidth</tt> <tt class="py-op">=</tt> <tt class="py-name">_dictget</tt><tt class="py-op">(</tt><tt class="py-name">kwargs</tt><tt class="py-op">,</tt> <tt class="py-string">'wrapwidth'</tt><tt class="py-op">,</tt> <tt class="py-number">78</tt><tt class="py-op">)</tt> </tt>
-<a name="L106"></a><tt class="py-lineno"> 106</tt>  <tt class="py-line">    <tt class="py-name">instance</tt><tt class="py-op">.</tt><tt class="py-name">encoding</tt>  <tt class="py-op">=</tt> <tt class="py-name">enc</tt> </tt>
-<a name="L107"></a><tt class="py-lineno"> 107</tt>  <tt class="py-line">    <tt class="py-keyword">return</tt> <tt class="py-name">instance</tt> </tt>
-</div><a name="L108"></a><tt class="py-lineno"> 108</tt>  <tt class="py-line"> </tt>
-<a name="L109"></a><tt class="py-lineno"> 109</tt>  <tt class="py-line"><tt class="py-comment"># }}}</tt> </tt>
-<a name="L110"></a><tt class="py-lineno"> 110</tt>  <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment"># function mofile() {{{</tt> </tt>
-<a name="L111"></a><tt class="py-lineno"> 111</tt>  <tt class="py-line"><tt class="py-comment"></tt> </tt>
-<a name="mofile"></a><div id="mofile-def"><a name="L112"></a><tt class="py-lineno"> 112</tt> <a class="py-toggle" href="#" id="mofile-toggle" onclick="return toggle('mofile');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="polib-module.html#mofile">mofile</a><tt class="py-op">(</tt><tt class="py-param">fpath</tt><tt class="py-op">,</tt> <tt class="py-op">**</tt><tt class="py-param">kwargs</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
-</div><div id="mofile-collapsed" style="display:none;" pad="++++" indent="++++"></div><div id="mofile-expanded"><a name="L113"></a><tt class="py-lineno"> 113</tt>  <tt class="py-line">    <tt class="py-docstring">"""</tt> </tt>
-<a name="L114"></a><tt class="py-lineno"> 114</tt>  <tt class="py-line"><tt class="py-docstring">    Convenience function that parse the mo file *fpath* and return</tt> </tt>
-<a name="L115"></a><tt class="py-lineno"> 115</tt>  <tt class="py-line"><tt class="py-docstring">    a MOFile instance.</tt> </tt>
-<a name="L116"></a><tt class="py-lineno"> 116</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
-<a name="L117"></a><tt class="py-lineno"> 117</tt>  <tt class="py-line"><tt class="py-docstring">    **Keyword arguments**:</tt> </tt>
-<a name="L118"></a><tt class="py-lineno"> 118</tt>  <tt class="py-line"><tt class="py-docstring">      - *fpath*: string, full or relative path to the mo file to parse</tt> </tt>
-<a name="L119"></a><tt class="py-lineno"> 119</tt>  <tt class="py-line"><tt class="py-docstring">      - *wrapwidth*: integer, the wrap width, only useful when -w option was</tt> </tt>
-<a name="L120"></a><tt class="py-lineno"> 120</tt>  <tt class="py-line"><tt class="py-docstring">        passed to xgettext to generate the po file that was used to format</tt> </tt>
-<a name="L121"></a><tt class="py-lineno"> 121</tt>  <tt class="py-line"><tt class="py-docstring">        the mo file (optional, default to 78)</tt> </tt>
-<a name="L122"></a><tt class="py-lineno"> 122</tt>  <tt class="py-line"><tt class="py-docstring">      - *autodetect_encoding*: boolean, if set to False the function will</tt> </tt>
-<a name="L123"></a><tt class="py-lineno"> 123</tt>  <tt class="py-line"><tt class="py-docstring">        not try to detect the po file encoding (optional, default to True)</tt> </tt>
-<a name="L124"></a><tt class="py-lineno"> 124</tt>  <tt class="py-line"><tt class="py-docstring">      - *encoding*: string, an encoding, only relevant if autodetect_encoding</tt> </tt>
-<a name="L125"></a><tt class="py-lineno"> 125</tt>  <tt class="py-line"><tt class="py-docstring">        is set to False</tt> </tt>
-<a name="L126"></a><tt class="py-lineno"> 126</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
-<a name="L127"></a><tt class="py-lineno"> 127</tt>  <tt class="py-line"><tt class="py-docstring">    **Example**:</tt> </tt>
-<a name="L128"></a><tt class="py-lineno"> 128</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
-<a name="L129"></a><tt class="py-lineno"> 129</tt>  <tt class="py-line"><tt class="py-docstring">    &gt;&gt;&gt; import polib</tt> </tt>
-<a name="L130"></a><tt class="py-lineno"> 130</tt>  <tt class="py-line"><tt class="py-docstring">    &gt;&gt;&gt; mo = polib.mofile('tests/test_utf8.mo')</tt> </tt>
-<a name="L131"></a><tt class="py-lineno"> 131</tt>  <tt class="py-line"><tt class="py-docstring">    &gt;&gt;&gt; mo #doctest: +ELLIPSIS</tt> </tt>
-<a name="L132"></a><tt class="py-lineno"> 132</tt>  <tt class="py-line"><tt class="py-docstring">    &lt;MOFile instance at ...&gt;</tt> </tt>
-<a name="L133"></a><tt class="py-lineno"> 133</tt>  <tt class="py-line"><tt class="py-docstring">    &gt;&gt;&gt; import os, tempfile</tt> </tt>
-<a name="L134"></a><tt class="py-lineno"> 134</tt>  <tt class="py-line"><tt class="py-docstring">    &gt;&gt;&gt; for fname in ['test_iso-8859-15.mo', 'test_utf8.mo']:</tt> </tt>
-<a name="L135"></a><tt class="py-lineno"> 135</tt>  <tt class="py-line"><tt class="py-docstring">    ...     orig_mo = polib.mofile('tests/'+fname)</tt> </tt>
-<a name="L136"></a><tt class="py-lineno"> 136</tt>  <tt class="py-line"><tt class="py-docstring">    ...     tmpf = tempfile.NamedTemporaryFile().name</tt> </tt>
-<a name="L137"></a><tt class="py-lineno"> 137</tt>  <tt class="py-line"><tt class="py-docstring">    ...     orig_mo.save(tmpf)</tt> </tt>
-<a name="L138"></a><tt class="py-lineno"> 138</tt>  <tt class="py-line"><tt class="py-docstring">    ...     try:</tt> </tt>
-<a name="L139"></a><tt class="py-lineno"> 139</tt>  <tt class="py-line"><tt class="py-docstring">    ...         new_mo = polib.mofile(tmpf)</tt> </tt>
-<a name="L140"></a><tt class="py-lineno"> 140</tt>  <tt class="py-line"><tt class="py-docstring">    ...         for old, new in zip(orig_mo, new_mo):</tt> </tt>
-<a name="L141"></a><tt class="py-lineno"> 141</tt>  <tt class="py-line"><tt class="py-docstring">    ...             if old.msgid != new.msgid:</tt> </tt>
-<a name="L142"></a><tt class="py-lineno"> 142</tt>  <tt class="py-line"><tt class="py-docstring">    ...                 old.msgstr</tt> </tt>
-<a name="L143"></a><tt class="py-lineno"> 143</tt>  <tt class="py-line"><tt class="py-docstring">    ...                 new.msgstr</tt> </tt>
-<a name="L144"></a><tt class="py-lineno"> 144</tt>  <tt class="py-line"><tt class="py-docstring">    ...     finally:</tt> </tt>
-<a name="L145"></a><tt class="py-lineno"> 145</tt>  <tt class="py-line"><tt class="py-docstring">    ...         os.unlink(tmpf)</tt> </tt>
-<a name="L146"></a><tt class="py-lineno"> 146</tt>  <tt class="py-line"><tt class="py-docstring">    """</tt> </tt>
-<a name="L147"></a><tt class="py-lineno"> 147</tt>  <tt class="py-line">    <tt class="py-keyword">if</tt> <tt class="py-name">_dictget</tt><tt class="py-op">(</tt><tt class="py-name">kwargs</tt><tt class="py-op">,</tt> <tt class="py-string">'autodetect_encoding'</tt><tt class="py-op">,</tt> <tt class="py-name">True</tt><tt class="py-op">)</tt> <tt class="py-op">==</tt> <tt class="py-name">True</tt><tt class="py-op">:</tt> </tt>
-<a name="L148"></a><tt class="py-lineno"> 148</tt>  <tt class="py-line">        <tt class="py-name">enc</tt> <tt class="py-op">=</tt> <tt id="link-5" class="py-name"><a title="polib.detect_encoding" class="py-name" href="#" onclick="return doclink('link-5', 'detect_encoding', 'link-1');">detect_encoding</a></tt><tt class="py-op">(</tt><tt class="py-name">fpath</tt><tt class="py-op">)</tt> </tt>
-<a name="L149"></a><tt class="py-lineno"> 149</tt>  <tt class="py-line">    <tt class="py-keyword">else</tt><tt class="py-op">:</tt> </tt>
-<a name="L150"></a><tt class="py-lineno"> 150</tt>  <tt class="py-line">        <tt class="py-name">enc</tt> <tt class="py-op">=</tt> <tt class="py-name">_dictget</tt><tt class="py-op">(</tt><tt class="py-name">kwargs</tt><tt class="py-op">,</tt> <tt class="py-string">'encoding'</tt><tt class="py-op">,</tt> <tt id="link-6" class="py-name"><a title="polib.default_encoding" class="py-name" href="#" onclick="return doclink('link-6', 'default_encoding', 'link-0');">default_encoding</a></tt><tt class="py-op">)</tt> </tt>
-<a name="L151"></a><tt class="py-lineno"> 151</tt>  <tt class="py-line">    <tt class="py-name">parser</tt> <tt class="py-op">=</tt> <tt id="link-7" class="py-name" targets="Class polib._MOFileParser=polib._MOFileParser-class.html"><a title="polib._MOFileParser" class="py-name" href="#" onclick="return doclink('link-7', '_MOFileParser', 'link-7');">_MOFileParser</a></tt><tt class="py-op">(</tt><tt class="py-name">fpath</tt><tt class="py-op">)</tt> </tt>
-<a name="L152"></a><tt class="py-lineno"> 152</tt>  <tt class="py-line">    <tt class="py-name">instance</tt> <tt class="py-op">=</tt> <tt class="py-name">parser</tt><tt class="py-op">.</tt><tt id="link-8" class="py-name"><a title="polib._MOFileParser.parse
+<a name="L92"></a><tt class="py-lineno">  92</tt>  <tt class="py-line">    <tt class="py-name">instance</tt><tt class="py-op">.</tt><tt class="py-name">wrapwidth</tt> <tt class="py-op">=</tt> <tt class="py-name">kwargs</tt><tt class="py-op">.</tt><tt class="py-name">get</tt><tt class="py-op">(</tt><tt class="py-string">'wrapwidth'</tt><tt class="py-op">,</tt> <tt class="py-number">78</tt><tt class="py-op">)</tt> </tt>
+<a name="L93"></a><tt class="py-lineno">  93</tt>  <tt class="py-line">    <tt class="py-name">instance</tt><tt class="py-op">.</tt><tt class="py-name">encoding</tt>  <tt class="py-op">=</tt> <tt class="py-name">enc</tt> </tt>
+<a name="L94"></a><tt class="py-lineno">  94</tt>  <tt class="py-line">    <tt class="py-keyword">return</tt> <tt class="py-name">instance</tt> </tt>
+</div><a name="L95"></a><tt class="py-lineno">  95</tt>  <tt class="py-line"> </tt>
+<a name="L96"></a><tt class="py-lineno">  96</tt>  <tt class="py-line"><tt class="py-comment"># }}}</tt> </tt>
+<a name="L97"></a><tt class="py-lineno">  97</tt>  <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment"># function mofile() {{{</tt> </tt>
+<a name="L98"></a><tt class="py-lineno">  98</tt>  <tt class="py-line"><tt class="py-comment"></tt> </tt>
+<a name="mofile"></a><div id="mofile-def"><a name="L99"></a><tt class="py-lineno">  99</tt> <a class="py-toggle" href="#" id="mofile-toggle" onclick="return toggle('mofile');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="polib-module.html#mofile">mofile</a><tt class="py-op">(</tt><tt class="py-param">fpath</tt><tt class="py-op">,</tt> <tt class="py-op">**</tt><tt class="py-param">kwargs</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
+</div><div id="mofile-collapsed" style="display:none;" pad="++++" indent="++++"></div><div id="mofile-expanded"><a name="L100"></a><tt class="py-lineno"> 100</tt>  <tt class="py-line">    <tt class="py-docstring">"""</tt> </tt>
+<a name="L101"></a><tt class="py-lineno"> 101</tt>  <tt class="py-line"><tt class="py-docstring">    Convenience function that parse the mo file *fpath* and return</tt> </tt>
+<a name="L102"></a><tt class="py-lineno"> 102</tt>  <tt class="py-line"><tt class="py-docstring">    a MOFile instance.</tt> </tt>
+<a name="L103"></a><tt class="py-lineno"> 103</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
+<a name="L104"></a><tt class="py-lineno"> 104</tt>  <tt class="py-line"><tt class="py-docstring">    **Keyword arguments**:</tt> </tt>
+<a name="L105"></a><tt class="py-lineno"> 105</tt>  <tt class="py-line"><tt class="py-docstring">      - *fpath*: string, full or relative path to the mo file to parse</tt> </tt>
+<a name="L106"></a><tt class="py-lineno"> 106</tt>  <tt class="py-line"><tt class="py-docstring">      - *wrapwidth*: integer, the wrap width, only useful when -w option was</tt> </tt>
+<a name="L107"></a><tt class="py-lineno"> 107</tt>  <tt class="py-line"><tt class="py-docstring">        passed to xgettext to generate the po file that was used to format</tt> </tt>
+<a name="L108"></a><tt class="py-lineno"> 108</tt>  <tt class="py-line"><tt class="py-docstring">        the mo file (optional, default to 78)</tt> </tt>
+<a name="L109"></a><tt class="py-lineno"> 109</tt>  <tt class="py-line"><tt class="py-docstring">      - *autodetect_encoding*: boolean, if set to False the function will</tt> </tt>
+<a name="L110"></a><tt class="py-lineno"> 110</tt>  <tt class="py-line"><tt class="py-docstring">        not try to detect the po file encoding (optional, default to True)</tt> </tt>
+<a name="L111"></a><tt class="py-lineno"> 111</tt>  <tt class="py-line"><tt class="py-docstring">      - *encoding*: string, an encoding, only relevant if autodetect_encoding</tt> </tt>
+<a name="L112"></a><tt class="py-lineno"> 112</tt>  <tt class="py-line"><tt class="py-docstring">        is set to False</tt> </tt>
+<a name="L113"></a><tt class="py-lineno"> 113</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
+<a name="L114"></a><tt class="py-lineno"> 114</tt>  <tt class="py-line"><tt class="py-docstring">    **Example**:</tt> </tt>
+<a name="L115"></a><tt class="py-lineno"> 115</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
+<a name="L116"></a><tt class="py-lineno"> 116</tt>  <tt class="py-line"><tt class="py-docstring">    &gt;&gt;&gt; import polib</tt> </tt>
+<a name="L117"></a><tt class="py-lineno"> 117</tt>  <tt class="py-line"><tt class="py-docstring">    &gt;&gt;&gt; mo = polib.mofile('tests/test_utf8.mo')</tt> </tt>
+<a name="L118"></a><tt class="py-lineno"> 118</tt>  <tt class="py-line"><tt class="py-docstring">    &gt;&gt;&gt; mo #doctest: +ELLIPSIS</tt> </tt>
+<a name="L119"></a><tt class="py-lineno"> 119</tt>  <tt class="py-line"><tt class="py-docstring">    &lt;MOFile instance at ...&gt;</tt> </tt>
+<a name="L120"></a><tt class="py-lineno"> 120</tt>  <tt class="py-line"><tt class="py-docstring">    &gt;&gt;&gt; import os, tempfile</tt> </tt>
+<a name="L121"></a><tt class="py-lineno"> 121</tt>  <tt class="py-line"><tt class="py-docstring">    &gt;&gt;&gt; for fname in ['test_iso-8859-15.mo', 'test_utf8.mo']:</tt> </tt>
+<a name="L122"></a><tt class="py-lineno"> 122</tt>  <tt class="py-line"><tt class="py-docstring">    ...     orig_mo = polib.mofile('tests/'+fname)</tt> </tt>
+<a name="L123"></a><tt class="py-lineno"> 123</tt>  <tt class="py-line"><tt class="py-docstring">    ...     tmpf = tempfile.NamedTemporaryFile().name</tt> </tt>
+<a name="L124"></a><tt class="py-lineno"> 124</tt>  <tt class="py-line"><tt class="py-docstring">    ...     orig_mo.save(tmpf)</tt> </tt>
+<a name="L125"></a><tt class="py-lineno"> 125</tt>  <tt class="py-line"><tt class="py-docstring">    ...     try:</tt> </tt>
+<a name="L126"></a><tt class="py-lineno"> 126</tt>  <tt class="py-line"><tt class="py-docstring">    ...         new_mo = polib.mofile(tmpf)</tt> </tt>
+<a name="L127"></a><tt class="py-lineno"> 127</tt>  <tt class="py-line"><tt class="py-docstring">    ...         for old, new in zip(orig_mo, new_mo):</tt> </tt>
+<a name="L128"></a><tt class="py-lineno"> 128</tt>  <tt class="py-line"><tt class="py-docstring">    ...             if old.msgid != new.msgid:</tt> </tt>
+<a name="L129"></a><tt class="py-lineno"> 129</tt>  <tt class="py-line"><tt class="py-docstring">    ...                 old.msgstr</tt> </tt>
+<a name="L130"></a><tt class="py-lineno"> 130</tt>  <tt class="py-line"><tt class="py-docstring">    ...                 new.msgstr</tt> </tt>
+<a name="L131"></a><tt class="py-lineno"> 131</tt>  <tt class="py-line"><tt class="py-docstring">    ...     finally:</tt> </tt>
+<a name="L132"></a><tt class="py-lineno"> 132</tt>  <tt class="py-line"><tt class="py-docstring">    ...         os.unlink(tmpf)</tt> </tt>
+<a name="L133"></a><tt class="py-lineno"> 133</tt>  <tt class="py-line"><tt class="py-docstring">    """</tt> </tt>
+<a name="L134"></a><tt class="py-lineno"> 134</tt>  <tt class="py-line">    <tt class="py-keyword">if</tt> <tt class="py-name">kwargs</tt><tt class="py-op">.</tt><tt class="py-name">get</tt><tt class="py-op">(</tt><tt class="py-string">'autodetect_encoding'</tt><tt class="py-op">,</tt> <tt class="py-name">True</tt><tt class="py-op">)</tt> <tt class="py-op">==</tt> <tt class="py-name">True</tt><tt class="py-op">:</tt> </tt>
+<a name="L135"></a><tt class="py-lineno"> 135</tt>  <tt class="py-line">        <tt class="py-name">enc</tt> <tt class="py-op">=</tt> <tt id="link-5" class="py-name"><a title="polib.detect_encoding" class="py-name" href="#" onclick="return doclink('link-5', 'detect_encoding', 'link-1');">detect_encoding</a></tt><tt class="py-op">(</tt><tt class="py-name">fpath</tt><tt class="py-op">)</tt> </tt>
+<a name="L136"></a><tt class="py-lineno"> 136</tt>  <tt class="py-line">    <tt class="py-keyword">else</tt><tt class="py-op">:</tt> </tt>
+<a name="L137"></a><tt class="py-lineno"> 137</tt>  <tt class="py-line">        <tt class="py-name">enc</tt> <tt class="py-op">=</tt> <tt class="py-name">kwargs</tt><tt class="py-op">.</tt><tt class="py-name">get</tt><tt class="py-op">(</tt><tt class="py-string">'encoding'</tt><tt class="py-op">,</tt> <tt id="link-6" class="py-name"><a title="polib.default_encoding" class="py-name" href="#" onclick="return doclink('link-6', 'default_encoding', 'link-0');">default_encoding</a></tt><tt class="py-op">)</tt> </tt>
+<a name="L138"></a><tt class="py-lineno"> 138</tt>  <tt class="py-line">    <tt class="py-name">parser</tt> <tt class="py-op">=</tt> <tt id="link-7" class="py-name" targets="Class polib._MOFileParser=polib._MOFileParser-class.html"><a title="polib._MOFileParser" class="py-name" href="#" onclick="return doclink('link-7', '_MOFileParser', 'link-7');">_MOFileParser</a></tt><tt class="py-op">(</tt><tt class="py-name">fpath</tt><tt class="py-op">)</tt> </tt>
+<a name="L139"></a><tt class="py-lineno"> 139</tt>  <tt class="py-line">    <tt class="py-name">instance</tt> <tt class="py-op">=</tt> <tt class="py-name">parser</tt><tt class="py-op">.</tt><tt id="link-8" class="py-name"><a title="polib._MOFileParser.parse
 polib._POFileParser.parse" class="py-name" href="#" onclick="return doclink('link-8', 'parse', 'link-4');">parse</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
-<a name="L153"></a><tt class="py-lineno"> 153</tt>  <tt class="py-line">    <tt class="py-name">instance</tt><tt class="py-op">.</tt><tt class="py-name">wrapwidth</tt> <tt class="py-op">=</tt> <tt class="py-name">_dictget</tt><tt class="py-op">(</tt><tt class="py-name">kwargs</tt><tt class="py-op">,</tt> <tt class="py-string">'wrapwidth'</tt><tt class="py-op">,</tt> <tt class="py-number">78</tt><tt class="py-op">)</tt> </tt>
-<a name="L154"></a><tt class="py-lineno"> 154</tt>  <tt class="py-line">    <tt class="py-name">instance</tt><tt class="py-op">.</tt><tt class="py-name">encoding</tt> <tt class="py-op">=</tt> <tt class="py-name">enc</tt> </tt>
-<a name="L155"></a><tt class="py-lineno"> 155</tt>  <tt class="py-line">    <tt class="py-keyword">return</tt> <tt class="py-name">instance</tt> </tt>
-</div><a name="L156"></a><tt class="py-lineno"> 156</tt>  <tt class="py-line"> </tt>
-<a name="L157"></a><tt class="py-lineno"> 157</tt>  <tt class="py-line"><tt class="py-comment"># }}}</tt> </tt>
-<a name="L158"></a><tt class="py-lineno"> 158</tt>  <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment"># function detect_encoding() {{{</tt> </tt>
-<a name="L159"></a><tt class="py-lineno"> 159</tt>  <tt class="py-line"><tt class="py-comment"></tt> </tt>
-<a name="detect_encoding"></a><div id="detect_encoding-def"><a name="L160"></a><tt class="py-lineno"> 160</tt> <a class="py-toggle" href="#" id="detect_encoding-toggle" onclick="return toggle('detect_encoding');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="polib-module.html#detect_encoding">detect_encoding</a><tt class="py-op">(</tt><tt class="py-param">fpath</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
-</div><div id="detect_encoding-collapsed" style="display:none;" pad="++++" indent="++++"></div><div id="detect_encoding-expanded"><a name="L161"></a><tt class="py-lineno"> 161</tt>  <tt class="py-line">    <tt class="py-docstring">"""</tt> </tt>
-<a name="L162"></a><tt class="py-lineno"> 162</tt>  <tt class="py-line"><tt class="py-docstring">    Try to detect the encoding used by the file *fpath*. The function will</tt> </tt>
-<a name="L163"></a><tt class="py-lineno"> 163</tt>  <tt class="py-line"><tt class="py-docstring">    return polib default *encoding* if it's unable to detect it.</tt> </tt>
-<a name="L164"></a><tt class="py-lineno"> 164</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
-<a name="L165"></a><tt class="py-lineno"> 165</tt>  <tt class="py-line"><tt class="py-docstring">    **Keyword argument**:</tt> </tt>
-<a name="L166"></a><tt class="py-lineno"> 166</tt>  <tt class="py-line"><tt class="py-docstring">      - *fpath*: string, full or relative path to the mo file to parse.</tt> </tt>
-<a name="L167"></a><tt class="py-lineno"> 167</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
-<a name="L168"></a><tt class="py-lineno"> 168</tt>  <tt class="py-line"><tt class="py-docstring">    **Examples**:</tt> </tt>
-<a name="L169"></a><tt class="py-lineno"> 169</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
-<a name="L170"></a><tt class="py-lineno"> 170</tt>  <tt class="py-line"><tt class="py-docstring">    &gt;&gt;&gt; print(detect_encoding('tests/test_noencoding.po'))</tt> </tt>
-<a name="L171"></a><tt class="py-lineno"> 171</tt>  <tt class="py-line"><tt class="py-docstring">    utf-8</tt> </tt>
-<a name="L172"></a><tt class="py-lineno"> 172</tt>  <tt class="py-line"><tt class="py-docstring">    &gt;&gt;&gt; print(detect_encoding('tests/test_utf8.po'))</tt> </tt>
-<a name="L173"></a><tt class="py-lineno"> 173</tt>  <tt class="py-line"><tt class="py-docstring">    UTF-8</tt> </tt>
-<a name="L174"></a><tt class="py-lineno"> 174</tt>  <tt class="py-line"><tt class="py-docstring">    &gt;&gt;&gt; print(detect_encoding('tests/test_utf8.mo'))</tt> </tt>
-<a name="L175"></a><tt class="py-lineno"> 175</tt>  <tt class="py-line"><tt class="py-docstring">    UTF-8</tt> </tt>
-<a name="L176"></a><tt class="py-lineno"> 176</tt>  <tt class="py-line"><tt class="py-docstring">    &gt;&gt;&gt; print(detect_encoding('tests/test_iso-8859-15.po'))</tt> </tt>
-<a name="L177"></a><tt class="py-lineno"> 177</tt>  <tt class="py-line"><tt class="py-docstring">    ISO_8859-15</tt> </tt>
-<a name="L178"></a><tt class="py-lineno"> 178</tt>  <tt class="py-line"><tt class="py-docstring">    &gt;&gt;&gt; print(detect_encoding('tests/test_iso-8859-15.mo'))</tt> </tt>
-<a name="L179"></a><tt class="py-lineno"> 179</tt>  <tt class="py-line"><tt class="py-docstring">    ISO_8859-15</tt> </tt>
-<a name="L180"></a><tt class="py-lineno"> 180</tt>  <tt class="py-line"><tt class="py-docstring">    """</tt> </tt>
-<a name="L181"></a><tt class="py-lineno"> 181</tt>  <tt class="py-line">    <tt class="py-keyword">import</tt> <tt class="py-name">re</tt> </tt>
-<a name="L182"></a><tt class="py-lineno"> 182</tt>  <tt class="py-line">    <tt class="py-name">rx</tt> <tt class="py-op">=</tt> <tt class="py-name">re</tt><tt class="py-op">.</tt><tt class="py-name">compile</tt><tt class="py-op">(</tt><tt class="py-string">r'"?Content-Type:.+? charset=([\w_\-:\.]+)'</tt><tt class="py-op">)</tt> </tt>
-<a name="L183"></a><tt class="py-lineno"> 183</tt>  <tt class="py-line">    <tt class="py-name">f</tt> <tt class="py-op">=</tt> <tt class="py-name">open</tt><tt class="py-op">(</tt><tt class="py-name">fpath</tt><tt class="py-op">)</tt> </tt>
-<a name="L184"></a><tt class="py-lineno"> 184</tt>  <tt class="py-line">    <tt class="py-keyword">for</tt> <tt class="py-name">l</tt> <tt class="py-keyword">in</tt> <tt class="py-name">f</tt><tt class="py-op">:</tt> </tt>
-<a name="L185"></a><tt class="py-lineno"> 185</tt>  <tt class="py-line">        <tt class="py-name">match</tt> <tt class="py-op">=</tt> <tt class="py-name">rx</tt><tt class="py-op">.</tt><tt class="py-name">search</tt><tt class="py-op">(</tt><tt class="py-name">l</tt><tt class="py-op">)</tt> </tt>
-<a name="L186"></a><tt class="py-lineno"> 186</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-name">match</tt><tt class="py-op">:</tt> </tt>
-<a name="L187"></a><tt class="py-lineno"> 187</tt>  <tt class="py-line">            <tt class="py-name">f</tt><tt class="py-op">.</tt><tt class="py-name">close</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
-<a name="L188"></a><tt class="py-lineno"> 188</tt>  <tt class="py-line">            <tt class="py-keyword">return</tt> <tt class="py-name">_strstrip</tt><tt class="py-op">(</tt><tt class="py-name">match</tt><tt class="py-op">.</tt><tt class="py-name">group</tt><tt class="py-op">(</tt><tt class="py-number">1</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
-<a name="L189"></a><tt class="py-lineno"> 189</tt>  <tt class="py-line">    <tt class="py-name">f</tt><tt class="py-op">.</tt><tt class="py-name">close</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
-<a name="L190"></a><tt class="py-lineno"> 190</tt>  <tt class="py-line">    <tt class="py-keyword">return</tt> <tt id="link-9" class="py-name"><a title="polib.default_encoding" class="py-name" href="#" onclick="return doclink('link-9', 'default_encoding', 'link-0');">default_encoding</a></tt> </tt>
-</div><a name="L191"></a><tt class="py-lineno"> 191</tt>  <tt class="py-line"> </tt>
-<a name="L192"></a><tt class="py-lineno"> 192</tt>  <tt class="py-line"><tt class="py-comment"># }}}</tt> </tt>
-<a name="L193"></a><tt class="py-lineno"> 193</tt>  <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment"># function escape() {{{</tt> </tt>
-<a name="L194"></a><tt class="py-lineno"> 194</tt>  <tt class="py-line"><tt class="py-comment"></tt> </tt>
-<a name="escape"></a><div id="escape-def"><a name="L195"></a><tt class="py-lineno"> 195</tt> <a class="py-toggle" href="#" id="escape-toggle" onclick="return toggle('escape');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="polib-module.html#escape">escape</a><tt class="py-op">(</tt><tt class="py-param">st</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
-</div><div id="escape-collapsed" style="display:none;" pad="++++" indent="++++"></div><div id="escape-expanded"><a name="L196"></a><tt class="py-lineno"> 196</tt>  <tt class="py-line">    <tt class="py-docstring">"""</tt> </tt>
-<a name="L197"></a><tt class="py-lineno"> 197</tt>  <tt class="py-line"><tt class="py-docstring">    Escape special chars and return the given string *st*.</tt> </tt>
-<a name="L198"></a><tt class="py-lineno"> 198</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
-<a name="L199"></a><tt class="py-lineno"> 199</tt>  <tt class="py-line"><tt class="py-docstring">    **Examples**:</tt> </tt>
-<a name="L200"></a><tt class="py-lineno"> 200</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
-<a name="L201"></a><tt class="py-lineno"> 201</tt>  <tt class="py-line"><tt class="py-docstring">    &gt;&gt;&gt; escape('\\t and \\n and \\r and " and \\\\')</tt> </tt>
-<a name="L202"></a><tt class="py-lineno"> 202</tt>  <tt class="py-line"><tt class="py-docstring">    '\\\\t and \\\\n and \\\\r and \\\\" and \\\\\\\\'</tt> </tt>
-<a name="L203"></a><tt class="py-lineno"> 203</tt>  <tt class="py-line"><tt class="py-docstring">    """</tt> </tt>
-<a name="L204"></a><tt class="py-lineno"> 204</tt>  <tt class="py-line">    <tt class="py-name">st</tt> <tt class="py-op">=</tt> <tt class="py-name">_strreplace</tt><tt class="py-op">(</tt><tt class="py-name">st</tt><tt class="py-op">,</tt> <tt class="py-string">'\\'</tt><tt class="py-op">,</tt> <tt class="py-string">r'\\'</tt><tt class="py-op">)</tt> </tt>
-<a name="L205"></a><tt class="py-lineno"> 205</tt>  <tt class="py-line">    <tt class="py-name">st</tt> <tt class="py-op">=</tt> <tt class="py-name">_strreplace</tt><tt class="py-op">(</tt><tt class="py-name">st</tt><tt class="py-op">,</tt> <tt class="py-string">'\t'</tt><tt class="py-op">,</tt> <tt class="py-string">r'\t'</tt><tt class="py-op">)</tt> </tt>
-<a name="L206"></a><tt class="py-lineno"> 206</tt>  <tt class="py-line">    <tt class="py-name">st</tt> <tt class="py-op">=</tt> <tt class="py-name">_strreplace</tt><tt class="py-op">(</tt><tt class="py-name">st</tt><tt class="py-op">,</tt> <tt class="py-string">'\r'</tt><tt class="py-op">,</tt> <tt class="py-string">r'\r'</tt><tt class="py-op">)</tt> </tt>
-<a name="L207"></a><tt class="py-lineno"> 207</tt>  <tt class="py-line">    <tt class="py-name">st</tt> <tt class="py-op">=</tt> <tt class="py-name">_strreplace</tt><tt class="py-op">(</tt><tt class="py-name">st</tt><tt class="py-op">,</tt> <tt class="py-string">'\n'</tt><tt class="py-op">,</tt> <tt class="py-string">r'\n'</tt><tt class="py-op">)</tt> </tt>
-<a name="L208"></a><tt class="py-lineno"> 208</tt>  <tt class="py-line">    <tt class="py-name">st</tt> <tt class="py-op">=</tt> <tt class="py-name">_strreplace</tt><tt class="py-op">(</tt><tt class="py-name">st</tt><tt class="py-op">,</tt> <tt class="py-string">'\"'</tt><tt class="py-op">,</tt> <tt class="py-string">r'\"'</tt><tt class="py-op">)</tt> </tt>
-<a name="L209"></a><tt class="py-lineno"> 209</tt>  <tt class="py-line">    <tt class="py-keyword">return</tt> <tt class="py-name">st</tt> </tt>
-</div><a name="L210"></a><tt class="py-lineno"> 210</tt>  <tt class="py-line"> </tt>
-<a name="L211"></a><tt class="py-lineno"> 211</tt>  <tt class="py-line"><tt class="py-comment"># }}}</tt> </tt>
-<a name="L212"></a><tt class="py-lineno"> 212</tt>  <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment"># function unescape() {{{</tt> </tt>
-<a name="L213"></a><tt class="py-lineno"> 213</tt>  <tt class="py-line"><tt class="py-comment"></tt> </tt>
-<a name="unescape"></a><div id="unescape-def"><a name="L214"></a><tt class="py-lineno"> 214</tt> <a class="py-toggle" href="#" id="unescape-toggle" onclick="return toggle('unescape');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="polib-module.html#unescape">unescape</a><tt class="py-op">(</tt><tt class="py-param">st</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
-</div><div id="unescape-collapsed" style="display:none;" pad="++++" indent="++++"></div><div id="unescape-expanded"><a name="L215"></a><tt class="py-lineno"> 215</tt>  <tt class="py-line">    <tt class="py-docstring">"""</tt> </tt>
-<a name="L216"></a><tt class="py-lineno"> 216</tt>  <tt class="py-line"><tt class="py-docstring">    Unescape special chars and return the given string *st*.</tt> </tt>
-<a name="L217"></a><tt class="py-lineno"> 217</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
-<a name="L218"></a><tt class="py-lineno"> 218</tt>  <tt class="py-line"><tt class="py-docstring">    **Examples**:</tt> </tt>
-<a name="L219"></a><tt class="py-lineno"> 219</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
-<a name="L220"></a><tt class="py-lineno"> 220</tt>  <tt class="py-line"><tt class="py-docstring">    &gt;&gt;&gt; unescape('\\\\t and \\\\n and \\\\r and \\\\" and \\\\\\\\')</tt> </tt>
-<a name="L221"></a><tt class="py-lineno"> 221</tt>  <tt class="py-line"><tt class="py-docstring">    '\\t and \\n and \\r and " and \\\\'</tt> </tt>
-<a name="L222"></a><tt class="py-lineno"> 222</tt>  <tt class="py-line"><tt class="py-docstring">    """</tt> </tt>
-<a name="L223"></a><tt class="py-lineno"> 223</tt>  <tt class="py-line">    <tt class="py-name">st</tt> <tt class="py-op">=</tt> <tt class="py-name">_strreplace</tt><tt class="py-op">(</tt><tt class="py-name">st</tt><tt class="py-op">,</tt> <tt class="py-string">r'\"'</tt><tt class="py-op">,</tt> <tt class="py-string">'"'</tt><tt class="py-op">)</tt> </tt>
-<a name="L224"></a><tt class="py-lineno"> 224</tt>  <tt class="py-line">    <tt class="py-name">st</tt> <tt class="py-op">=</tt> <tt class="py-name">_strreplace</tt><tt class="py-op">(</tt><tt class="py-name">st</tt><tt class="py-op">,</tt> <tt class="py-string">r'\n'</tt><tt class="py-op">,</tt> <tt class="py-string">'\n'</tt><tt class="py-op">)</tt> </tt>
-<a name="L225"></a><tt class="py-lineno"> 225</tt>  <tt class="py-line">    <tt class="py-name">st</tt> <tt class="py-op">=</tt> <tt class="py-name">_strreplace</tt><tt class="py-op">(</tt><tt class="py-name">st</tt><tt class="py-op">,</tt> <tt class="py-string">r'\r'</tt><tt class="py-op">,</tt> <tt class="py-string">'\r'</tt><tt class="py-op">)</tt> </tt>
-<a name="L226"></a><tt class="py-lineno"> 226</tt>  <tt class="py-line">    <tt class="py-name">st</tt> <tt class="py-op">=</tt> <tt class="py-name">_strreplace</tt><tt class="py-op">(</tt><tt class="py-name">st</tt><tt class="py-op">,</tt> <tt class="py-string">r'\t'</tt><tt class="py-op">,</tt> <tt class="py-string">'\t'</tt><tt class="py-op">)</tt> </tt>
-<a name="L227"></a><tt class="py-lineno"> 227</tt>  <tt class="py-line">    <tt class="py-name">st</tt> <tt class="py-op">=</tt> <tt class="py-name">_strreplace</tt><tt class="py-op">(</tt><tt class="py-name">st</tt><tt class="py-op">,</tt> <tt class="py-string">r'\\'</tt><tt class="py-op">,</tt> <tt class="py-string">'\\'</tt><tt class="py-op">)</tt> </tt>
-<a name="L228"></a><tt class="py-lineno"> 228</tt>  <tt class="py-line">    <tt class="py-keyword">return</tt> <tt class="py-name">st</tt> </tt>
-</div><a name="L229"></a><tt class="py-lineno"> 229</tt>  <tt class="py-line"> </tt>
-<a name="L230"></a><tt class="py-lineno"> 230</tt>  <tt class="py-line"><tt class="py-comment"># }}}</tt> </tt>
-<a name="L231"></a><tt class="py-lineno"> 231</tt>  <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment"># class _BaseFile {{{</tt> </tt>
-<a name="L232"></a><tt class="py-lineno"> 232</tt>  <tt class="py-line"><tt class="py-comment"></tt> </tt>
-<a name="_BaseFile"></a><div id="_BaseFile-def"><a name="L233"></a><tt class="py-lineno"> 233</tt> <a class="py-toggle" href="#" id="_BaseFile-toggle" onclick="return toggle('_BaseFile');">-</a><tt class="py-line"><tt class="py-keyword">class</tt> <a class="py-def-name" href="polib._BaseFile-class.html">_BaseFile</a><tt class="py-op">(</tt><tt class="py-base-class">list</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
-</div><div id="_BaseFile-collapsed" style="display:none;" pad="++++" indent="++++"></div><div id="_BaseFile-expanded"><a name="L234"></a><tt class="py-lineno"> 234</tt>  <tt class="py-line">    <tt class="py-docstring">"""</tt> </tt>
-<a name="L235"></a><tt class="py-lineno"> 235</tt>  <tt class="py-line"><tt class="py-docstring">    Common parent class for POFile and MOFile classes.</tt> </tt>
-<a name="L236"></a><tt class="py-lineno"> 236</tt>  <tt class="py-line"><tt class="py-docstring">    This class must **not** be instanciated directly.</tt> </tt>
-<a name="L237"></a><tt class="py-lineno"> 237</tt>  <tt class="py-line"><tt class="py-docstring">    """</tt> </tt>
-<a name="L238"></a><tt class="py-lineno"> 238</tt>  <tt class="py-line"> </tt>
-<a name="_BaseFile.__init__"></a><div id="_BaseFile.__init__-def"><a name="L239"></a><tt class="py-lineno"> 239</tt> <a class="py-toggle" href="#" id="_BaseFile.__init__-toggle" onclick="return toggle('_BaseFile.__init__');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="polib._BaseFile-class.html#__init__">__init__</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">fpath</tt><tt class="py-op">=</tt><tt class="py-name">None</tt><tt class="py-op">,</tt> <tt class="py-param">wrapwidth</tt><tt class="py-op">=</tt><tt class="py-number">78</tt><tt class="py-op">,</tt> <tt class="py-param">encoding</tt><tt class="py-op">=</tt><tt id="link-10" class="py-name"><a title="polib.default_encoding" class="py-name" href="#" onclick="return doclink('link-10', 'default_encoding', 'link-0');">default_encoding</a></tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
-</div><div id="_BaseFile.__init__-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="_BaseFile.__init__-expanded"><a name="L240"></a><tt class="py-lineno"> 240</tt>  <tt class="py-line">        <tt class="py-docstring">"""</tt> </tt>
-<a name="L241"></a><tt class="py-lineno"> 241</tt>  <tt class="py-line"><tt class="py-docstring">        Constructor.</tt> </tt>
-<a name="L242"></a><tt class="py-lineno"> 242</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
-<a name="L243"></a><tt class="py-lineno"> 243</tt>  <tt class="py-line"><tt class="py-docstring">        **Keyword arguments**:</tt> </tt>
-<a name="L244"></a><tt class="py-lineno"> 244</tt>  <tt class="py-line"><tt class="py-docstring">          - *fpath*: string, path to po or mo file</tt> </tt>
-<a name="L245"></a><tt class="py-lineno"> 245</tt>  <tt class="py-line"><tt class="py-docstring">          - *wrapwidth*: integer, the wrap width, only useful when -w option</tt> </tt>
-<a name="L246"></a><tt class="py-lineno"> 246</tt>  <tt class="py-line"><tt class="py-docstring">            was passed to xgettext to generate the po file that was used to</tt> </tt>
-<a name="L247"></a><tt class="py-lineno"> 247</tt>  <tt class="py-line"><tt class="py-docstring">            format the mo file, default to 78 (optional).</tt> </tt>
-<a name="L248"></a><tt class="py-lineno"> 248</tt>  <tt class="py-line"><tt class="py-docstring">        """</tt> </tt>
-<a name="L249"></a><tt class="py-lineno"> 249</tt>  <tt class="py-line">        <tt class="py-name">list</tt><tt class="py-op">.</tt><tt id="link-11" class="py-name" targets="Method polib.MOFile.__init__()=polib.MOFile-class.html#__init__,Method polib.POEntry.__init__()=polib.POEntry-class.html#__init__,Method polib._BaseEntry.__init__()=polib._BaseEntry-class.html#__init__,Method polib._BaseFile.__init__()=polib._BaseFile-class.html#__init__,Method polib._MOFileParser.__init__()=polib._MOFileParser-class.html#__init__,Method polib._POFileParser.__init__()=polib._POFileParser-class.html#__init__"><a title="polib.MOFile.__init__
+<a name="L140"></a><tt class="py-lineno"> 140</tt>  <tt class="py-line">    <tt class="py-name">instance</tt><tt class="py-op">.</tt><tt class="py-name">wrapwidth</tt> <tt class="py-op">=</tt> <tt class="py-name">kwargs</tt><tt class="py-op">.</tt><tt class="py-name">get</tt><tt class="py-op">(</tt><tt class="py-string">'wrapwidth'</tt><tt class="py-op">,</tt> <tt class="py-number">78</tt><tt class="py-op">)</tt> </tt>
+<a name="L141"></a><tt class="py-lineno"> 141</tt>  <tt class="py-line">    <tt class="py-name">instance</tt><tt class="py-op">.</tt><tt class="py-name">encoding</tt> <tt class="py-op">=</tt> <tt class="py-name">enc</tt> </tt>
+<a name="L142"></a><tt class="py-lineno"> 142</tt>  <tt class="py-line">    <tt class="py-keyword">return</tt> <tt class="py-name">instance</tt> </tt>
+</div><a name="L143"></a><tt class="py-lineno"> 143</tt>  <tt class="py-line"> </tt>
+<a name="L144"></a><tt class="py-lineno"> 144</tt>  <tt class="py-line"><tt class="py-comment"># }}}</tt> </tt>
+<a name="L145"></a><tt class="py-lineno"> 145</tt>  <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment"># function detect_encoding() {{{</tt> </tt>
+<a name="L146"></a><tt class="py-lineno"> 146</tt>  <tt class="py-line"><tt class="py-comment"></tt> </tt>
+<a name="detect_encoding"></a><div id="detect_encoding-def"><a name="L147"></a><tt class="py-lineno"> 147</tt> <a class="py-toggle" href="#" id="detect_encoding-toggle" onclick="return toggle('detect_encoding');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="polib-module.html#detect_encoding">detect_encoding</a><tt class="py-op">(</tt><tt class="py-param">fpath</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
+</div><div id="detect_encoding-collapsed" style="display:none;" pad="++++" indent="++++"></div><div id="detect_encoding-expanded"><a name="L148"></a><tt class="py-lineno"> 148</tt>  <tt class="py-line">    <tt class="py-docstring">"""</tt> </tt>
+<a name="L149"></a><tt class="py-lineno"> 149</tt>  <tt class="py-line"><tt class="py-docstring">    Try to detect the encoding used by the file *fpath*. The function will</tt> </tt>
+<a name="L150"></a><tt class="py-lineno"> 150</tt>  <tt class="py-line"><tt class="py-docstring">    return polib default *encoding* if it's unable to detect it.</tt> </tt>
+<a name="L151"></a><tt class="py-lineno"> 151</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
+<a name="L152"></a><tt class="py-lineno"> 152</tt>  <tt class="py-line"><tt class="py-docstring">    **Keyword argument**:</tt> </tt>
+<a name="L153"></a><tt class="py-lineno"> 153</tt>  <tt class="py-line"><tt class="py-docstring">      - *fpath*: string, full or relative path to the mo file to parse.</tt> </tt>
+<a name="L154"></a><tt class="py-lineno"> 154</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
+<a name="L155"></a><tt class="py-lineno"> 155</tt>  <tt class="py-line"><tt class="py-docstring">    **Examples**:</tt> </tt>
+<a name="L156"></a><tt class="py-lineno"> 156</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
+<a name="L157"></a><tt class="py-lineno"> 157</tt>  <tt class="py-line"><tt class="py-docstring">    &gt;&gt;&gt; print(detect_encoding('tests/test_noencoding.po'))</tt> </tt>
+<a name="L158"></a><tt class="py-lineno"> 158</tt>  <tt class="py-line"><tt class="py-docstring">    utf-8</tt> </tt>
+<a name="L159"></a><tt class="py-lineno"> 159</tt>  <tt class="py-line"><tt class="py-docstring">    &gt;&gt;&gt; print(detect_encoding('tests/test_utf8.po'))</tt> </tt>
+<a name="L160"></a><tt class="py-lineno"> 160</tt>  <tt class="py-line"><tt class="py-docstring">    UTF-8</tt> </tt>
+<a name="L161"></a><tt class="py-lineno"> 161</tt>  <tt class="py-line"><tt class="py-docstring">    &gt;&gt;&gt; print(detect_encoding('tests/test_utf8.mo'))</tt> </tt>
+<a name="L162"></a><tt class="py-lineno"> 162</tt>  <tt class="py-line"><tt class="py-docstring">    UTF-8</tt> </tt>
+<a name="L163"></a><tt class="py-lineno"> 163</tt>  <tt class="py-line"><tt class="py-docstring">    &gt;&gt;&gt; print(detect_encoding('tests/test_iso-8859-15.po'))</tt> </tt>
+<a name="L164"></a><tt class="py-lineno"> 164</tt>  <tt class="py-line"><tt class="py-docstring">    ISO_8859-15</tt> </tt>
+<a name="L165"></a><tt class="py-lineno"> 165</tt>  <tt class="py-line"><tt class="py-docstring">    &gt;&gt;&gt; print(detect_encoding('tests/test_iso-8859-15.mo'))</tt> </tt>
+<a name="L166"></a><tt class="py-lineno"> 166</tt>  <tt class="py-line"><tt class="py-docstring">    ISO_8859-15</tt> </tt>
+<a name="L167"></a><tt class="py-lineno"> 167</tt>  <tt class="py-line"><tt class="py-docstring">    """</tt> </tt>
+<a name="L168"></a><tt class="py-lineno"> 168</tt>  <tt class="py-line">    <tt class="py-keyword">import</tt> <tt class="py-name">re</tt> </tt>
+<a name="L169"></a><tt class="py-lineno"> 169</tt>  <tt class="py-line">    <tt class="py-name">rx</tt> <tt class="py-op">=</tt> <tt class="py-name">re</tt><tt class="py-op">.</tt><tt class="py-name">compile</tt><tt class="py-op">(</tt><tt class="py-string">r'"?Content-Type:.+? charset=([\w_\-:\.]+)'</tt><tt class="py-op">)</tt> </tt>
+<a name="L170"></a><tt class="py-lineno"> 170</tt>  <tt class="py-line">    <tt class="py-name">f</tt> <tt class="py-op">=</tt> <tt class="py-name">open</tt><tt class="py-op">(</tt><tt class="py-name">fpath</tt><tt class="py-op">)</tt> </tt>
+<a name="L171"></a><tt class="py-lineno"> 171</tt>  <tt class="py-line">    <tt class="py-keyword">for</tt> <tt class="py-name">l</tt> <tt class="py-keyword">in</tt> <tt class="py-name">f</tt><tt class="py-op">:</tt> </tt>
+<a name="L172"></a><tt class="py-lineno"> 172</tt>  <tt class="py-line">        <tt class="py-name">match</tt> <tt class="py-op">=</tt> <tt class="py-name">rx</tt><tt class="py-op">.</tt><tt class="py-name">search</tt><tt class="py-op">(</tt><tt class="py-name">l</tt><tt class="py-op">)</tt> </tt>
+<a name="L173"></a><tt class="py-lineno"> 173</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-name">match</tt><tt class="py-op">:</tt> </tt>
+<a name="L174"></a><tt class="py-lineno"> 174</tt>  <tt class="py-line">            <tt class="py-name">f</tt><tt class="py-op">.</tt><tt class="py-name">close</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
+<a name="L175"></a><tt class="py-lineno"> 175</tt>  <tt class="py-line">            <tt class="py-keyword">return</tt> <tt class="py-name">match</tt><tt class="py-op">.</tt><tt class="py-name">group</tt><tt class="py-op">(</tt><tt class="py-number">1</tt><tt class="py-op">)</tt><tt class="py-op">.</tt><tt class="py-name">strip</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
+<a name="L176"></a><tt class="py-lineno"> 176</tt>  <tt class="py-line">    <tt class="py-name">f</tt><tt class="py-op">.</tt><tt class="py-name">close</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
+<a name="L177"></a><tt class="py-lineno"> 177</tt>  <tt class="py-line">    <tt class="py-keyword">return</tt> <tt id="link-9" class="py-name"><a title="polib.default_encoding" class="py-name" href="#" onclick="return doclink('link-9', 'default_encoding', 'link-0');">default_encoding</a></tt> </tt>
+</div><a name="L178"></a><tt class="py-lineno"> 178</tt>  <tt class="py-line"> </tt>
+<a name="L179"></a><tt class="py-lineno"> 179</tt>  <tt class="py-line"><tt class="py-comment"># }}}</tt> </tt>
+<a name="L180"></a><tt class="py-lineno"> 180</tt>  <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment"># function escape() {{{</tt> </tt>
+<a name="L181"></a><tt class="py-lineno"> 181</tt>  <tt class="py-line"><tt class="py-comment"></tt> </tt>
+<a name="escape"></a><div id="escape-def"><a name="L182"></a><tt class="py-lineno"> 182</tt> <a class="py-toggle" href="#" id="escape-toggle" onclick="return toggle('escape');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="polib-module.html#escape">escape</a><tt class="py-op">(</tt><tt class="py-param">st</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
+</div><div id="escape-collapsed" style="display:none;" pad="++++" indent="++++"></div><div id="escape-expanded"><a name="L183"></a><tt class="py-lineno"> 183</tt>  <tt class="py-line">    <tt class="py-docstring">"""</tt> </tt>
+<a name="L184"></a><tt class="py-lineno"> 184</tt>  <tt class="py-line"><tt class="py-docstring">    Escape special chars and return the given string *st*.</tt> </tt>
+<a name="L185"></a><tt class="py-lineno"> 185</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
+<a name="L186"></a><tt class="py-lineno"> 186</tt>  <tt class="py-line"><tt class="py-docstring">    **Examples**:</tt> </tt>
+<a name="L187"></a><tt class="py-lineno"> 187</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
+<a name="L188"></a><tt class="py-lineno"> 188</tt>  <tt class="py-line"><tt class="py-docstring">    &gt;&gt;&gt; escape('\\t and \\n and \\r and " and \\\\')</tt> </tt>
+<a name="L189"></a><tt class="py-lineno"> 189</tt>  <tt class="py-line"><tt class="py-docstring">    '\\\\t and \\\\n and \\\\r and \\\\" and \\\\\\\\'</tt> </tt>
+<a name="L190"></a><tt class="py-lineno"> 190</tt>  <tt class="py-line"><tt class="py-docstring">    """</tt> </tt>
+<a name="L191"></a><tt class="py-lineno"> 191</tt>  <tt class="py-line">    <tt class="py-name">st</tt> <tt class="py-op">=</tt> <tt class="py-name">st</tt><tt class="py-op">.</tt><tt class="py-name">replace</tt><tt class="py-op">(</tt><tt class="py-string">'\\'</tt><tt class="py-op">,</tt> <tt class="py-string">r'\\'</tt><tt class="py-op">)</tt> </tt>
+<a name="L192"></a><tt class="py-lineno"> 192</tt>  <tt class="py-line">    <tt class="py-name">st</tt> <tt class="py-op">=</tt> <tt class="py-name">st</tt><tt class="py-op">.</tt><tt class="py-name">replace</tt><tt class="py-op">(</tt><tt class="py-string">'\t'</tt><tt class="py-op">,</tt> <tt class="py-string">r'\t'</tt><tt class="py-op">)</tt> </tt>
+<a name="L193"></a><tt class="py-lineno"> 193</tt>  <tt class="py-line">    <tt class="py-name">st</tt> <tt class="py-op">=</tt> <tt class="py-name">st</tt><tt class="py-op">.</tt><tt class="py-name">replace</tt><tt class="py-op">(</tt><tt class="py-string">'\r'</tt><tt class="py-op">,</tt> <tt class="py-string">r'\r'</tt><tt class="py-op">)</tt> </tt>
+<a name="L194"></a><tt class="py-lineno"> 194</tt>  <tt class="py-line">    <tt class="py-name">st</tt> <tt class="py-op">=</tt> <tt class="py-name">st</tt><tt class="py-op">.</tt><tt class="py-name">replace</tt><tt class="py-op">(</tt><tt class="py-string">'\n'</tt><tt class="py-op">,</tt> <tt class="py-string">r'\n'</tt><tt class="py-op">)</tt> </tt>
+<a name="L195"></a><tt class="py-lineno"> 195</tt>  <tt class="py-line">    <tt class="py-name">st</tt> <tt class="py-op">=</tt> <tt class="py-name">st</tt><tt class="py-op">.</tt><tt class="py-name">replace</tt><tt class="py-op">(</tt><tt class="py-string">'\"'</tt><tt class="py-op">,</tt> <tt class="py-string">r'\"'</tt><tt class="py-op">)</tt> </tt>
+<a name="L196"></a><tt class="py-lineno"> 196</tt>  <tt class="py-line">    <tt class="py-keyword">return</tt> <tt class="py-name">st</tt> </tt>
+</div><a name="L197"></a><tt class="py-lineno"> 197</tt>  <tt class="py-line"> </tt>
+<a name="L198"></a><tt class="py-lineno"> 198</tt>  <tt class="py-line"><tt class="py-comment"># }}}</tt> </tt>
+<a name="L199"></a><tt class="py-lineno"> 199</tt>  <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment"># function unescape() {{{</tt> </tt>
+<a name="L200"></a><tt class="py-lineno"> 200</tt>  <tt class="py-line"><tt class="py-comment"></tt> </tt>
+<a name="unescape"></a><div id="unescape-def"><a name="L201"></a><tt class="py-lineno"> 201</tt> <a class="py-toggle" href="#" id="unescape-toggle" onclick="return toggle('unescape');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="polib-module.html#unescape">unescape</a><tt class="py-op">(</tt><tt class="py-param">st</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
+</div><div id="unescape-collapsed" style="display:none;" pad="++++" indent="++++"></div><div id="unescape-expanded"><a name="L202"></a><tt class="py-lineno"> 202</tt>  <tt class="py-line">    <tt class="py-docstring">"""</tt> </tt>
+<a name="L203"></a><tt class="py-lineno"> 203</tt>  <tt class="py-line"><tt class="py-docstring">    Unescape special chars and return the given string *st*.</tt> </tt>
+<a name="L204"></a><tt class="py-lineno"> 204</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
+<a name="L205"></a><tt class="py-lineno"> 205</tt>  <tt class="py-line"><tt class="py-docstring">    **Examples**:</tt> </tt>
+<a name="L206"></a><tt class="py-lineno"> 206</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
+<a name="L207"></a><tt class="py-lineno"> 207</tt>  <tt class="py-line"><tt class="py-docstring">    &gt;&gt;&gt; unescape('\\\\t and \\\\n and \\\\r and \\\\" and \\\\\\\\')</tt> </tt>
+<a name="L208"></a><tt class="py-lineno"> 208</tt>  <tt class="py-line"><tt class="py-docstring">    '\\t and \\n and \\r and " and \\\\'</tt> </tt>
+<a name="L209"></a><tt class="py-lineno"> 209</tt>  <tt class="py-line"><tt class="py-docstring">    """</tt> </tt>
+<a name="L210"></a><tt class="py-lineno"> 210</tt>  <tt class="py-line">    <tt class="py-name">st</tt> <tt class="py-op">=</tt> <tt class="py-name">st</tt><tt class="py-op">.</tt><tt class="py-name">replace</tt><tt class="py-op">(</tt><tt class="py-string">r'\"'</tt><tt class="py-op">,</tt> <tt class="py-string">'"'</tt><tt class="py-op">)</tt> </tt>
+<a name="L211"></a><tt class="py-lineno"> 211</tt>  <tt class="py-line">    <tt class="py-name">st</tt> <tt class="py-op">=</tt> <tt class="py-name">st</tt><tt class="py-op">.</tt><tt class="py-name">replace</tt><tt class="py-op">(</tt><tt class="py-string">r'\n'</tt><tt class="py-op">,</tt> <tt class="py-string">'\n'</tt><tt class="py-op">)</tt> </tt>
+<a name="L212"></a><tt class="py-lineno"> 212</tt>  <tt class="py-line">    <tt class="py-name">st</tt> <tt class="py-op">=</tt> <tt class="py-name">st</tt><tt class="py-op">.</tt><tt class="py-name">replace</tt><tt class="py-op">(</tt><tt class="py-string">r'\r'</tt><tt class="py-op">,</tt> <tt class="py-string">'\r'</tt><tt class="py-op">)</tt> </tt>
+<a name="L213"></a><tt class="py-lineno"> 213</tt>  <tt class="py-line">    <tt class="py-name">st</tt> <tt class="py-op">=</tt> <tt class="py-name">st</tt><tt class="py-op">.</tt><tt class="py-name">replace</tt><tt class="py-op">(</tt><tt class="py-string">r'\t'</tt><tt class="py-op">,</tt> <tt class="py-string">'\t'</tt><tt class="py-op">)</tt> </tt>
+<a name="L214"></a><tt class="py-lineno"> 214</tt>  <tt class="py-line">    <tt class="py-name">st</tt> <tt class="py-op">=</tt> <tt class="py-name">st</tt><tt class="py-op">.</tt><tt class="py-name">replace</tt><tt class="py-op">(</tt><tt class="py-string">r'\\'</tt><tt class="py-op">,</tt> <tt class="py-string">'\\'</tt><tt class="py-op">)</tt> </tt>
+<a name="L215"></a><tt class="py-lineno"> 215</tt>  <tt class="py-line">    <tt class="py-keyword">return</tt> <tt class="py-name">st</tt> </tt>
+</div><a name="L216"></a><tt class="py-lineno"> 216</tt>  <tt class="py-line"> </tt>
+<a name="L217"></a><tt class="py-lineno"> 217</tt>  <tt class="py-line"><tt class="py-comment"># }}}</tt> </tt>
+<a name="L218"></a><tt class="py-lineno"> 218</tt>  <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment"># class _BaseFile {{{</tt> </tt>
+<a name="L219"></a><tt class="py-lineno"> 219</tt>  <tt class="py-line"><tt class="py-comment"></tt> </tt>
+<a name="_BaseFile"></a><div id="_BaseFile-def"><a name="L220"></a><tt class="py-lineno"> 220</tt> <a class="py-toggle" href="#" id="_BaseFile-toggle" onclick="return toggle('_BaseFile');">-</a><tt class="py-line"><tt class="py-keyword">class</tt> <a class="py-def-name" href="polib._BaseFile-class.html">_BaseFile</a><tt class="py-op">(</tt><tt class="py-base-class">list</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
+</div><div id="_BaseFile-collapsed" style="display:none;" pad="++++" indent="++++"></div><div id="_BaseFile-expanded"><a name="L221"></a><tt class="py-lineno"> 221</tt>  <tt class="py-line">    <tt class="py-docstring">"""</tt> </tt>
+<a name="L222"></a><tt class="py-lineno"> 222</tt>  <tt class="py-line"><tt class="py-docstring">    Common parent class for POFile and MOFile classes.</tt> </tt>
+<a name="L223"></a><tt class="py-lineno"> 223</tt>  <tt class="py-line"><tt class="py-docstring">    This class must **not** be instanciated directly.</tt> </tt>
+<a name="L224"></a><tt class="py-lineno"> 224</tt>  <tt class="py-line"><tt class="py-docstring">    """</tt> </tt>
+<a name="L225"></a><tt class="py-lineno"> 225</tt>  <tt class="py-line"> </tt>
+<a name="_BaseFile.__init__"></a><div id="_BaseFile.__init__-def"><a name="L226"></a><tt class="py-lineno"> 226</tt> <a class="py-toggle" href="#" id="_BaseFile.__init__-toggle" onclick="return toggle('_BaseFile.__init__');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="polib._BaseFile-class.html#__init__">__init__</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">fpath</tt><tt class="py-op">=</tt><tt class="py-name">None</tt><tt class="py-op">,</tt> <tt class="py-param">wrapwidth</tt><tt class="py-op">=</tt><tt class="py-number">78</tt><tt class="py-op">,</tt> <tt class="py-param">encoding</tt><tt class="py-op">=</tt><tt id="link-10" class="py-name"><a title="polib.default_encoding" class="py-name" href="#" onclick="return doclink('link-10', 'default_encoding', 'link-0');">default_encoding</a></tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
+</div><div id="_BaseFile.__init__-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="_BaseFile.__init__-expanded"><a name="L227"></a><tt class="py-lineno"> 227</tt>  <tt class="py-line">        <tt class="py-docstring">"""</tt> </tt>
+<a name="L228"></a><tt class="py-lineno"> 228</tt>  <tt class="py-line"><tt class="py-docstring">        Constructor.</tt> </tt>
+<a name="L229"></a><tt class="py-lineno"> 229</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
+<a name="L230"></a><tt class="py-lineno"> 230</tt>  <tt class="py-line"><tt class="py-docstring">        **Keyword arguments**:</tt> </tt>
+<a name="L231"></a><tt class="py-lineno"> 231</tt>  <tt class="py-line"><tt class="py-docstring">          - *fpath*: string, path to po or mo file</tt> </tt>
+<a name="L232"></a><tt class="py-lineno"> 232</tt>  <tt class="py-line"><tt class="py-docstring">          - *wrapwidth*: integer, the wrap width, only useful when -w option</tt> </tt>
+<a name="L233"></a><tt class="py-lineno"> 233</tt>  <tt class="py-line"><tt class="py-docstring">            was passed to xgettext to generate the po file that was used to</tt> </tt>
+<a name="L234"></a><tt class="py-lineno"> 234</tt>  <tt class="py-line"><tt class="py-docstring">            format the mo file, default to 78 (optional).</tt> </tt>
+<a name="L235"></a><tt class="py-lineno"> 235</tt>  <tt class="py-line"><tt class="py-docstring">        """</tt> </tt>
+<a name="L236"></a><tt class="py-lineno"> 236</tt>  <tt class="py-line">        <tt class="py-name">list</tt><tt class="py-op">.</tt><tt id="link-11" class="py-name" targets="Method polib.MOFile.__init__()=polib.MOFile-class.html#__init__,Method polib.POEntry.__init__()=polib.POEntry-class.html#__init__,Method polib._BaseEntry.__init__()=polib._BaseEntry-class.html#__init__,Method polib._BaseFile.__init__()=polib._BaseFile-class.html#__init__,Method polib._MOFileParser.__init__()=polib._MOFileParser-class.html#__init__,Method polib._POFileParser.__init__()=polib._POFileParser-class.html#__init__"><a title="polib.MOFile.__init__
 polib.POEntry.__init__
 polib._BaseEntry.__init__
 polib._BaseFile.__init__
 polib._MOFileParser.__init__
 polib._POFileParser.__init__" class="py-name" href="#" onclick="return doclink('link-11', '__init__', 'link-11');">__init__</a></tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">)</tt> </tt>
-<a name="L250"></a><tt class="py-lineno"> 250</tt>  <tt class="py-line">        <tt class="py-comment"># the opened file handle</tt> </tt>
-<a name="L251"></a><tt class="py-lineno"> 251</tt>  <tt class="py-line"><tt class="py-comment"></tt>        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">fpath</tt> <tt class="py-op">=</tt> <tt class="py-name">fpath</tt> </tt>
-<a name="L252"></a><tt class="py-lineno"> 252</tt>  <tt class="py-line">        <tt class="py-comment"># the width at which lines should be wrapped</tt> </tt>
-<a name="L253"></a><tt class="py-lineno"> 253</tt>  <tt class="py-line"><tt class="py-comment"></tt>        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">wrapwidth</tt> <tt class="py-op">=</tt> <tt class="py-name">wrapwidth</tt> </tt>
-<a name="L254"></a><tt class="py-lineno"> 254</tt>  <tt class="py-line">        <tt class="py-comment"># the file encoding</tt> </tt>
-<a name="L255"></a><tt class="py-lineno"> 255</tt>  <tt class="py-line"><tt class="py-comment"></tt>        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">encoding</tt> <tt class="py-op">=</tt> <tt class="py-name">encoding</tt> </tt>
-<a name="L256"></a><tt class="py-lineno"> 256</tt>  <tt class="py-line">        <tt class="py-comment"># header</tt> </tt>
-<a name="L257"></a><tt class="py-lineno"> 257</tt>  <tt class="py-line"><tt class="py-comment"></tt>        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">header</tt> <tt class="py-op">=</tt> <tt class="py-string">''</tt> </tt>
-<a name="L258"></a><tt class="py-lineno"> 258</tt>  <tt class="py-line">        <tt class="py-comment"># both po and mo files have metadata</tt> </tt>
-<a name="L259"></a><tt class="py-lineno"> 259</tt>  <tt class="py-line"><tt class="py-comment"></tt>        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">metadata</tt> <tt class="py-op">=</tt> <tt class="py-op">{</tt><tt class="py-op">}</tt> </tt>
-<a name="L260"></a><tt class="py-lineno"> 260</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">metadata_is_fuzzy</tt> <tt class="py-op">=</tt> <tt class="py-number">0</tt> </tt>
-</div><a name="L261"></a><tt class="py-lineno"> 261</tt>  <tt class="py-line"> </tt>
-<a name="_BaseFile.__str__"></a><div id="_BaseFile.__str__-def"><a name="L262"></a><tt class="py-lineno"> 262</tt> <a class="py-toggle" href="#" id="_BaseFile.__str__-toggle" onclick="return toggle('_BaseFile.__str__');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="polib._BaseFile-class.html#__str__">__str__</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
-</div><div id="_BaseFile.__str__-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="_BaseFile.__str__-expanded"><a name="L263"></a><tt class="py-lineno"> 263</tt>  <tt class="py-line">        <tt class="py-docstring">"""String representation of the file."""</tt> </tt>
-<a name="L264"></a><tt class="py-lineno"> 264</tt>  <tt class="py-line">        <tt class="py-name">ret</tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt><tt class="py-op">]</tt> </tt>
-<a name="L265"></a><tt class="py-lineno"> 265</tt>  <tt class="py-line">        <tt class="py-name">entries</tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-12" class="py-name" targets="Method polib._BaseFile.metadata_as_entry()=polib._BaseFile-class.html#metadata_as_entry"><a title="polib._BaseFile.metadata_as_entry" class="py-name" href="#" onclick="return doclink('link-12', 'metadata_as_entry', 'link-12');">metadata_as_entry</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">]</tt> <tt class="py-op">+</tt> \ </tt>
-<a name="L266"></a><tt class="py-lineno"> 266</tt>  <tt class="py-line">                  <tt class="py-op">[</tt><tt class="py-name">e</tt> <tt class="py-keyword">for</tt> <tt class="py-name">e</tt> <tt class="py-keyword">in</tt> <tt class="py-name">self</tt> <tt class="py-keyword">if</tt> <tt class="py-keyword">not</tt> <tt class="py-name">e</tt><tt class="py-op">.</tt><tt class="py-name">obsolete</tt><tt class="py-op">]</tt> </tt>
-<a name="L267"></a><tt class="py-lineno"> 267</tt>  <tt class="py-line">        <tt class="py-keyword">for</tt> <tt class="py-name">entry</tt> <tt class="py-keyword">in</tt> <tt class="py-name">entries</tt><tt class="py-op">:</tt> </tt>
-<a name="L268"></a><tt class="py-lineno"> 268</tt>  <tt class="py-line">            <tt class="py-name">_listappend</tt><tt class="py-op">(</tt><tt class="py-name">ret</tt><tt class="py-op">,</tt> <tt class="py-name">entry</tt><tt class="py-op">.</tt><tt id="link-13" class="py-name" targets="Method polib.MOEntry.__str__()=polib.MOEntry-class.html#__str__,Method polib.POEntry.__str__()=polib.POEntry-class.html#__str__,Method polib.POFile.__str__()=polib.POFile-class.html#__str__,Method polib._BaseEntry.__str__()=polib._BaseEntry-class.html#__str__,Method polib._BaseFile.__str__()=polib._BaseFile-class.html#__str__"><a title="polib.MOEntry.__str__
+<a name="L237"></a><tt class="py-lineno"> 237</tt>  <tt class="py-line">        <tt class="py-comment"># the opened file handle</tt> </tt>
+<a name="L238"></a><tt class="py-lineno"> 238</tt>  <tt class="py-line"><tt class="py-comment"></tt>        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">fpath</tt> <tt class="py-op">=</tt> <tt class="py-name">fpath</tt> </tt>
+<a name="L239"></a><tt class="py-lineno"> 239</tt>  <tt class="py-line">        <tt class="py-comment"># the width at which lines should be wrapped</tt> </tt>
+<a name="L240"></a><tt class="py-lineno"> 240</tt>  <tt class="py-line"><tt class="py-comment"></tt>        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">wrapwidth</tt> <tt class="py-op">=</tt> <tt class="py-name">wrapwidth</tt> </tt>
+<a name="L241"></a><tt class="py-lineno"> 241</tt>  <tt class="py-line">        <tt class="py-comment"># the file encoding</tt> </tt>
+<a name="L242"></a><tt class="py-lineno"> 242</tt>  <tt class="py-line"><tt class="py-comment"></tt>        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">encoding</tt> <tt class="py-op">=</tt> <tt class="py-name">encoding</tt> </tt>
+<a name="L243"></a><tt class="py-lineno"> 243</tt>  <tt class="py-line">        <tt class="py-comment"># header</tt> </tt>
+<a name="L244"></a><tt class="py-lineno"> 244</tt>  <tt class="py-line"><tt class="py-comment"></tt>        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">header</tt> <tt class="py-op">=</tt> <tt class="py-string">''</tt> </tt>
+<a name="L245"></a><tt class="py-lineno"> 245</tt>  <tt class="py-line">        <tt class="py-comment"># both po and mo files have metadata</tt> </tt>
+<a name="L246"></a><tt class="py-lineno"> 246</tt>  <tt class="py-line"><tt class="py-comment"></tt>        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">metadata</tt> <tt class="py-op">=</tt> <tt class="py-op">{</tt><tt class="py-op">}</tt> </tt>
+<a name="L247"></a><tt class="py-lineno"> 247</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">metadata_is_fuzzy</tt> <tt class="py-op">=</tt> <tt class="py-number">0</tt> </tt>
+</div><a name="L248"></a><tt class="py-lineno"> 248</tt>  <tt class="py-line"> </tt>
+<a name="_BaseFile.__str__"></a><div id="_BaseFile.__str__-def"><a name="L249"></a><tt class="py-lineno"> 249</tt> <a class="py-toggle" href="#" id="_BaseFile.__str__-toggle" onclick="return toggle('_BaseFile.__str__');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="polib._BaseFile-class.html#__str__">__str__</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
+</div><div id="_BaseFile.__str__-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="_BaseFile.__str__-expanded"><a name="L250"></a><tt class="py-lineno"> 250</tt>  <tt class="py-line">        <tt class="py-docstring">"""String representation of the file."""</tt> </tt>
+<a name="L251"></a><tt class="py-lineno"> 251</tt>  <tt class="py-line">        <tt class="py-name">ret</tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt><tt class="py-op">]</tt> </tt>
+<a name="L252"></a><tt class="py-lineno"> 252</tt>  <tt class="py-line">        <tt class="py-name">entries</tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-12" class="py-name" targets="Method polib._BaseFile.metadata_as_entry()=polib._BaseFile-class.html#metadata_as_entry"><a title="polib._BaseFile.metadata_as_entry" class="py-name" href="#" onclick="return doclink('link-12', 'metadata_as_entry', 'link-12');">metadata_as_entry</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">]</tt> <tt class="py-op">+</tt> \ </tt>
+<a name="L253"></a><tt class="py-lineno"> 253</tt>  <tt class="py-line">                  <tt class="py-op">[</tt><tt class="py-name">e</tt> <tt class="py-keyword">for</tt> <tt class="py-name">e</tt> <tt class="py-keyword">in</tt> <tt class="py-name">self</tt> <tt class="py-keyword">if</tt> <tt class="py-keyword">not</tt> <tt class="py-name">e</tt><tt class="py-op">.</tt><tt class="py-name">obsolete</tt><tt class="py-op">]</tt> </tt>
+<a name="L254"></a><tt class="py-lineno"> 254</tt>  <tt class="py-line">        <tt class="py-keyword">for</tt> <tt class="py-name">entry</tt> <tt class="py-keyword">in</tt> <tt class="py-name">entries</tt><tt class="py-op">:</tt> </tt>
+<a name="L255"></a><tt class="py-lineno"> 255</tt>  <tt class="py-line">            <tt class="py-name">ret</tt><tt class="py-op">.</tt><tt class="py-name">append</tt><tt class="py-op">(</tt><tt class="py-name">entry</tt><tt class="py-op">.</tt><tt id="link-13" class="py-name" targets="Method polib.MOEntry.__str__()=polib.MOEntry-class.html#__str__,Method polib.POEntry.__str__()=polib.POEntry-class.html#__str__,Method polib.POFile.__str__()=polib.POFile-class.html#__str__,Method polib._BaseEntry.__str__()=polib._BaseEntry-class.html#__str__,Method polib._BaseFile.__str__()=polib._BaseFile-class.html#__str__"><a title="polib.MOEntry.__str__
 polib.POEntry.__str__
 polib.POFile.__str__
 polib._BaseEntry.__str__
 polib._BaseFile.__str__" class="py-name" href="#" onclick="return doclink('link-13', '__str__', 'link-13');">__str__</a></tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">wrapwidth</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
-<a name="L269"></a><tt class="py-lineno"> 269</tt>  <tt class="py-line">        <tt class="py-keyword">for</tt> <tt class="py-name">entry</tt> <tt class="py-keyword">in</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-14" class="py-name" targets="Method polib.MOFile.obsolete_entries()=polib.MOFile-class.html#obsolete_entries,Method polib.POFile.obsolete_entries()=polib.POFile-class.html#obsolete_entries"><a title="polib.MOFile.obsolete_entries
+<a name="L256"></a><tt class="py-lineno"> 256</tt>  <tt class="py-line">        <tt class="py-keyword">for</tt> <tt class="py-name">entry</tt> <tt class="py-keyword">in</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-14" class="py-name" targets="Method polib.MOFile.obsolete_entries()=polib.MOFile-class.html#obsolete_entries,Method polib.POFile.obsolete_entries()=polib.POFile-class.html#obsolete_entries"><a title="polib.MOFile.obsolete_entries
 polib.POFile.obsolete_entries" class="py-name" href="#" onclick="return doclink('link-14', 'obsolete_entries', 'link-14');">obsolete_entries</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
-<a name="L270"></a><tt class="py-lineno"> 270</tt>  <tt class="py-line">            <tt class="py-name">_listappend</tt><tt class="py-op">(</tt><tt class="py-name">ret</tt><tt class="py-op">,</tt> <tt class="py-name">entry</tt><tt class="py-op">.</tt><tt id="link-15" class="py-name"><a title="polib.MOEntry.__str__
+<a name="L257"></a><tt class="py-lineno"> 257</tt>  <tt class="py-line">            <tt class="py-name">ret</tt><tt class="py-op">.</tt><tt class="py-name">append</tt><tt class="py-op">(</tt><tt class="py-name">entry</tt><tt class="py-op">.</tt><tt id="link-15" class="py-name"><a title="polib.MOEntry.__str__
 polib.POEntry.__str__
 polib.POFile.__str__
 polib._BaseEntry.__str__
 polib._BaseFile.__str__" class="py-name" href="#" onclick="return doclink('link-15', '__str__', 'link-13');">__str__</a></tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">wrapwidth</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
-<a name="L271"></a><tt class="py-lineno"> 271</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">_strjoin</tt><tt class="py-op">(</tt><tt class="py-string">'\n'</tt><tt class="py-op">,</tt> <tt class="py-name">ret</tt><tt class="py-op">)</tt> </tt>
-</div><a name="L272"></a><tt class="py-lineno"> 272</tt>  <tt class="py-line"> </tt>
-<a name="_BaseFile.__repr__"></a><div id="_BaseFile.__repr__-def"><a name="L273"></a><tt class="py-lineno"> 273</tt> <a class="py-toggle" href="#" id="_BaseFile.__repr__-toggle" onclick="return toggle('_BaseFile.__repr__');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="polib._BaseFile-class.html#__repr__">__repr__</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
-</div><div id="_BaseFile.__repr__-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="_BaseFile.__repr__-expanded"><a name="L274"></a><tt class="py-lineno"> 274</tt>  <tt class="py-line">        <tt class="py-docstring">"""Return the official string representation of the object."""</tt> </tt>
-<a name="L275"></a><tt class="py-lineno"> 275</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-string">'&lt;%s instance at %x&gt;'</tt> <tt class="py-op">%</tt> <tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">__class__</tt><tt class="py-op">.</tt><tt class="py-name">__name__</tt><tt class="py-op">,</tt> <tt class="py-name">id</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
+<a name="L258"></a><tt class="py-lineno"> 258</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-string">'\n'</tt><tt class="py-op">.</tt><tt class="py-name">join</tt><tt class="py-op">(</tt><tt class="py-name">ret</tt><tt class="py-op">)</tt> </tt>
+</div><a name="L259"></a><tt class="py-lineno"> 259</tt>  <tt class="py-line"> </tt>
+<a name="_BaseFile.__repr__"></a><div id="_BaseFile.__repr__-def"><a name="L260"></a><tt class="py-lineno"> 260</tt> <a class="py-toggle" href="#" id="_BaseFile.__repr__-toggle" onclick="return toggle('_BaseFile.__repr__');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="polib._BaseFile-class.html#__repr__">__repr__</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
+</div><div id="_BaseFile.__repr__-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="_BaseFile.__repr__-expanded"><a name="L261"></a><tt class="py-lineno"> 261</tt>  <tt class="py-line">        <tt class="py-docstring">"""Return the official string representation of the object."""</tt> </tt>
+<a name="L262"></a><tt class="py-lineno"> 262</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-string">'&lt;%s instance at %x&gt;'</tt> <tt class="py-op">%</tt> <tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">__class__</tt><tt class="py-op">.</tt><tt class="py-name">__name__</tt><tt class="py-op">,</tt> <tt class="py-name">id</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
+</div><a name="L263"></a><tt class="py-lineno"> 263</tt>  <tt class="py-line"> </tt>
+<a name="_BaseFile.metadata_as_entry"></a><div id="_BaseFile.metadata_as_entry-def"><a name="L264"></a><tt class="py-lineno"> 264</tt> <a class="py-toggle" href="#" id="_BaseFile.metadata_as_entry-toggle" onclick="return toggle('_BaseFile.metadata_as_entry');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="polib._BaseFile-class.html#metadata_as_entry">metadata_as_entry</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
+</div><div id="_BaseFile.metadata_as_entry-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="_BaseFile.metadata_as_entry-expanded"><a name="L265"></a><tt class="py-lineno"> 265</tt>  <tt class="py-line">        <tt class="py-docstring">"""Return the metadata as an entry"""</tt> </tt>
+<a name="L266"></a><tt class="py-lineno"> 266</tt>  <tt class="py-line">        <tt class="py-name">e</tt> <tt class="py-op">=</tt> <tt id="link-16" class="py-name" targets="Class polib.POEntry=polib.POEntry-class.html"><a title="polib.POEntry" class="py-name" href="#" onclick="return doclink('link-16', 'POEntry', 'link-16');">POEntry</a></tt><tt class="py-op">(</tt><tt class="py-name">msgid</tt><tt class="py-op">=</tt><tt class="py-string">''</tt><tt class="py-op">)</tt> </tt>
+<a name="L267"></a><tt class="py-lineno"> 267</tt>  <tt class="py-line">        <tt class="py-name">mdata</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-17" class="py-name" targets="Method polib._BaseFile.ordered_metadata()=polib._BaseFile-class.html#ordered_metadata"><a title="polib._BaseFile.ordered_metadata" class="py-name" href="#" onclick="return doclink('link-17', 'ordered_metadata', 'link-17');">ordered_metadata</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
+<a name="L268"></a><tt class="py-lineno"> 268</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-name">mdata</tt><tt class="py-op">:</tt> </tt>
+<a name="L269"></a><tt class="py-lineno"> 269</tt>  <tt class="py-line">            <tt class="py-name">strs</tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt><tt class="py-op">]</tt> </tt>
+<a name="L270"></a><tt class="py-lineno"> 270</tt>  <tt class="py-line">            <tt class="py-keyword">for</tt> <tt class="py-name">name</tt><tt class="py-op">,</tt> <tt class="py-name">value</tt> <tt class="py-keyword">in</tt> <tt class="py-name">mdata</tt><tt class="py-op">:</tt> </tt>
+<a name="L271"></a><tt class="py-lineno"> 271</tt>  <tt class="py-line">                <tt class="py-comment"># Strip whitespace off each line in a multi-line entry</tt> </tt>
+<a name="L272"></a><tt class="py-lineno"> 272</tt>  <tt class="py-line"><tt class="py-comment"></tt>                <tt class="py-name">value</tt> <tt class="py-op">=</tt> <tt class="py-string">'\n'</tt><tt class="py-op">.</tt><tt class="py-name">join</tt><tt class="py-op">(</tt><tt class="py-op">[</tt><tt class="py-name">v</tt><tt class="py-op">.</tt><tt class="py-name">strip</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> <tt class="py-keyword">for</tt> <tt class="py-name">v</tt> <tt class="py-keyword">in</tt> <tt class="py-name">value</tt><tt class="py-op">.</tt><tt class="py-name">split</tt><tt class="py-op">(</tt><tt class="py-string">'\n'</tt><tt class="py-op">)</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
+<a name="L273"></a><tt class="py-lineno"> 273</tt>  <tt class="py-line">                <tt class="py-name">strs</tt><tt class="py-op">.</tt><tt class="py-name">append</tt><tt class="py-op">(</tt><tt class="py-string">'%s: %s'</tt> <tt class="py-op">%</tt> <tt class="py-op">(</tt><tt class="py-name">name</tt><tt class="py-op">,</tt> <tt class="py-name">value</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
+<a name="L274"></a><tt class="py-lineno"> 274</tt>  <tt class="py-line">            <tt class="py-name">e</tt><tt class="py-op">.</tt><tt class="py-name">msgstr</tt> <tt class="py-op">=</tt> <tt class="py-string">'\n'</tt><tt class="py-op">.</tt><tt class="py-name">join</tt><tt class="py-op">(</tt><tt class="py-name">strs</tt><tt class="py-op">)</tt> <tt class="py-op">+</tt> <tt class="py-string">'\n'</tt> </tt>
+<a name="L275"></a><tt class="py-lineno"> 275</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">e</tt> </tt>
 </div><a name="L276"></a><tt class="py-lineno"> 276</tt>  <tt class="py-line"> </tt>
-<a name="_BaseFile.metadata_as_entry"></a><div id="_BaseFile.metadata_as_entry-def"><a name="L277"></a><tt class="py-lineno"> 277</tt> <a class="py-toggle" href="#" id="_BaseFile.metadata_as_entry-toggle" onclick="return toggle('_BaseFile.metadata_as_entry');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="polib._BaseFile-class.html#metadata_as_entry">metadata_as_entry</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
-</div><div id="_BaseFile.metadata_as_entry-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="_BaseFile.metadata_as_entry-expanded"><a name="L278"></a><tt class="py-lineno"> 278</tt>  <tt class="py-line">        <tt class="py-docstring">"""Return the metadata as an entry"""</tt> </tt>
-<a name="L279"></a><tt class="py-lineno"> 279</tt>  <tt class="py-line">        <tt class="py-name">e</tt> <tt class="py-op">=</tt> <tt id="link-16" class="py-name" targets="Class polib.POEntry=polib.POEntry-class.html"><a title="polib.POEntry" class="py-name" href="#" onclick="return doclink('link-16', 'POEntry', 'link-16');">POEntry</a></tt><tt class="py-op">(</tt><tt class="py-name">msgid</tt><tt class="py-op">=</tt><tt class="py-string">''</tt><tt class="py-op">)</tt> </tt>
-<a name="L280"></a><tt class="py-lineno"> 280</tt>  <tt class="py-line">        <tt class="py-name">mdata</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-17" class="py-name" targets="Method polib._BaseFile.ordered_metadata()=polib._BaseFile-class.html#ordered_metadata"><a title="polib._BaseFile.ordered_metadata" class="py-name" href="#" onclick="return doclink('link-17', 'ordered_metadata', 'link-17');">ordered_metadata</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
-<a name="L281"></a><tt class="py-lineno"> 281</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-name">mdata</tt><tt class="py-op">:</tt> </tt>
-<a name="L282"></a><tt class="py-lineno"> 282</tt>  <tt class="py-line">            <tt class="py-name">strs</tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt><tt class="py-op">]</tt> </tt>
-<a name="L283"></a><tt class="py-lineno"> 283</tt>  <tt class="py-line">            <tt class="py-keyword">for</tt> <tt class="py-name">name</tt><tt class="py-op">,</tt> <tt class="py-name">value</tt> <tt class="py-keyword">in</tt> <tt class="py-name">mdata</tt><tt class="py-op">:</tt> </tt>
-<a name="L284"></a><tt class="py-lineno"> 284</tt>  <tt class="py-line">                <tt class="py-comment"># Strip whitespace off each line in a multi-line entry</tt> </tt>
-<a name="L285"></a><tt class="py-lineno"> 285</tt>  <tt class="py-line"><tt class="py-comment"></tt>                <tt class="py-name">value</tt> <tt class="py-op">=</tt> <tt class="py-name">_strjoin</tt><tt class="py-op">(</tt><tt class="py-string">'\n'</tt><tt class="py-op">,</tt> <tt class="py-op">[</tt><tt class="py-name">_strstrip</tt><tt class="py-op">(</tt><tt class="py-name">v</tt><tt class="py-op">)</tt> </tt>
-<a name="L286"></a><tt class="py-lineno"> 286</tt>  <tt class="py-line">                                        <tt class="py-keyword">for</tt> <tt class="py-name">v</tt> <tt class="py-keyword">in</tt> <tt class="py-name">_strsplit</tt><tt class="py-op">(</tt><tt class="py-name">value</tt><tt class="py-op">,</tt> <tt class="py-string">'\n'</tt><tt class="py-op">)</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
-<a name="L287"></a><tt class="py-lineno"> 287</tt>  <tt class="py-line">                <tt class="py-name">_listappend</tt><tt class="py-op">(</tt><tt class="py-name">strs</tt><tt class="py-op">,</tt> <tt class="py-string">'%s: %s'</tt> <tt class="py-op">%</tt> <tt class="py-op">(</tt><tt class="py-name">name</tt><tt class="py-op">,</tt> <tt class="py-name">value</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
-<a name="L288"></a><tt class="py-lineno"> 288</tt>  <tt class="py-line">            <tt class="py-name">e</tt><tt class="py-op">.</tt><tt class="py-name">msgstr</tt> <tt class="py-op">=</tt> <tt class="py-name">_strjoin</tt><tt class="py-op">(</tt><tt class="py-string">'\n'</tt><tt class="py-op">,</tt> <tt class="py-name">strs</tt><tt class="py-op">)</tt> <tt class="py-op">+</tt> <tt class="py-string">'\n'</tt> </tt>
-<a name="L289"></a><tt class="py-lineno"> 289</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">e</tt> </tt>
-</div><a name="L290"></a><tt class="py-lineno"> 290</tt>  <tt class="py-line"> </tt>
-<a name="_BaseFile.save"></a><div id="_BaseFile.save-def"><a name="L291"></a><tt class="py-lineno"> 291</tt> <a class="py-toggle" href="#" id="_BaseFile.save-toggle" onclick="return toggle('_BaseFile.save');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="polib._BaseFile-class.html#save">save</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">fpath</tt><tt class="py-op">=</tt><tt class="py-name">None</tt><tt class="py-op">,</tt> <tt class="py-param">repr_method</tt><tt class="py-op">=</tt><tt class="py-string">'__str__'</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
-</div><div id="_BaseFile.save-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="_BaseFile.save-expanded"><a name="L292"></a><tt class="py-lineno"> 292</tt>  <tt class="py-line">        <tt class="py-docstring">"""</tt> </tt>
-<a name="L293"></a><tt class="py-lineno"> 293</tt>  <tt class="py-line"><tt class="py-docstring">        Save the po file to file *fpath* if no file handle exists for</tt> </tt>
-<a name="L294"></a><tt class="py-lineno"> 294</tt>  <tt class="py-line"><tt class="py-docstring">        the object. If there's already an open file and no fpath is</tt> </tt>
-<a name="L295"></a><tt class="py-lineno"> 295</tt>  <tt class="py-line"><tt class="py-docstring">        provided, then the existing file is rewritten with the modified</tt> </tt>
-<a name="L296"></a><tt class="py-lineno"> 296</tt>  <tt class="py-line"><tt class="py-docstring">        data.</tt> </tt>
-<a name="L297"></a><tt class="py-lineno"> 297</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
-<a name="L298"></a><tt class="py-lineno"> 298</tt>  <tt class="py-line"><tt class="py-docstring">        **Keyword arguments**:</tt> </tt>
-<a name="L299"></a><tt class="py-lineno"> 299</tt>  <tt class="py-line"><tt class="py-docstring">          - *fpath*: string, full or relative path to the file.</tt> </tt>
-<a name="L300"></a><tt class="py-lineno"> 300</tt>  <tt class="py-line"><tt class="py-docstring">          - *repr_method*: string, the method to use for output.</tt> </tt>
-<a name="L301"></a><tt class="py-lineno"> 301</tt>  <tt class="py-line"><tt class="py-docstring">        """</tt> </tt>
-<a name="L302"></a><tt class="py-lineno"> 302</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">fpath</tt> <tt class="py-keyword">is</tt> <tt class="py-name">None</tt> <tt class="py-keyword">and</tt> <tt class="py-name">fpath</tt> <tt class="py-keyword">is</tt> <tt class="py-name">None</tt><tt class="py-op">:</tt> </tt>
-<a name="L303"></a><tt class="py-lineno"> 303</tt>  <tt class="py-line">            <tt class="py-keyword">raise</tt> <tt class="py-name">IOError</tt><tt class="py-op">(</tt><tt class="py-string">'You must provide a file path to save() method'</tt><tt class="py-op">)</tt> </tt>
-<a name="L304"></a><tt class="py-lineno"> 304</tt>  <tt class="py-line">        <tt class="py-name">contents</tt> <tt class="py-op">=</tt> <tt class="py-name">getattr</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">,</tt> <tt class="py-name">repr_method</tt><tt class="py-op">)</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
-<a name="L305"></a><tt class="py-lineno"> 305</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-name">fpath</tt> <tt class="py-keyword">is</tt> <tt class="py-name">None</tt><tt class="py-op">:</tt> </tt>
-<a name="L306"></a><tt class="py-lineno"> 306</tt>  <tt class="py-line">            <tt class="py-name">fpath</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">fpath</tt> </tt>
-<a name="L307"></a><tt class="py-lineno"> 307</tt>  <tt class="py-line">        <tt class="py-name">mode</tt> <tt class="py-op">=</tt> <tt class="py-string">'w'</tt> </tt>
-<a name="L308"></a><tt class="py-lineno"> 308</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-name">repr_method</tt> <tt class="py-op">==</tt> <tt class="py-string">'to_binary'</tt><tt class="py-op">:</tt> </tt>
-<a name="L309"></a><tt class="py-lineno"> 309</tt>  <tt class="py-line">            <tt class="py-name">mode</tt> <tt class="py-op">+=</tt> <tt class="py-string">'b'</tt> </tt>
-<a name="L310"></a><tt class="py-lineno"> 310</tt>  <tt class="py-line">        <tt class="py-name">fhandle</tt> <tt class="py-op">=</tt> <tt class="py-name">open</tt><tt class="py-op">(</tt><tt class="py-name">fpath</tt><tt class="py-op">,</tt> <tt class="py-name">mode</tt><tt class="py-op">)</tt> </tt>
-<a name="L311"></a><tt class="py-lineno"> 311</tt>  <tt class="py-line">        <tt class="py-name">fhandle</tt><tt class="py-op">.</tt><tt class="py-name">write</tt><tt class="py-op">(</tt><tt class="py-name">contents</tt><tt class="py-op">)</tt> </tt>
-<a name="L312"></a><tt class="py-lineno"> 312</tt>  <tt class="py-line">        <tt class="py-name">fhandle</tt><tt class="py-op">.</tt><tt class="py-name">close</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
-</div><a name="L313"></a><tt class="py-lineno"> 313</tt>  <tt class="py-line"> </tt>
-<a name="_BaseFile.find"></a><div id="_BaseFile.find-def"><a name="L314"></a><tt class="py-lineno"> 314</tt> <a class="py-toggle" href="#" id="_BaseFile.find-toggle" onclick="return toggle('_BaseFile.find');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="polib._BaseFile-class.html#find">find</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">st</tt><tt class="py-op">,</tt> <tt class="py-param">by</tt><tt class="py-op">=</tt><tt class="py-string">'msgid'</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
-</div><div id="_BaseFile.find-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="_BaseFile.find-expanded"><a name="L315"></a><tt class="py-lineno"> 315</tt>  <tt class="py-line">        <tt class="py-docstring">"""</tt> </tt>
-<a name="L316"></a><tt class="py-lineno"> 316</tt>  <tt class="py-line"><tt class="py-docstring">        Find entry which msgid (or property identified by the *by*</tt> </tt>
-<a name="L317"></a><tt class="py-lineno"> 317</tt>  <tt class="py-line"><tt class="py-docstring">        attribute) matches the string *st*.</tt> </tt>
-<a name="L318"></a><tt class="py-lineno"> 318</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
-<a name="L319"></a><tt class="py-lineno"> 319</tt>  <tt class="py-line"><tt class="py-docstring">        **Keyword arguments**:</tt> </tt>
-<a name="L320"></a><tt class="py-lineno"> 320</tt>  <tt class="py-line"><tt class="py-docstring">          - *st*: string, the string to search for</tt> </tt>
-<a name="L321"></a><tt class="py-lineno"> 321</tt>  <tt class="py-line"><tt class="py-docstring">          - *by*: string, the comparison attribute</tt> </tt>
-<a name="L322"></a><tt class="py-lineno"> 322</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
-<a name="L323"></a><tt class="py-lineno"> 323</tt>  <tt class="py-line"><tt class="py-docstring">        **Examples**:</tt> </tt>
-<a name="L324"></a><tt class="py-lineno"> 324</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
-<a name="L325"></a><tt class="py-lineno"> 325</tt>  <tt class="py-line"><tt class="py-docstring">        &gt;&gt;&gt; po = pofile('tests/test_utf8.po')</tt> </tt>
-<a name="L326"></a><tt class="py-lineno"> 326</tt>  <tt class="py-line"><tt class="py-docstring">        &gt;&gt;&gt; entry = po.find('Thursday')</tt> </tt>
-<a name="L327"></a><tt class="py-lineno"> 327</tt>  <tt class="py-line"><tt class="py-docstring">        &gt;&gt;&gt; entry.msgstr</tt> </tt>
-<a name="L328"></a><tt class="py-lineno"> 328</tt>  <tt class="py-line"><tt class="py-docstring">        'Jueves'</tt> </tt>
-<a name="L329"></a><tt class="py-lineno"> 329</tt>  <tt class="py-line"><tt class="py-docstring">        &gt;&gt;&gt; entry = po.find('Some unexistant msgid')</tt> </tt>
-<a name="L330"></a><tt class="py-lineno"> 330</tt>  <tt class="py-line"><tt class="py-docstring">        &gt;&gt;&gt; entry is None</tt> </tt>
-<a name="L331"></a><tt class="py-lineno"> 331</tt>  <tt class="py-line"><tt class="py-docstring">        True</tt> </tt>
-<a name="L332"></a><tt class="py-lineno"> 332</tt>  <tt class="py-line"><tt class="py-docstring">        &gt;&gt;&gt; entry = po.find('Jueves', 'msgstr')</tt> </tt>
-<a name="L333"></a><tt class="py-lineno"> 333</tt>  <tt class="py-line"><tt class="py-docstring">        &gt;&gt;&gt; entry.msgid</tt> </tt>
-<a name="L334"></a><tt class="py-lineno"> 334</tt>  <tt class="py-line"><tt class="py-docstring">        'Thursday'</tt> </tt>
-<a name="L335"></a><tt class="py-lineno"> 335</tt>  <tt class="py-line"><tt class="py-docstring">        """</tt> </tt>
-<a name="L336"></a><tt class="py-lineno"> 336</tt>  <tt class="py-line">        <tt class="py-keyword">try</tt><tt class="py-op">:</tt> </tt>
-<a name="L337"></a><tt class="py-lineno"> 337</tt>  <tt class="py-line">            <tt class="py-keyword">return</tt> <tt class="py-op">[</tt><tt class="py-name">e</tt> <tt class="py-keyword">for</tt> <tt class="py-name">e</tt> <tt class="py-keyword">in</tt> <tt class="py-name">self</tt> <tt class="py-keyword">if</tt> <tt class="py-name">getattr</tt><tt class="py-op">(</tt><tt class="py-name">e</tt><tt class="py-op">,</tt> <tt class="py-name">by</tt><tt class="py-op">)</tt> <tt class="py-op">==</tt> <tt class="py-name">st</tt><tt class="py-op">]</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt> </tt>
-<a name="L338"></a><tt class="py-lineno"> 338</tt>  <tt class="py-line">        <tt class="py-keyword">except</tt> <tt class="py-name">IndexError</tt><tt class="py-op">:</tt> </tt>
-<a name="L339"></a><tt class="py-lineno"> 339</tt>  <tt class="py-line">            <tt class="py-keyword">return</tt> <tt class="py-name">None</tt> </tt>
-</div><a name="L340"></a><tt class="py-lineno"> 340</tt>  <tt class="py-line"> </tt>
-<a name="_BaseFile.ordered_metadata"></a><div id="_BaseFile.ordered_metadata-def"><a name="L341"></a><tt class="py-lineno"> 341</tt> <a class="py-toggle" href="#" id="_BaseFile.ordered_metadata-toggle" onclick="return toggle('_BaseFile.ordered_metadata');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="polib._BaseFile-class.html#ordered_metadata">ordered_metadata</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
-</div><div id="_BaseFile.ordered_metadata-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="_BaseFile.ordered_metadata-expanded"><a name="L342"></a><tt class="py-lineno"> 342</tt>  <tt class="py-line">        <tt class="py-docstring">"""</tt> </tt>
-<a name="L343"></a><tt class="py-lineno"> 343</tt>  <tt class="py-line"><tt class="py-docstring">        Convenience method that return the metadata ordered. The return</tt> </tt>
-<a name="L344"></a><tt class="py-lineno"> 344</tt>  <tt class="py-line"><tt class="py-docstring">        value is list of tuples (metadata name, metadata_value).</tt> </tt>
-<a name="L345"></a><tt class="py-lineno"> 345</tt>  <tt class="py-line"><tt class="py-docstring">        """</tt> </tt>
-<a name="L346"></a><tt class="py-lineno"> 346</tt>  <tt class="py-line">        <tt class="py-comment"># copy the dict first</tt> </tt>
-<a name="L347"></a><tt class="py-lineno"> 347</tt>  <tt class="py-line"><tt class="py-comment"></tt>        <tt class="py-name">metadata</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">metadata</tt><tt class="py-op">.</tt><tt class="py-name">copy</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
-<a name="L348"></a><tt class="py-lineno"> 348</tt>  <tt class="py-line">        <tt class="py-name">data_order</tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt> </tt>
-<a name="L349"></a><tt class="py-lineno"> 349</tt>  <tt class="py-line">            <tt class="py-string">'Project-Id-Version'</tt><tt class="py-op">,</tt> </tt>
-<a name="L350"></a><tt class="py-lineno"> 350</tt>  <tt class="py-line">            <tt class="py-string">'Report-Msgid-Bugs-To'</tt><tt class="py-op">,</tt> </tt>
-<a name="L351"></a><tt class="py-lineno"> 351</tt>  <tt class="py-line">            <tt class="py-string">'POT-Creation-Date'</tt><tt class="py-op">,</tt> </tt>
-<a name="L352"></a><tt class="py-lineno"> 352</tt>  <tt class="py-line">            <tt class="py-string">'PO-Revision-Date'</tt><tt class="py-op">,</tt> </tt>
-<a name="L353"></a><tt class="py-lineno"> 353</tt>  <tt class="py-line">            <tt class="py-string">'Last-Translator'</tt><tt class="py-op">,</tt> </tt>
-<a name="L354"></a><tt class="py-lineno"> 354</tt>  <tt class="py-line">            <tt class="py-string">'Language-Team'</tt><tt class="py-op">,</tt> </tt>
-<a name="L355"></a><tt class="py-lineno"> 355</tt>  <tt class="py-line">            <tt class="py-string">'MIME-Version'</tt><tt class="py-op">,</tt> </tt>
-<a name="L356"></a><tt class="py-lineno"> 356</tt>  <tt class="py-line">            <tt class="py-string">'Content-Type'</tt><tt class="py-op">,</tt> </tt>
-<a name="L357"></a><tt class="py-lineno"> 357</tt>  <tt class="py-line">            <tt class="py-string">'Content-Transfer-Encoding'</tt> </tt>
-<a name="L358"></a><tt class="py-lineno"> 358</tt>  <tt class="py-line">        <tt class="py-op">]</tt> </tt>
-<a name="L359"></a><tt class="py-lineno"> 359</tt>  <tt class="py-line">        <tt class="py-name">ordered_data</tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt><tt class="py-op">]</tt> </tt>
-<a name="L360"></a><tt class="py-lineno"> 360</tt>  <tt class="py-line">        <tt class="py-keyword">for</tt> <tt class="py-name">data</tt> <tt class="py-keyword">in</tt> <tt class="py-name">data_order</tt><tt class="py-op">:</tt> </tt>
-<a name="L361"></a><tt class="py-lineno"> 361</tt>  <tt class="py-line">            <tt class="py-keyword">try</tt><tt class="py-op">:</tt> </tt>
-<a name="L362"></a><tt class="py-lineno"> 362</tt>  <tt class="py-line">                <tt class="py-name">value</tt> <tt class="py-op">=</tt> <tt class="py-name">metadata</tt><tt class="py-op">.</tt><tt class="py-name">pop</tt><tt class="py-op">(</tt><tt class="py-name">data</tt><tt class="py-op">)</tt> </tt>
-<a name="L363"></a><tt class="py-lineno"> 363</tt>  <tt class="py-line">                <tt class="py-name">_listappend</tt><tt class="py-op">(</tt><tt class="py-name">ordered_data</tt><tt class="py-op">,</tt> <tt class="py-op">(</tt><tt class="py-name">data</tt><tt class="py-op">,</tt> <tt class="py-name">value</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
-<a name="L364"></a><tt class="py-lineno"> 364</tt>  <tt class="py-line">            <tt class="py-keyword">except</tt> <tt class="py-name">KeyError</tt><tt class="py-op">:</tt> </tt>
-<a name="L365"></a><tt class="py-lineno"> 365</tt>  <tt class="py-line">                <tt class="py-keyword">pass</tt> </tt>
-<a name="L366"></a><tt class="py-lineno"> 366</tt>  <tt class="py-line">        <tt class="py-comment"># the rest of the metadata won't be ordered there are no specs for this</tt> </tt>
-<a name="L367"></a><tt class="py-lineno"> 367</tt>  <tt class="py-line"><tt class="py-comment"></tt>        <tt class="py-name">keys</tt> <tt class="py-op">=</tt> <tt class="py-name">metadata</tt><tt class="py-op">.</tt><tt class="py-name">keys</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
-<a name="L368"></a><tt class="py-lineno"> 368</tt>  <tt class="py-line">        <tt class="py-name">list</tt><tt class="py-op">(</tt><tt class="py-name">keys</tt><tt class="py-op">)</tt><tt class="py-op">.</tt><tt class="py-name">sort</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
-<a name="L369"></a><tt class="py-lineno"> 369</tt>  <tt class="py-line">        <tt class="py-keyword">for</tt> <tt class="py-name">data</tt> <tt class="py-keyword">in</tt> <tt class="py-name">keys</tt><tt class="py-op">:</tt> </tt>
-<a name="L370"></a><tt class="py-lineno"> 370</tt>  <tt class="py-line">            <tt class="py-name">value</tt> <tt class="py-op">=</tt> <tt class="py-name">metadata</tt><tt class="py-op">[</tt><tt class="py-name">data</tt><tt class="py-op">]</tt> </tt>
-<a name="L371"></a><tt class="py-lineno"> 371</tt>  <tt class="py-line">            <tt class="py-name">_listappend</tt><tt class="py-op">(</tt><tt class="py-name">ordered_data</tt><tt class="py-op">,</tt> <tt class="py-op">(</tt><tt class="py-name">data</tt><tt class="py-op">,</tt> <tt class="py-name">value</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
-<a name="L372"></a><tt class="py-lineno"> 372</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">ordered_data</tt> </tt>
-</div><a name="L373"></a><tt class="py-lineno"> 373</tt>  <tt class="py-line"> </tt>
-<a name="_BaseFile.to_binary"></a><div id="_BaseFile.to_binary-def"><a name="L374"></a><tt class="py-lineno"> 374</tt> <a class="py-toggle" href="#" id="_BaseFile.to_binary-toggle" onclick="return toggle('_BaseFile.to_binary');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="polib._BaseFile-class.html#to_binary">to_binary</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
-</div><div id="_BaseFile.to_binary-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="_BaseFile.to_binary-expanded"><a name="L375"></a><tt class="py-lineno"> 375</tt>  <tt class="py-line">        <tt class="py-docstring">"""Return the mofile binary representation."""</tt> </tt>
-<a name="L376"></a><tt class="py-lineno"> 376</tt>  <tt class="py-line">        <tt class="py-keyword">import</tt> <tt class="py-name">struct</tt> </tt>
-<a name="L377"></a><tt class="py-lineno"> 377</tt>  <tt class="py-line">        <tt class="py-keyword">import</tt> <tt class="py-name">array</tt> </tt>
-<a name="L378"></a><tt class="py-lineno"> 378</tt>  <tt class="py-line">        <tt class="py-name">output</tt> <tt class="py-op">=</tt> <tt class="py-string">''</tt> </tt>
-<a name="L379"></a><tt class="py-lineno"> 379</tt>  <tt class="py-line">        <tt class="py-name">offsets</tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt><tt class="py-op">]</tt> </tt>
-<a name="L380"></a><tt class="py-lineno"> 380</tt>  <tt class="py-line">        <tt class="py-name">ids</tt> <tt class="py-op">=</tt> <tt class="py-name">strs</tt> <tt class="py-op">=</tt> <tt class="py-string">''</tt> </tt>
-<a name="L381"></a><tt class="py-lineno"> 381</tt>  <tt class="py-line">        <tt class="py-name">entries</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-18" class="py-name" targets="Method polib.MOFile.translated_entries()=polib.MOFile-class.html#translated_entries,Method polib.POFile.translated_entries()=polib.POFile-class.html#translated_entries"><a title="polib.MOFile.translated_entries
+<a name="_BaseFile.save"></a><div id="_BaseFile.save-def"><a name="L277"></a><tt class="py-lineno"> 277</tt> <a class="py-toggle" href="#" id="_BaseFile.save-toggle" onclick="return toggle('_BaseFile.save');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="polib._BaseFile-class.html#save">save</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">fpath</tt><tt class="py-op">=</tt><tt class="py-name">None</tt><tt class="py-op">,</tt> <tt class="py-param">repr_method</tt><tt class="py-op">=</tt><tt class="py-string">'__str__'</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
+</div><div id="_BaseFile.save-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="_BaseFile.save-expanded"><a name="L278"></a><tt class="py-lineno"> 278</tt>  <tt class="py-line">        <tt class="py-docstring">"""</tt> </tt>
+<a name="L279"></a><tt class="py-lineno"> 279</tt>  <tt class="py-line"><tt class="py-docstring">        Save the po file to file *fpath* if no file handle exists for</tt> </tt>
+<a name="L280"></a><tt class="py-lineno"> 280</tt>  <tt class="py-line"><tt class="py-docstring">        the object. If there's already an open file and no fpath is</tt> </tt>
+<a name="L281"></a><tt class="py-lineno"> 281</tt>  <tt class="py-line"><tt class="py-docstring">        provided, then the existing file is rewritten with the modified</tt> </tt>
+<a name="L282"></a><tt class="py-lineno"> 282</tt>  <tt class="py-line"><tt class="py-docstring">        data.</tt> </tt>
+<a name="L283"></a><tt class="py-lineno"> 283</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
+<a name="L284"></a><tt class="py-lineno"> 284</tt>  <tt class="py-line"><tt class="py-docstring">        **Keyword arguments**:</tt> </tt>
+<a name="L285"></a><tt class="py-lineno"> 285</tt>  <tt class="py-line"><tt class="py-docstring">          - *fpath*: string, full or relative path to the file.</tt> </tt>
+<a name="L286"></a><tt class="py-lineno"> 286</tt>  <tt class="py-line"><tt class="py-docstring">          - *repr_method*: string, the method to use for output.</tt> </tt>
+<a name="L287"></a><tt class="py-lineno"> 287</tt>  <tt class="py-line"><tt class="py-docstring">        """</tt> </tt>
+<a name="L288"></a><tt class="py-lineno"> 288</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">fpath</tt> <tt class="py-keyword">is</tt> <tt class="py-name">None</tt> <tt class="py-keyword">and</tt> <tt class="py-name">fpath</tt> <tt class="py-keyword">is</tt> <tt class="py-name">None</tt><tt class="py-op">:</tt> </tt>
+<a name="L289"></a><tt class="py-lineno"> 289</tt>  <tt class="py-line">            <tt class="py-keyword">raise</tt> <tt class="py-name">IOError</tt><tt class="py-op">(</tt><tt class="py-string">'You must provide a file path to save() method'</tt><tt class="py-op">)</tt> </tt>
+<a name="L290"></a><tt class="py-lineno"> 290</tt>  <tt class="py-line">        <tt class="py-name">contents</tt> <tt class="py-op">=</tt> <tt class="py-name">getattr</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">,</tt> <tt class="py-name">repr_method</tt><tt class="py-op">)</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
+<a name="L291"></a><tt class="py-lineno"> 291</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-name">fpath</tt> <tt class="py-keyword">is</tt> <tt class="py-name">None</tt><tt class="py-op">:</tt> </tt>
+<a name="L292"></a><tt class="py-lineno"> 292</tt>  <tt class="py-line">            <tt class="py-name">fpath</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">fpath</tt> </tt>
+<a name="L293"></a><tt class="py-lineno"> 293</tt>  <tt class="py-line">        <tt class="py-name">mode</tt> <tt class="py-op">=</tt> <tt class="py-string">'w'</tt> </tt>
+<a name="L294"></a><tt class="py-lineno"> 294</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-name">repr_method</tt> <tt class="py-op">==</tt> <tt class="py-string">'to_binary'</tt><tt class="py-op">:</tt> </tt>
+<a name="L295"></a><tt class="py-lineno"> 295</tt>  <tt class="py-line">            <tt class="py-name">mode</tt> <tt class="py-op">+=</tt> <tt class="py-string">'b'</tt> </tt>
+<a name="L296"></a><tt class="py-lineno"> 296</tt>  <tt class="py-line">        <tt class="py-name">fhandle</tt> <tt class="py-op">=</tt> <tt class="py-name">open</tt><tt class="py-op">(</tt><tt class="py-name">fpath</tt><tt class="py-op">,</tt> <tt class="py-name">mode</tt><tt class="py-op">)</tt> </tt>
+<a name="L297"></a><tt class="py-lineno"> 297</tt>  <tt class="py-line">        <tt class="py-name">fhandle</tt><tt class="py-op">.</tt><tt class="py-name">write</tt><tt class="py-op">(</tt><tt class="py-name">contents</tt><tt class="py-op">)</tt> </tt>
+<a name="L298"></a><tt class="py-lineno"> 298</tt>  <tt class="py-line">        <tt class="py-name">fhandle</tt><tt class="py-op">.</tt><tt class="py-name">close</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
+</div><a name="L299"></a><tt class="py-lineno"> 299</tt>  <tt class="py-line"> </tt>
+<a name="_BaseFile.find"></a><div id="_BaseFile.find-def"><a name="L300"></a><tt class="py-lineno"> 300</tt> <a class="py-toggle" href="#" id="_BaseFile.find-toggle" onclick="return toggle('_BaseFile.find');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="polib._BaseFile-class.html#find">find</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">st</tt><tt class="py-op">,</tt> <tt class="py-param">by</tt><tt class="py-op">=</tt><tt class="py-string">'msgid'</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
+</div><div id="_BaseFile.find-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="_BaseFile.find-expanded"><a name="L301"></a><tt class="py-lineno"> 301</tt>  <tt class="py-line">        <tt class="py-docstring">"""</tt> </tt>
+<a name="L302"></a><tt class="py-lineno"> 302</tt>  <tt class="py-line"><tt class="py-docstring">        Find entry which msgid (or property identified by the *by*</tt> </tt>
+<a name="L303"></a><tt class="py-lineno"> 303</tt>  <tt class="py-line"><tt class="py-docstring">        attribute) matches the string *st*.</tt> </tt>
+<a name="L304"></a><tt class="py-lineno"> 304</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
+<a name="L305"></a><tt class="py-lineno"> 305</tt>  <tt class="py-line"><tt class="py-docstring">        **Keyword arguments**:</tt> </tt>
+<a name="L306"></a><tt class="py-lineno"> 306</tt>  <tt class="py-line"><tt class="py-docstring">          - *st*: string, the string to search for</tt> </tt>
+<a name="L307"></a><tt class="py-lineno"> 307</tt>  <tt class="py-line"><tt class="py-docstring">          - *by*: string, the comparison attribute</tt> </tt>
+<a name="L308"></a><tt class="py-lineno"> 308</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
+<a name="L309"></a><tt class="py-lineno"> 309</tt>  <tt class="py-line"><tt class="py-docstring">        **Examples**:</tt> </tt>
+<a name="L310"></a><tt class="py-lineno"> 310</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
+<a name="L311"></a><tt class="py-lineno"> 311</tt>  <tt class="py-line"><tt class="py-docstring">        &gt;&gt;&gt; po = pofile('tests/test_utf8.po')</tt> </tt>
+<a name="L312"></a><tt class="py-lineno"> 312</tt>  <tt class="py-line"><tt class="py-docstring">        &gt;&gt;&gt; entry = po.find('Thursday')</tt> </tt>
+<a name="L313"></a><tt class="py-lineno"> 313</tt>  <tt class="py-line"><tt class="py-docstring">        &gt;&gt;&gt; entry.msgstr</tt> </tt>
+<a name="L314"></a><tt class="py-lineno"> 314</tt>  <tt class="py-line"><tt class="py-docstring">        'Jueves'</tt> </tt>
+<a name="L315"></a><tt class="py-lineno"> 315</tt>  <tt class="py-line"><tt class="py-docstring">        &gt;&gt;&gt; entry = po.find('Some unexistant msgid')</tt> </tt>
+<a name="L316"></a><tt class="py-lineno"> 316</tt>  <tt class="py-line"><tt class="py-docstring">        &gt;&gt;&gt; entry is None</tt> </tt>
+<a name="L317"></a><tt class="py-lineno"> 317</tt>  <tt class="py-line"><tt class="py-docstring">        True</tt> </tt>
+<a name="L318"></a><tt class="py-lineno"> 318</tt>  <tt class="py-line"><tt class="py-docstring">        &gt;&gt;&gt; entry = po.find('Jueves', 'msgstr')</tt> </tt>
+<a name="L319"></a><tt class="py-lineno"> 319</tt>  <tt class="py-line"><tt class="py-docstring">        &gt;&gt;&gt; entry.msgid</tt> </tt>
+<a name="L320"></a><tt class="py-lineno"> 320</tt>  <tt class="py-line"><tt class="py-docstring">        'Thursday'</tt> </tt>
+<a name="L321"></a><tt class="py-lineno"> 321</tt>  <tt class="py-line"><tt class="py-docstring">        """</tt> </tt>
+<a name="L322"></a><tt class="py-lineno"> 322</tt>  <tt class="py-line">        <tt class="py-keyword">try</tt><tt class="py-op">:</tt> </tt>
+<a name="L323"></a><tt class="py-lineno"> 323</tt>  <tt class="py-line">            <tt class="py-keyword">return</tt> <tt class="py-op">[</tt><tt class="py-name">e</tt> <tt class="py-keyword">for</tt> <tt class="py-name">e</tt> <tt class="py-keyword">in</tt> <tt class="py-name">self</tt> <tt class="py-keyword">if</tt> <tt class="py-name">getattr</tt><tt class="py-op">(</tt><tt class="py-name">e</tt><tt class="py-op">,</tt> <tt class="py-name">by</tt><tt class="py-op">)</tt> <tt class="py-op">==</tt> <tt class="py-name">st</tt><tt class="py-op">]</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt> </tt>
+<a name="L324"></a><tt class="py-lineno"> 324</tt>  <tt class="py-line">        <tt class="py-keyword">except</tt> <tt class="py-name">IndexError</tt><tt class="py-op">:</tt> </tt>
+<a name="L325"></a><tt class="py-lineno"> 325</tt>  <tt class="py-line">            <tt class="py-keyword">return</tt> <tt class="py-name">None</tt> </tt>
+</div><a name="L326"></a><tt class="py-lineno"> 326</tt>  <tt class="py-line"> </tt>
+<a name="_BaseFile.ordered_metadata"></a><div id="_BaseFile.ordered_metadata-def"><a name="L327"></a><tt class="py-lineno"> 327</tt> <a class="py-toggle" href="#" id="_BaseFile.ordered_metadata-toggle" onclick="return toggle('_BaseFile.ordered_metadata');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="polib._BaseFile-class.html#ordered_metadata">ordered_metadata</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
+</div><div id="_BaseFile.ordered_metadata-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="_BaseFile.ordered_metadata-expanded"><a name="L328"></a><tt class="py-lineno"> 328</tt>  <tt class="py-line">        <tt class="py-docstring">"""</tt> </tt>
+<a name="L329"></a><tt class="py-lineno"> 329</tt>  <tt class="py-line"><tt class="py-docstring">        Convenience method that return the metadata ordered. The return</tt> </tt>
+<a name="L330"></a><tt class="py-lineno"> 330</tt>  <tt class="py-line"><tt class="py-docstring">        value is list of tuples (metadata name, metadata_value).</tt> </tt>
+<a name="L331"></a><tt class="py-lineno"> 331</tt>  <tt class="py-line"><tt class="py-docstring">        """</tt> </tt>
+<a name="L332"></a><tt class="py-lineno"> 332</tt>  <tt class="py-line">        <tt class="py-comment"># copy the dict first</tt> </tt>
+<a name="L333"></a><tt class="py-lineno"> 333</tt>  <tt class="py-line"><tt class="py-comment"></tt>        <tt class="py-name">metadata</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">metadata</tt><tt class="py-op">.</tt><tt class="py-name">copy</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
+<a name="L334"></a><tt class="py-lineno"> 334</tt>  <tt class="py-line">        <tt class="py-name">data_order</tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt> </tt>
+<a name="L335"></a><tt class="py-lineno"> 335</tt>  <tt class="py-line">            <tt class="py-string">'Project-Id-Version'</tt><tt class="py-op">,</tt> </tt>
+<a name="L336"></a><tt class="py-lineno"> 336</tt>  <tt class="py-line">            <tt class="py-string">'Report-Msgid-Bugs-To'</tt><tt class="py-op">,</tt> </tt>
+<a name="L337"></a><tt class="py-lineno"> 337</tt>  <tt class="py-line">            <tt class="py-string">'POT-Creation-Date'</tt><tt class="py-op">,</tt> </tt>
+<a name="L338"></a><tt class="py-lineno"> 338</tt>  <tt class="py-line">            <tt class="py-string">'PO-Revision-Date'</tt><tt class="py-op">,</tt> </tt>
+<a name="L339"></a><tt class="py-lineno"> 339</tt>  <tt class="py-line">            <tt class="py-string">'Last-Translator'</tt><tt class="py-op">,</tt> </tt>
+<a name="L340"></a><tt class="py-lineno"> 340</tt>  <tt class="py-line">            <tt class="py-string">'Language-Team'</tt><tt class="py-op">,</tt> </tt>
+<a name="L341"></a><tt class="py-lineno"> 341</tt>  <tt class="py-line">            <tt class="py-string">'MIME-Version'</tt><tt class="py-op">,</tt> </tt>
+<a name="L342"></a><tt class="py-lineno"> 342</tt>  <tt class="py-line">            <tt class="py-string">'Content-Type'</tt><tt class="py-op">,</tt> </tt>
+<a name="L343"></a><tt class="py-lineno"> 343</tt>  <tt class="py-line">            <tt class="py-string">'Content-Transfer-Encoding'</tt> </tt>
+<a name="L344"></a><tt class="py-lineno"> 344</tt>  <tt class="py-line">        <tt class="py-op">]</tt> </tt>
+<a name="L345"></a><tt class="py-lineno"> 345</tt>  <tt class="py-line">        <tt class="py-name">ordered_data</tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt><tt class="py-op">]</tt> </tt>
+<a name="L346"></a><tt class="py-lineno"> 346</tt>  <tt class="py-line">        <tt class="py-keyword">for</tt> <tt class="py-name">data</tt> <tt class="py-keyword">in</tt> <tt class="py-name">data_order</tt><tt class="py-op">:</tt> </tt>
+<a name="L347"></a><tt class="py-lineno"> 347</tt>  <tt class="py-line">            <tt class="py-keyword">try</tt><tt class="py-op">:</tt> </tt>
+<a name="L348"></a><tt class="py-lineno"> 348</tt>  <tt class="py-line">                <tt class="py-name">value</tt> <tt class="py-op">=</tt> <tt class="py-name">metadata</tt><tt class="py-op">.</tt><tt class="py-name">pop</tt><tt class="py-op">(</tt><tt class="py-name">data</tt><tt class="py-op">)</tt> </tt>
+<a name="L349"></a><tt class="py-lineno"> 349</tt>  <tt class="py-line">                <tt class="py-name">ordered_data</tt><tt class="py-op">.</tt><tt class="py-name">append</tt><tt class="py-op">(</tt><tt class="py-op">(</tt><tt class="py-name">data</tt><tt class="py-op">,</tt> <tt class="py-name">value</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
+<a name="L350"></a><tt class="py-lineno"> 350</tt>  <tt class="py-line">            <tt class="py-keyword">except</tt> <tt class="py-name">KeyError</tt><tt class="py-op">:</tt> </tt>
+<a name="L351"></a><tt class="py-lineno"> 351</tt>  <tt class="py-line">                <tt class="py-keyword">pass</tt> </tt>
+<a name="L352"></a><tt class="py-lineno"> 352</tt>  <tt class="py-line">        <tt class="py-comment"># the rest of the metadata won't be ordered there are no specs for this</tt> </tt>
+<a name="L353"></a><tt class="py-lineno"> 353</tt>  <tt class="py-line"><tt class="py-comment"></tt>        <tt class="py-name">keys</tt> <tt class="py-op">=</tt> <tt class="py-name">metadata</tt><tt class="py-op">.</tt><tt class="py-name">keys</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
+<a name="L354"></a><tt class="py-lineno"> 354</tt>  <tt class="py-line">        <tt class="py-name">list</tt><tt class="py-op">(</tt><tt class="py-name">keys</tt><tt class="py-op">)</tt><tt class="py-op">.</tt><tt class="py-name">sort</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
+<a name="L355"></a><tt class="py-lineno"> 355</tt>  <tt class="py-line">        <tt class="py-keyword">for</tt> <tt class="py-name">data</tt> <tt class="py-keyword">in</tt> <tt class="py-name">keys</tt><tt class="py-op">:</tt> </tt>
+<a name="L356"></a><tt class="py-lineno"> 356</tt>  <tt class="py-line">            <tt class="py-name">value</tt> <tt class="py-op">=</tt> <tt class="py-name">metadata</tt><tt class="py-op">[</tt><tt class="py-name">data</tt><tt class="py-op">]</tt> </tt>
+<a name="L357"></a><tt class="py-lineno"> 357</tt>  <tt class="py-line">            <tt class="py-name">ordered_data</tt><tt class="py-op">.</tt><tt class="py-name">append</tt><tt class="py-op">(</tt><tt class="py-op">(</tt><tt class="py-name">data</tt><tt class="py-op">,</tt> <tt class="py-name">value</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
+<a name="L358"></a><tt class="py-lineno"> 358</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">ordered_data</tt> </tt>
+</div><a name="L359"></a><tt class="py-lineno"> 359</tt>  <tt class="py-line"> </tt>
+<a name="_BaseFile.to_binary"></a><div id="_BaseFile.to_binary-def"><a name="L360"></a><tt class="py-lineno"> 360</tt> <a class="py-toggle" href="#" id="_BaseFile.to_binary-toggle" onclick="return toggle('_BaseFile.to_binary');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="polib._BaseFile-class.html#to_binary">to_binary</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
+</div><div id="_BaseFile.to_binary-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="_BaseFile.to_binary-expanded"><a name="L361"></a><tt class="py-lineno"> 361</tt>  <tt class="py-line">        <tt class="py-docstring">"""Return the mofile binary representation."""</tt> </tt>
+<a name="L362"></a><tt class="py-lineno"> 362</tt>  <tt class="py-line">        <tt class="py-keyword">import</tt> <tt class="py-name">struct</tt> </tt>
+<a name="L363"></a><tt class="py-lineno"> 363</tt>  <tt class="py-line">        <tt class="py-keyword">import</tt> <tt class="py-name">array</tt> </tt>
+<a name="L364"></a><tt class="py-lineno"> 364</tt>  <tt class="py-line">        <tt class="py-name">output</tt> <tt class="py-op">=</tt> <tt class="py-string">''</tt> </tt>
+<a name="L365"></a><tt class="py-lineno"> 365</tt>  <tt class="py-line">        <tt class="py-name">offsets</tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt><tt class="py-op">]</tt> </tt>
+<a name="L366"></a><tt class="py-lineno"> 366</tt>  <tt class="py-line">        <tt class="py-name">ids</tt> <tt class="py-op">=</tt> <tt class="py-name">strs</tt> <tt class="py-op">=</tt> <tt class="py-string">''</tt> </tt>
+<a name="L367"></a><tt class="py-lineno"> 367</tt>  <tt class="py-line">        <tt class="py-name">entries</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-18" class="py-name" targets="Method polib.MOFile.translated_entries()=polib.MOFile-class.html#translated_entries,Method polib.POFile.translated_entries()=polib.POFile-class.html#translated_entries"><a title="polib.MOFile.translated_entries
 polib.POFile.translated_entries" class="py-name" href="#" onclick="return doclink('link-18', 'translated_entries', 'link-18');">translated_entries</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
-<a name="L382"></a><tt class="py-lineno"> 382</tt>  <tt class="py-line">        <tt class="py-comment"># the keys are sorted in the .mo file</tt> </tt>
-<a name="L383"></a><tt class="py-lineno"> 383</tt>  <tt class="py-line"><tt class="py-comment"></tt>        <tt class="py-keyword">def</tt> <tt class="py-def-name">cmp</tt><tt class="py-op">(</tt><tt class="py-param">_self</tt><tt class="py-op">,</tt> <tt class="py-param">other</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
-<a name="L384"></a><tt class="py-lineno"> 384</tt>  <tt class="py-line">            <tt class="py-keyword">if</tt> <tt class="py-name">_self</tt><tt class="py-op">.</tt><tt class="py-name">msgid</tt> <tt class="py-op">&gt;</tt> <tt class="py-name">other</tt><tt class="py-op">.</tt><tt class="py-name">msgid</tt><tt class="py-op">:</tt> </tt>
-<a name="L385"></a><tt class="py-lineno"> 385</tt>  <tt class="py-line">                <tt class="py-keyword">return</tt> <tt class="py-number">1</tt> </tt>
-<a name="L386"></a><tt class="py-lineno"> 386</tt>  <tt class="py-line">            <tt class="py-keyword">elif</tt> <tt class="py-name">_self</tt><tt class="py-op">.</tt><tt class="py-name">msgid</tt> <tt class="py-op">&lt;</tt> <tt class="py-name">other</tt><tt class="py-op">.</tt><tt class="py-name">msgid</tt><tt class="py-op">:</tt> </tt>
-<a name="L387"></a><tt class="py-lineno"> 387</tt>  <tt class="py-line">                <tt class="py-keyword">return</tt> <tt class="py-op">-</tt><tt class="py-number">1</tt> </tt>
-<a name="L388"></a><tt class="py-lineno"> 388</tt>  <tt class="py-line">            <tt class="py-keyword">else</tt><tt class="py-op">:</tt> </tt>
-<a name="L389"></a><tt class="py-lineno"> 389</tt>  <tt class="py-line">                <tt class="py-keyword">return</tt> <tt class="py-number">0</tt> </tt>
-</div><a name="L390"></a><tt class="py-lineno"> 390</tt>  <tt class="py-line">        <tt class="py-name">entries</tt><tt class="py-op">.</tt><tt class="py-name">sort</tt><tt class="py-op">(</tt><tt class="py-name">cmp</tt><tt class="py-op">)</tt> </tt>
-<a name="L391"></a><tt class="py-lineno"> 391</tt>  <tt class="py-line">        <tt class="py-comment"># add metadata entry</tt> </tt>
-<a name="L392"></a><tt class="py-lineno"> 392</tt>  <tt class="py-line"><tt class="py-comment"></tt>        <tt class="py-name">mentry</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-19" class="py-name"><a title="polib._BaseFile.metadata_as_entry" class="py-name" href="#" onclick="return doclink('link-19', 'metadata_as_entry', 'link-12');">metadata_as_entry</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
-<a name="L393"></a><tt class="py-lineno"> 393</tt>  <tt class="py-line">        <tt class="py-name">mentry</tt><tt class="py-op">.</tt><tt class="py-name">msgstr</tt> <tt class="py-op">=</tt> <tt class="py-name">_strreplace</tt><tt class="py-op">(</tt><tt class="py-name">mentry</tt><tt class="py-op">.</tt><tt class="py-name">msgstr</tt><tt class="py-op">,</tt> <tt class="py-string">'\\n'</tt><tt class="py-op">,</tt> <tt class="py-string">''</tt><tt class="py-op">)</tt><tt class="py-op">.</tt><tt class="py-name">lstrip</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> <tt class="py-op">+</tt> <tt class="py-string">'\n'</tt> </tt>
-<a name="L394"></a><tt class="py-lineno"> 394</tt>  <tt class="py-line">        <tt class="py-name">entries</tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt><tt class="py-name">mentry</tt><tt class="py-op">]</tt> <tt class="py-op">+</tt> <tt class="py-name">entries</tt> </tt>
-<a name="L395"></a><tt class="py-lineno"> 395</tt>  <tt class="py-line">        <tt class="py-name">entries_len</tt> <tt class="py-op">=</tt> <tt class="py-name">len</tt><tt class="py-op">(</tt><tt class="py-name">entries</tt><tt class="py-op">)</tt> </tt>
-<a name="L396"></a><tt class="py-lineno"> 396</tt>  <tt class="py-line">        <tt class="py-keyword">for</tt> <tt class="py-name">e</tt> <tt class="py-keyword">in</tt> <tt class="py-name">entries</tt><tt class="py-op">:</tt> </tt>
-<a name="L397"></a><tt class="py-lineno"> 397</tt>  <tt class="py-line">            <tt class="py-comment"># For each string, we need size and file offset.  Each string is</tt> </tt>
-<a name="L398"></a><tt class="py-lineno"> 398</tt>  <tt class="py-line"><tt class="py-comment"></tt>            <tt class="py-comment"># NUL terminated; the NUL does not count into the size.</tt> </tt>
-<a name="L399"></a><tt class="py-lineno"> 399</tt>  <tt class="py-line"><tt class="py-comment"></tt>            <tt class="py-name">msgid</tt> <tt class="py-op">=</tt> <tt class="py-name">e</tt><tt class="py-op">.</tt><tt id="link-20" class="py-name" targets="Method polib._BaseEntry._decode()=polib._BaseEntry-class.html#_decode"><a title="polib._BaseEntry._decode" class="py-name" href="#" onclick="return doclink('link-20', '_decode', 'link-20');">_decode</a></tt><tt class="py-op">(</tt><tt class="py-name">e</tt><tt class="py-op">.</tt><tt class="py-name">msgid</tt><tt class="py-op">)</tt> </tt>
-<a name="L400"></a><tt class="py-lineno"> 400</tt>  <tt class="py-line">            <tt class="py-name">msgstr</tt> <tt class="py-op">=</tt> <tt class="py-name">e</tt><tt class="py-op">.</tt><tt id="link-21" class="py-name"><a title="polib._BaseEntry._decode" class="py-name" href="#" onclick="return doclink('link-21', '_decode', 'link-20');">_decode</a></tt><tt class="py-op">(</tt><tt class="py-name">e</tt><tt class="py-op">.</tt><tt class="py-name">msgstr</tt><tt class="py-op">)</tt> </tt>
-<a name="L401"></a><tt class="py-lineno"> 401</tt>  <tt class="py-line">            <tt class="py-name">offsets</tt><tt class="py-op">.</tt><tt class="py-name">append</tt><tt class="py-op">(</tt><tt class="py-op">(</tt><tt class="py-name">len</tt><tt class="py-op">(</tt><tt class="py-name">ids</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-name">len</tt><tt class="py-op">(</tt><tt class="py-name">msgid</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-name">len</tt><tt class="py-op">(</tt><tt class="py-name">strs</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-name">len</tt><tt class="py-op">(</tt><tt class="py-name">msgstr</tt><tt class="py-op">)</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
-<a name="L402"></a><tt class="py-lineno"> 402</tt>  <tt class="py-line">            <tt class="py-name">ids</tt>  <tt class="py-op">+=</tt> <tt class="py-name">msgid</tt>  <tt class="py-op">+</tt> <tt class="py-string">'\0'</tt> </tt>
-<a name="L403"></a><tt class="py-lineno"> 403</tt>  <tt class="py-line">            <tt class="py-name">strs</tt> <tt class="py-op">+=</tt> <tt class="py-name">msgstr</tt> <tt class="py-op">+</tt> <tt class="py-string">'\0'</tt> </tt>
-<a name="L404"></a><tt class="py-lineno"> 404</tt>  <tt class="py-line">        <tt class="py-comment"># The header is 7 32-bit unsigned integers.</tt> </tt>
-<a name="L405"></a><tt class="py-lineno"> 405</tt>  <tt class="py-line"><tt class="py-comment"></tt>        <tt class="py-name">keystart</tt> <tt class="py-op">=</tt> <tt class="py-number">7</tt><tt class="py-op">*</tt><tt class="py-number">4</tt><tt class="py-op">+</tt><tt class="py-number">16</tt><tt class="py-op">*</tt><tt class="py-name">entries_len</tt> </tt>
-<a name="L406"></a><tt class="py-lineno"> 406</tt>  <tt class="py-line">        <tt class="py-comment"># and the values start after the keys</tt> </tt>
-<a name="L407"></a><tt class="py-lineno"> 407</tt>  <tt class="py-line"><tt class="py-comment"></tt>        <tt class="py-name">valuestart</tt> <tt class="py-op">=</tt> <tt class="py-name">keystart</tt> <tt class="py-op">+</tt> <tt class="py-name">len</tt><tt class="py-op">(</tt><tt class="py-name">ids</tt><tt class="py-op">)</tt> </tt>
-<a name="L408"></a><tt class="py-lineno"> 408</tt>  <tt class="py-line">        <tt class="py-name">koffsets</tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt><tt class="py-op">]</tt> </tt>
-<a name="L409"></a><tt class="py-lineno"> 409</tt>  <tt class="py-line">        <tt class="py-name">voffsets</tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt><tt class="py-op">]</tt> </tt>
-<a name="L410"></a><tt class="py-lineno"> 410</tt>  <tt class="py-line">        <tt class="py-comment"># The string table first has the list of keys, then the list of values.</tt> </tt>
-<a name="L411"></a><tt class="py-lineno"> 411</tt>  <tt class="py-line"><tt class="py-comment"></tt>        <tt class="py-comment"># Each entry has first the size of the string, then the file offset.</tt> </tt>
-<a name="L412"></a><tt class="py-lineno"> 412</tt>  <tt class="py-line"><tt class="py-comment"></tt>        <tt class="py-keyword">for</tt> <tt class="py-name">o1</tt><tt class="py-op">,</tt> <tt class="py-name">l1</tt><tt class="py-op">,</tt> <tt class="py-name">o2</tt><tt class="py-op">,</tt> <tt class="py-name">l2</tt> <tt class="py-keyword">in</tt> <tt class="py-name">offsets</tt><tt class="py-op">:</tt> </tt>
-<a name="L413"></a><tt class="py-lineno"> 413</tt>  <tt class="py-line">            <tt class="py-name">koffsets</tt> <tt class="py-op">+=</tt> <tt class="py-op">[</tt><tt class="py-name">l1</tt><tt class="py-op">,</tt> <tt class="py-name">o1</tt><tt class="py-op">+</tt><tt class="py-name">keystart</tt><tt class="py-op">]</tt> </tt>
-<a name="L414"></a><tt class="py-lineno"> 414</tt>  <tt class="py-line">            <tt class="py-name">voffsets</tt> <tt class="py-op">+=</tt> <tt class="py-op">[</tt><tt class="py-name">l2</tt><tt class="py-op">,</tt> <tt class="py-name">o2</tt><tt class="py-op">+</tt><tt class="py-name">valuestart</tt><tt class="py-op">]</tt> </tt>
-<a name="L415"></a><tt class="py-lineno"> 415</tt>  <tt class="py-line">        <tt class="py-name">offsets</tt> <tt class="py-op">=</tt> <tt class="py-name">koffsets</tt> <tt class="py-op">+</tt> <tt class="py-name">voffsets</tt> </tt>
-<a name="L416"></a><tt class="py-lineno"> 416</tt>  <tt class="py-line">        <tt class="py-name">output</tt> <tt class="py-op">=</tt> <tt class="py-name">struct</tt><tt class="py-op">.</tt><tt class="py-name">pack</tt><tt class="py-op">(</tt><tt class="py-string">"IIIIIII"</tt><tt class="py-op">,</tt> </tt>
-<a name="L417"></a><tt class="py-lineno"> 417</tt>  <tt class="py-line">                             <tt class="py-number">0x950412de</tt><tt class="py-op">,</tt>        <tt class="py-comment"># Magic number</tt> </tt>
-<a name="L418"></a><tt class="py-lineno"> 418</tt>  <tt class="py-line">                             <tt class="py-number">0</tt><tt class="py-op">,</tt>                 <tt class="py-comment"># Version</tt> </tt>
-<a name="L419"></a><tt class="py-lineno"> 419</tt>  <tt class="py-line">                             <tt class="py-name">entries_len</tt><tt class="py-op">,</tt>       <tt class="py-comment"># # of entries</tt> </tt>
-<a name="L420"></a><tt class="py-lineno"> 420</tt>  <tt class="py-line">                             <tt class="py-number">7</tt><tt class="py-op">*</tt><tt class="py-number">4</tt><tt class="py-op">,</tt>               <tt class="py-comment"># start of key index</tt> </tt>
-<a name="L421"></a><tt class="py-lineno"> 421</tt>  <tt class="py-line">                             <tt class="py-number">7</tt><tt class="py-op">*</tt><tt class="py-number">4</tt><tt class="py-op">+</tt><tt class="py-name">entries_len</tt><tt class="py-op">*</tt><tt class="py-number">8</tt><tt class="py-op">,</tt> <tt class="py-comment"># start of value index</tt> </tt>
-<a name="L422"></a><tt class="py-lineno"> 422</tt>  <tt class="py-line">                             <tt class="py-number">0</tt><tt class="py-op">,</tt> <tt class="py-number">0</tt><tt class="py-op">)</tt>              <tt class="py-comment"># size and offset of hash table</tt> </tt>
-<a name="L423"></a><tt class="py-lineno"> 423</tt>  <tt class="py-line">        <tt class="py-name">output</tt> <tt class="py-op">+=</tt> <tt class="py-name">array</tt><tt class="py-op">.</tt><tt class="py-name">array</tt><tt class="py-op">(</tt><tt class="py-string">"I"</tt><tt class="py-op">,</tt> <tt class="py-name">offsets</tt><tt class="py-op">)</tt><tt class="py-op">.</tt><tt class="py-name">tostring</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
-<a name="L424"></a><tt class="py-lineno"> 424</tt>  <tt class="py-line">        <tt class="py-name">output</tt> <tt class="py-op">+=</tt> <tt class="py-name">ids</tt> </tt>
-<a name="L425"></a><tt class="py-lineno"> 425</tt>  <tt class="py-line">        <tt class="py-name">output</tt> <tt class="py-op">+=</tt> <tt class="py-name">strs</tt> </tt>
-<a name="L426"></a><tt class="py-lineno"> 426</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">output</tt> </tt>
-</div></div><a name="L427"></a><tt class="py-lineno"> 427</tt>  <tt class="py-line"> </tt>
-<a name="L428"></a><tt class="py-lineno"> 428</tt>  <tt class="py-line"><tt class="py-comment"># }}}</tt> </tt>
-<a name="L429"></a><tt class="py-lineno"> 429</tt>  <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment"># class POFile {{{</tt> </tt>
-<a name="L430"></a><tt class="py-lineno"> 430</tt>  <tt class="py-line"><tt class="py-comment"></tt> </tt>
-<a name="POFile"></a><div id="POFile-def"><a name="L431"></a><tt class="py-lineno"> 431</tt> <a class="py-toggle" href="#" id="POFile-toggle" onclick="return toggle('POFile');">-</a><tt class="py-line"><tt class="py-keyword">class</tt> <a class="py-def-name" href="polib.POFile-class.html">POFile</a><tt class="py-op">(</tt><tt class="py-base-class">_BaseFile</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
-</div><div id="POFile-collapsed" style="display:none;" pad="++++" indent="++++"></div><div id="POFile-expanded"><a name="L432"></a><tt class="py-lineno"> 432</tt>  <tt class="py-line">    <tt class="py-docstring">'''</tt> </tt>
-<a name="L433"></a><tt class="py-lineno"> 433</tt>  <tt class="py-line"><tt class="py-docstring">    Po (or Pot) file reader/writer.</tt> </tt>
-<a name="L434"></a><tt class="py-lineno"> 434</tt>  <tt class="py-line"><tt class="py-docstring">    POFile objects inherit the list objects methods.</tt> </tt>
-<a name="L435"></a><tt class="py-lineno"> 435</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
-<a name="L436"></a><tt class="py-lineno"> 436</tt>  <tt class="py-line"><tt class="py-docstring">    **Example**:</tt> </tt>
-<a name="L437"></a><tt class="py-lineno"> 437</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
-<a name="L438"></a><tt class="py-lineno"> 438</tt>  <tt class="py-line"><tt class="py-docstring">    &gt;&gt;&gt; po = POFile()</tt> </tt>
-<a name="L439"></a><tt class="py-lineno"> 439</tt>  <tt class="py-line"><tt class="py-docstring">    &gt;&gt;&gt; entry1 = POEntry(</tt> </tt>
-<a name="L440"></a><tt class="py-lineno"> 440</tt>  <tt class="py-line"><tt class="py-docstring">    ...     msgid="Some english text",</tt> </tt>
-<a name="L441"></a><tt class="py-lineno"> 441</tt>  <tt class="py-line"><tt class="py-docstring">    ...     msgstr="Un texte en anglais"</tt> </tt>
-<a name="L442"></a><tt class="py-lineno"> 442</tt>  <tt class="py-line"><tt class="py-docstring">    ... )</tt> </tt>
-<a name="L443"></a><tt class="py-lineno"> 443</tt>  <tt class="py-line"><tt class="py-docstring">    &gt;&gt;&gt; entry1.occurrences = [('testfile', 12),('another_file', 1)]</tt> </tt>
-<a name="L444"></a><tt class="py-lineno"> 444</tt>  <tt class="py-line"><tt class="py-docstring">    &gt;&gt;&gt; entry1.comment = "Some useful comment"</tt> </tt>
-<a name="L445"></a><tt class="py-lineno"> 445</tt>  <tt class="py-line"><tt class="py-docstring">    &gt;&gt;&gt; entry2 = POEntry(</tt> </tt>
-<a name="L446"></a><tt class="py-lineno"> 446</tt>  <tt class="py-line"><tt class="py-docstring">    ...     msgid="Peace in some languages",</tt> </tt>
-<a name="L447"></a><tt class="py-lineno"> 447</tt>  <tt class="py-line"><tt class="py-docstring">    ...     msgstr="Pace &#1587;&#1604;&#1575;&#1605; &#1513;&#1500;&#1493;&#1501; Has&#238;t&#238; &#21644;&#24179;"</tt> </tt>
-<a name="L448"></a><tt class="py-lineno"> 448</tt>  <tt class="py-line"><tt class="py-docstring">    ... )</tt> </tt>
-<a name="L449"></a><tt class="py-lineno"> 449</tt>  <tt class="py-line"><tt class="py-docstring">    &gt;&gt;&gt; entry2.occurrences = [('testfile', 15),('another_file', 5)]</tt> </tt>
-<a name="L450"></a><tt class="py-lineno"> 450</tt>  <tt class="py-line"><tt class="py-docstring">    &gt;&gt;&gt; entry2.comment = "Another useful comment"</tt> </tt>
-<a name="L451"></a><tt class="py-lineno"> 451</tt>  <tt class="py-line"><tt class="py-docstring">    &gt;&gt;&gt; entry3 = POEntry(</tt> </tt>
-<a name="L452"></a><tt class="py-lineno"> 452</tt>  <tt class="py-line"><tt class="py-docstring">    ...     msgid='Some entry with quotes " \\"',</tt> </tt>
-<a name="L453"></a><tt class="py-lineno"> 453</tt>  <tt class="py-line"><tt class="py-docstring">    ...     msgstr='Un message unicode avec des quotes " \\"'</tt> </tt>
-<a name="L454"></a><tt class="py-lineno"> 454</tt>  <tt class="py-line"><tt class="py-docstring">    ... )</tt> </tt>
-<a name="L455"></a><tt class="py-lineno"> 455</tt>  <tt class="py-line"><tt class="py-docstring">    &gt;&gt;&gt; entry3.comment = "Test string quoting"</tt> </tt>
-<a name="L456"></a><tt class="py-lineno"> 456</tt>  <tt class="py-line"><tt class="py-docstring">    &gt;&gt;&gt; po.append(entry1)</tt> </tt>
-<a name="L457"></a><tt class="py-lineno"> 457</tt>  <tt class="py-line"><tt class="py-docstring">    &gt;&gt;&gt; po.append(entry2)</tt> </tt>
-<a name="L458"></a><tt class="py-lineno"> 458</tt>  <tt class="py-line"><tt class="py-docstring">    &gt;&gt;&gt; po.append(entry3)</tt> </tt>
-<a name="L459"></a><tt class="py-lineno"> 459</tt>  <tt class="py-line"><tt class="py-docstring">    &gt;&gt;&gt; po.header = "Some Header"</tt> </tt>
-<a name="L460"></a><tt class="py-lineno"> 460</tt>  <tt class="py-line"><tt class="py-docstring">    &gt;&gt;&gt; print(po)</tt> </tt>
-<a name="L461"></a><tt class="py-lineno"> 461</tt>  <tt class="py-line"><tt class="py-docstring">    # Some Header</tt> </tt>
-<a name="L462"></a><tt class="py-lineno"> 462</tt>  <tt class="py-line"><tt class="py-docstring">    msgid ""</tt> </tt>
-<a name="L463"></a><tt class="py-lineno"> 463</tt>  <tt class="py-line"><tt class="py-docstring">    msgstr ""</tt> </tt>
+<a name="L368"></a><tt class="py-lineno"> 368</tt>  <tt class="py-line">        <tt class="py-comment"># the keys are sorted in the .mo file</tt> </tt>
+<a name="L369"></a><tt class="py-lineno"> 369</tt>  <tt class="py-line"><tt class="py-comment"></tt>        <tt class="py-keyword">def</tt> <tt class="py-def-name">cmp</tt><tt class="py-op">(</tt><tt class="py-param">_self</tt><tt class="py-op">,</tt> <tt class="py-param">other</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
+<a name="L370"></a><tt class="py-lineno"> 370</tt>  <tt class="py-line">            <tt class="py-keyword">if</tt> <tt class="py-name">_self</tt><tt class="py-op">.</tt><tt class="py-name">msgid</tt> <tt class="py-op">&gt;</tt> <tt class="py-name">other</tt><tt class="py-op">.</tt><tt class="py-name">msgid</tt><tt class="py-op">:</tt> </tt>
+<a name="L371"></a><tt class="py-lineno"> 371</tt>  <tt class="py-line">                <tt class="py-keyword">return</tt> <tt class="py-number">1</tt> </tt>
+<a name="L372"></a><tt class="py-lineno"> 372</tt>  <tt class="py-line">            <tt class="py-keyword">elif</tt> <tt class="py-name">_self</tt><tt class="py-op">.</tt><tt class="py-name">msgid</tt> <tt class="py-op">&lt;</tt> <tt class="py-name">other</tt><tt class="py-op">.</tt><tt class="py-name">msgid</tt><tt class="py-op">:</tt> </tt>
+<a name="L373"></a><tt class="py-lineno"> 373</tt>  <tt class="py-line">                <tt class="py-keyword">return</tt> <tt class="py-op">-</tt><tt class="py-number">1</tt> </tt>
+<a name="L374"></a><tt class="py-lineno"> 374</tt>  <tt class="py-line">            <tt class="py-keyword">else</tt><tt class="py-op">:</tt> </tt>
+<a name="L375"></a><tt class="py-lineno"> 375</tt>  <tt class="py-line">                <tt class="py-keyword">return</tt> <tt class="py-number">0</tt> </tt>
+</div><a name="L376"></a><tt class="py-lineno"> 376</tt>  <tt class="py-line">        <tt class="py-name">entries</tt><tt class="py-op">.</tt><tt class="py-name">sort</tt><tt class="py-op">(</tt><tt class="py-name">cmp</tt><tt class="py-op">)</tt> </tt>
+<a name="L377"></a><tt class="py-lineno"> 377</tt>  <tt class="py-line">        <tt class="py-comment"># add metadata entry</tt> </tt>
+<a name="L378"></a><tt class="py-lineno"> 378</tt>  <tt class="py-line"><tt class="py-comment"></tt>        <tt class="py-name">mentry</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-19" class="py-name"><a title="polib._BaseFile.metadata_as_entry" class="py-name" href="#" onclick="return doclink('link-19', 'metadata_as_entry', 'link-12');">metadata_as_entry</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
+<a name="L379"></a><tt class="py-lineno"> 379</tt>  <tt class="py-line">        <tt class="py-name">mentry</tt><tt class="py-op">.</tt><tt class="py-name">msgstr</tt> <tt class="py-op">=</tt> <tt class="py-name">mentry</tt><tt class="py-op">.</tt><tt class="py-name">msgstr</tt><tt class="py-op">.</tt><tt class="py-name">replace</tt><tt class="py-op">(</tt><tt class="py-string">'\\n'</tt><tt class="py-op">,</tt> <tt class="py-string">''</tt><tt class="py-op">)</tt><tt class="py-op">.</tt><tt class="py-name">lstrip</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> <tt class="py-op">+</tt> <tt class="py-string">'\n'</tt> </tt>
+<a name="L380"></a><tt class="py-lineno"> 380</tt>  <tt class="py-line">        <tt class="py-name">entries</tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt><tt class="py-name">mentry</tt><tt class="py-op">]</tt> <tt class="py-op">+</tt> <tt class="py-name">entries</tt> </tt>
+<a name="L381"></a><tt class="py-lineno"> 381</tt>  <tt class="py-line">        <tt class="py-name">entries_len</tt> <tt class="py-op">=</tt> <tt class="py-name">len</tt><tt class="py-op">(</tt><tt class="py-name">entries</tt><tt class="py-op">)</tt> </tt>
+<a name="L382"></a><tt class="py-lineno"> 382</tt>  <tt class="py-line">        <tt class="py-keyword">for</tt> <tt class="py-name">e</tt> <tt class="py-keyword">in</tt> <tt class="py-name">entries</tt><tt class="py-op">:</tt> </tt>
+<a name="L383"></a><tt class="py-lineno"> 383</tt>  <tt class="py-line">            <tt class="py-comment"># For each string, we need size and file offset.  Each string is</tt> </tt>
+<a name="L384"></a><tt class="py-lineno"> 384</tt>  <tt class="py-line"><tt class="py-comment"></tt>            <tt class="py-comment"># NUL terminated; the NUL does not count into the size.</tt> </tt>
+<a name="L385"></a><tt class="py-lineno"> 385</tt>  <tt class="py-line"><tt class="py-comment"></tt>            <tt class="py-name">msgid</tt> <tt class="py-op">=</tt> <tt class="py-name">e</tt><tt class="py-op">.</tt><tt id="link-20" class="py-name" targets="Method polib._BaseEntry._decode()=polib._BaseEntry-class.html#_decode"><a title="polib._BaseEntry._decode" class="py-name" href="#" onclick="return doclink('link-20', '_decode', 'link-20');">_decode</a></tt><tt class="py-op">(</tt><tt class="py-name">e</tt><tt class="py-op">.</tt><tt class="py-name">msgid</tt><tt class="py-op">)</tt> </tt>
+<a name="L386"></a><tt class="py-lineno"> 386</tt>  <tt class="py-line">            <tt class="py-name">msgstr</tt> <tt class="py-op">=</tt> <tt class="py-name">e</tt><tt class="py-op">.</tt><tt id="link-21" class="py-name"><a title="polib._BaseEntry._decode" class="py-name" href="#" onclick="return doclink('link-21', '_decode', 'link-20');">_decode</a></tt><tt class="py-op">(</tt><tt class="py-name">e</tt><tt class="py-op">.</tt><tt class="py-name">msgstr</tt><tt class="py-op">)</tt> </tt>
+<a name="L387"></a><tt class="py-lineno"> 387</tt>  <tt class="py-line">            <tt class="py-name">offsets</tt><tt class="py-op">.</tt><tt class="py-name">append</tt><tt class="py-op">(</tt><tt class="py-op">(</tt><tt class="py-name">len</tt><tt class="py-op">(</tt><tt class="py-name">ids</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-name">len</tt><tt class="py-op">(</tt><tt class="py-name">msgid</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-name">len</tt><tt class="py-op">(</tt><tt class="py-name">strs</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-name">len</tt><tt class="py-op">(</tt><tt class="py-name">msgstr</tt><tt class="py-op">)</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
+<a name="L388"></a><tt class="py-lineno"> 388</tt>  <tt class="py-line">            <tt class="py-name">ids</tt>  <tt class="py-op">+=</tt> <tt class="py-name">msgid</tt>  <tt class="py-op">+</tt> <tt class="py-string">'\0'</tt> </tt>
+<a name="L389"></a><tt class="py-lineno"> 389</tt>  <tt class="py-line">            <tt class="py-name">strs</tt> <tt class="py-op">+=</tt> <tt class="py-name">msgstr</tt> <tt class="py-op">+</tt> <tt class="py-string">'\0'</tt> </tt>
+<a name="L390"></a><tt class="py-lineno"> 390</tt>  <tt class="py-line">        <tt class="py-comment"># The header is 7 32-bit unsigned integers.</tt> </tt>
+<a name="L391"></a><tt class="py-lineno"> 391</tt>  <tt class="py-line"><tt class="py-comment"></tt>        <tt class="py-name">keystart</tt> <tt class="py-op">=</tt> <tt class="py-number">7</tt><tt class="py-op">*</tt><tt class="py-number">4</tt><tt class="py-op">+</tt><tt class="py-number">16</tt><tt class="py-op">*</tt><tt class="py-name">entries_len</tt> </tt>
+<a name="L392"></a><tt class="py-lineno"> 392</tt>  <tt class="py-line">        <tt class="py-comment"># and the values start after the keys</tt> </tt>
+<a name="L393"></a><tt class="py-lineno"> 393</tt>  <tt class="py-line"><tt class="py-comment"></tt>        <tt class="py-name">valuestart</tt> <tt class="py-op">=</tt> <tt class="py-name">keystart</tt> <tt class="py-op">+</tt> <tt class="py-name">len</tt><tt class="py-op">(</tt><tt class="py-name">ids</tt><tt class="py-op">)</tt> </tt>
+<a name="L394"></a><tt class="py-lineno"> 394</tt>  <tt class="py-line">        <tt class="py-name">koffsets</tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt><tt class="py-op">]</tt> </tt>
+<a name="L395"></a><tt class="py-lineno"> 395</tt>  <tt class="py-line">        <tt class="py-name">voffsets</tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt><tt class="py-op">]</tt> </tt>
+<a name="L396"></a><tt class="py-lineno"> 396</tt>  <tt class="py-line">        <tt class="py-comment"># The string table first has the list of keys, then the list of values.</tt> </tt>
+<a name="L397"></a><tt class="py-lineno"> 397</tt>  <tt class="py-line"><tt class="py-comment"></tt>        <tt class="py-comment"># Each entry has first the size of the string, then the file offset.</tt> </tt>
+<a name="L398"></a><tt class="py-lineno"> 398</tt>  <tt class="py-line"><tt class="py-comment"></tt>        <tt class="py-keyword">for</tt> <tt class="py-name">o1</tt><tt class="py-op">,</tt> <tt class="py-name">l1</tt><tt class="py-op">,</tt> <tt class="py-name">o2</tt><tt class="py-op">,</tt> <tt class="py-name">l2</tt> <tt class="py-keyword">in</tt> <tt class="py-name">offsets</tt><tt class="py-op">:</tt> </tt>
+<a name="L399"></a><tt class="py-lineno"> 399</tt>  <tt class="py-line">            <tt class="py-name">koffsets</tt> <tt class="py-op">+=</tt> <tt class="py-op">[</tt><tt class="py-name">l1</tt><tt class="py-op">,</tt> <tt class="py-name">o1</tt><tt class="py-op">+</tt><tt class="py-name">keystart</tt><tt class="py-op">]</tt> </tt>
+<a name="L400"></a><tt class="py-lineno"> 400</tt>  <tt class="py-line">            <tt class="py-name">voffsets</tt> <tt class="py-op">+=</tt> <tt class="py-op">[</tt><tt class="py-name">l2</tt><tt class="py-op">,</tt> <tt class="py-name">o2</tt><tt class="py-op">+</tt><tt class="py-name">valuestart</tt><tt class="py-op">]</tt> </tt>
+<a name="L401"></a><tt class="py-lineno"> 401</tt>  <tt class="py-line">        <tt class="py-name">offsets</tt> <tt class="py-op">=</tt> <tt class="py-name">koffsets</tt> <tt class="py-op">+</tt> <tt class="py-name">voffsets</tt> </tt>
+<a name="L402"></a><tt class="py-lineno"> 402</tt>  <tt class="py-line">        <tt class="py-name">output</tt> <tt class="py-op">=</tt> <tt class="py-name">struct</tt><tt class="py-op">.</tt><tt class="py-name">pack</tt><tt class="py-op">(</tt><tt class="py-string">"IIIIIII"</tt><tt class="py-op">,</tt> </tt>
+<a name="L403"></a><tt class="py-lineno"> 403</tt>  <tt class="py-line">                             <tt class="py-number">0x950412de</tt><tt class="py-op">,</tt>        <tt class="py-comment"># Magic number</tt> </tt>
+<a name="L404"></a><tt class="py-lineno"> 404</tt>  <tt class="py-line">                             <tt class="py-number">0</tt><tt class="py-op">,</tt>                 <tt class="py-comment"># Version</tt> </tt>
+<a name="L405"></a><tt class="py-lineno"> 405</tt>  <tt class="py-line">                             <tt class="py-name">entries_len</tt><tt class="py-op">,</tt>       <tt class="py-comment"># # of entries</tt> </tt>
+<a name="L406"></a><tt class="py-lineno"> 406</tt>  <tt class="py-line">                             <tt class="py-number">7</tt><tt class="py-op">*</tt><tt class="py-number">4</tt><tt class="py-op">,</tt>               <tt class="py-comment"># start of key index</tt> </tt>
+<a name="L407"></a><tt class="py-lineno"> 407</tt>  <tt class="py-line">                             <tt class="py-number">7</tt><tt class="py-op">*</tt><tt class="py-number">4</tt><tt class="py-op">+</tt><tt class="py-name">entries_len</tt><tt class="py-op">*</tt><tt class="py-number">8</tt><tt class="py-op">,</tt> <tt class="py-comment"># start of value index</tt> </tt>
+<a name="L408"></a><tt class="py-lineno"> 408</tt>  <tt class="py-line">                             <tt class="py-number">0</tt><tt class="py-op">,</tt> <tt class="py-number">0</tt><tt class="py-op">)</tt>              <tt class="py-comment"># size and offset of hash table</tt> </tt>
+<a name="L409"></a><tt class="py-lineno"> 409</tt>  <tt class="py-line">        <tt class="py-name">output</tt> <tt class="py-op">+=</tt> <tt class="py-name">array</tt><tt class="py-op">.</tt><tt class="py-name">array</tt><tt class="py-op">(</tt><tt class="py-string">"I"</tt><tt class="py-op">,</tt> <tt class="py-name">offsets</tt><tt class="py-op">)</tt><tt class="py-op">.</tt><tt class="py-name">tostring</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
+<a name="L410"></a><tt class="py-lineno"> 410</tt>  <tt class="py-line">        <tt class="py-name">output</tt> <tt class="py-op">+=</tt> <tt class="py-name">ids</tt> </tt>
+<a name="L411"></a><tt class="py-lineno"> 411</tt>  <tt class="py-line">        <tt class="py-name">output</tt> <tt class="py-op">+=</tt> <tt class="py-name">strs</tt> </tt>
+<a name="L412"></a><tt class="py-lineno"> 412</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">output</tt> </tt>
+</div></div><a name="L413"></a><tt class="py-lineno"> 413</tt>  <tt class="py-line"> </tt>
+<a name="L414"></a><tt class="py-lineno"> 414</tt>  <tt class="py-line"><tt class="py-comment"># }}}</tt> </tt>
+<a name="L415"></a><tt class="py-lineno"> 415</tt>  <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment"># class POFile {{{</tt> </tt>
+<a name="L416"></a><tt class="py-lineno"> 416</tt>  <tt class="py-line"><tt class="py-comment"></tt> </tt>
+<a name="POFile"></a><div id="POFile-def"><a name="L417"></a><tt class="py-lineno"> 417</tt> <a class="py-toggle" href="#" id="POFile-toggle" onclick="return toggle('POFile');">-</a><tt class="py-line"><tt class="py-keyword">class</tt> <a class="py-def-name" href="polib.POFile-class.html">POFile</a><tt class="py-op">(</tt><tt class="py-base-class">_BaseFile</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
+</div><div id="POFile-collapsed" style="display:none;" pad="++++" indent="++++"></div><div id="POFile-expanded"><a name="L418"></a><tt class="py-lineno"> 418</tt>  <tt class="py-line">    <tt class="py-docstring">'''</tt> </tt>
+<a name="L419"></a><tt class="py-lineno"> 419</tt>  <tt class="py-line"><tt class="py-docstring">    Po (or Pot) file reader/writer.</tt> </tt>
+<a name="L420"></a><tt class="py-lineno"> 420</tt>  <tt class="py-line"><tt class="py-docstring">    POFile objects inherit the list objects methods.</tt> </tt>
+<a name="L421"></a><tt class="py-lineno"> 421</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
+<a name="L422"></a><tt class="py-lineno"> 422</tt>  <tt class="py-line"><tt class="py-docstring">    **Example**:</tt> </tt>
+<a name="L423"></a><tt class="py-lineno"> 423</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
+<a name="L424"></a><tt class="py-lineno"> 424</tt>  <tt class="py-line"><tt class="py-docstring">    &gt;&gt;&gt; po = POFile()</tt> </tt>
+<a name="L425"></a><tt class="py-lineno"> 425</tt>  <tt class="py-line"><tt class="py-docstring">    &gt;&gt;&gt; entry1 = POEntry(</tt> </tt>
+<a name="L426"></a><tt class="py-lineno"> 426</tt>  <tt class="py-line"><tt class="py-docstring">    ...     msgid="Some english text",</tt> </tt>
+<a name="L427"></a><tt class="py-lineno"> 427</tt>  <tt class="py-line"><tt class="py-docstring">    ...     msgstr="Un texte en anglais"</tt> </tt>
+<a name="L428"></a><tt class="py-lineno"> 428</tt>  <tt class="py-line"><tt class="py-docstring">    ... )</tt> </tt>
+<a name="L429"></a><tt class="py-lineno"> 429</tt>  <tt class="py-line"><tt class="py-docstring">    &gt;&gt;&gt; entry1.occurrences = [('testfile', 12),('another_file', 1)]</tt> </tt>
+<a name="L430"></a><tt class="py-lineno"> 430</tt>  <tt class="py-line"><tt class="py-docstring">    &gt;&gt;&gt; entry1.comment = "Some useful comment"</tt> </tt>
+<a name="L431"></a><tt class="py-lineno"> 431</tt>  <tt class="py-line"><tt class="py-docstring">    &gt;&gt;&gt; entry2 = POEntry(</tt> </tt>
+<a name="L432"></a><tt class="py-lineno"> 432</tt>  <tt class="py-line"><tt class="py-docstring">    ...     msgid="Peace in some languages",</tt> </tt>
+<a name="L433"></a><tt class="py-lineno"> 433</tt>  <tt class="py-line"><tt class="py-docstring">    ...     msgstr="Pace &#1587;&#1604;&#1575;&#1605; &#1513;&#1500;&#1493;&#1501; Has&#238;t&#238; &#21644;&#24179;"</tt> </tt>
+<a name="L434"></a><tt class="py-lineno"> 434</tt>  <tt class="py-line"><tt class="py-docstring">    ... )</tt> </tt>
+<a name="L435"></a><tt class="py-lineno"> 435</tt>  <tt class="py-line"><tt class="py-docstring">    &gt;&gt;&gt; entry2.occurrences = [('testfile', 15),('another_file', 5)]</tt> </tt>
+<a name="L436"></a><tt class="py-lineno"> 436</tt>  <tt class="py-line"><tt class="py-docstring">    &gt;&gt;&gt; entry2.comment = "Another useful comment"</tt> </tt>
+<a name="L437"></a><tt class="py-lineno"> 437</tt>  <tt class="py-line"><tt class="py-docstring">    &gt;&gt;&gt; entry3 = POEntry(</tt> </tt>
+<a name="L438"></a><tt class="py-lineno"> 438</tt>  <tt class="py-line"><tt class="py-docstring">    ...     msgid='Some entry with quotes " \\"',</tt> </tt>
+<a name="L439"></a><tt class="py-lineno"> 439</tt>  <tt class="py-line"><tt class="py-docstring">    ...     msgstr='Un message unicode avec des quotes " \\"'</tt> </tt>
+<a name="L440"></a><tt class="py-lineno"> 440</tt>  <tt class="py-line"><tt class="py-docstring">    ... )</tt> </tt>
+<a name="L441"></a><tt class="py-lineno"> 441</tt>  <tt class="py-line"><tt class="py-docstring">    &gt;&gt;&gt; entry3.comment = "Test string quoting"</tt> </tt>
+<a name="L442"></a><tt class="py-lineno"> 442</tt>  <tt class="py-line"><tt class="py-docstring">    &gt;&gt;&gt; po.append(entry1)</tt> </tt>
+<a name="L443"></a><tt class="py-lineno"> 443</tt>  <tt class="py-line"><tt class="py-docstring">    &gt;&gt;&gt; po.append(entry2)</tt> </tt>
+<a name="L444"></a><tt class="py-lineno"> 444</tt>  <tt class="py-line"><tt class="py-docstring">    &gt;&gt;&gt; po.append(entry3)</tt> </tt>
+<a name="L445"></a><tt class="py-lineno"> 445</tt>  <tt class="py-line"><tt class="py-docstring">    &gt;&gt;&gt; po.header = "Some Header"</tt> </tt>
+<a name="L446"></a><tt class="py-lineno"> 446</tt>  <tt class="py-line"><tt class="py-docstring">    &gt;&gt;&gt; print(po)</tt> </tt>
+<a name="L447"></a><tt class="py-lineno"> 447</tt>  <tt class="py-line"><tt class="py-docstring">    # Some Header</tt> </tt>
+<a name="L448"></a><tt class="py-lineno"> 448</tt>  <tt class="py-line"><tt class="py-docstring">    msgid ""</tt> </tt>
+<a name="L449"></a><tt class="py-lineno"> 449</tt>  <tt class="py-line"><tt class="py-docstring">    msgstr ""</tt> </tt>
+<a name="L450"></a><tt class="py-lineno"> 450</tt>  <tt class="py-line"><tt class="py-docstring">    &lt;BLANKLINE&gt;</tt> </tt>
+<a name="L451"></a><tt class="py-lineno"> 451</tt>  <tt class="py-line"><tt class="py-docstring">    #. Some useful comment</tt> </tt>
+<a name="L452"></a><tt class="py-lineno"> 452</tt>  <tt class="py-line"><tt class="py-docstring">    #: testfile:12 another_file:1</tt> </tt>
+<a name="L453"></a><tt class="py-lineno"> 453</tt>  <tt class="py-line"><tt class="py-docstring">    msgid "Some english text"</tt> </tt>
+<a name="L454"></a><tt class="py-lineno"> 454</tt>  <tt class="py-line"><tt class="py-docstring">    msgstr "Un texte en anglais"</tt> </tt>
+<a name="L455"></a><tt class="py-lineno"> 455</tt>  <tt class="py-line"><tt class="py-docstring">    &lt;BLANKLINE&gt;</tt> </tt>
+<a name="L456"></a><tt class="py-lineno"> 456</tt>  <tt class="py-line"><tt class="py-docstring">    #. Another useful comment</tt> </tt>
+<a name="L457"></a><tt class="py-lineno"> 457</tt>  <tt class="py-line"><tt class="py-docstring">    #: testfile:15 another_file:5</tt> </tt>
+<a name="L458"></a><tt class="py-lineno"> 458</tt>  <tt class="py-line"><tt class="py-docstring">    msgid "Peace in some languages"</tt> </tt>
+<a name="L459"></a><tt class="py-lineno"> 459</tt>  <tt class="py-line"><tt class="py-docstring">    msgstr "Pace &#1587;&#1604;&#1575;&#1605; &#1513;&#1500;&#1493;&#1501; Has&#238;t&#238; &#21644;&#24179;"</tt> </tt>
+<a name="L460"></a><tt class="py-lineno"> 460</tt>  <tt class="py-line"><tt class="py-docstring">    &lt;BLANKLINE&gt;</tt> </tt>
+<a name="L461"></a><tt class="py-lineno"> 461</tt>  <tt class="py-line"><tt class="py-docstring">    #. Test string quoting</tt> </tt>
+<a name="L462"></a><tt class="py-lineno"> 462</tt>  <tt class="py-line"><tt class="py-docstring">    msgid "Some entry with quotes \\" \\""</tt> </tt>
+<a name="L463"></a><tt class="py-lineno"> 463</tt>  <tt class="py-line"><tt class="py-docstring">    msgstr "Un message unicode avec des quotes \\" \\""</tt> </tt>
 <a name="L464"></a><tt class="py-lineno"> 464</tt>  <tt class="py-line"><tt class="py-docstring">    &lt;BLANKLINE&gt;</tt> </tt>
-<a name="L465"></a><tt class="py-lineno"> 465</tt>  <tt class="py-line"><tt class="py-docstring">    #. Some useful comment</tt> </tt>
-<a name="L466"></a><tt class="py-lineno"> 466</tt>  <tt class="py-line"><tt class="py-docstring">    #: testfile:12 another_file:1</tt> </tt>
-<a name="L467"></a><tt class="py-lineno"> 467</tt>  <tt class="py-line"><tt class="py-docstring">    msgid "Some english text"</tt> </tt>
-<a name="L468"></a><tt class="py-lineno"> 468</tt>  <tt class="py-line"><tt class="py-docstring">    msgstr "Un texte en anglais"</tt> </tt>
-<a name="L469"></a><tt class="py-lineno"> 469</tt>  <tt class="py-line"><tt class="py-docstring">    &lt;BLANKLINE&gt;</tt> </tt>
-<a name="L470"></a><tt class="py-lineno"> 470</tt>  <tt class="py-line"><tt class="py-docstring">    #. Another useful comment</tt> </tt>
-<a name="L471"></a><tt class="py-lineno"> 471</tt>  <tt class="py-line"><tt class="py-docstring">    #: testfile:15 another_file:5</tt> </tt>
-<a name="L472"></a><tt class="py-lineno"> 472</tt>  <tt class="py-line"><tt class="py-docstring">    msgid "Peace in some languages"</tt> </tt>
-<a name="L473"></a><tt class="py-lineno"> 473</tt>  <tt class="py-line"><tt class="py-docstring">    msgstr "Pace &#1587;&#1604;&#1575;&#1605; &#1513;&#1500;&#1493;&#1501; Has&#238;t&#238; &#21644;&#24179;"</tt> </tt>
-<a name="L474"></a><tt class="py-lineno"> 474</tt>  <tt class="py-line"><tt class="py-docstring">    &lt;BLANKLINE&gt;</tt> </tt>
-<a name="L475"></a><tt class="py-lineno"> 475</tt>  <tt class="py-line"><tt class="py-docstring">    #. Test string quoting</tt> </tt>
-<a name="L476"></a><tt class="py-lineno"> 476</tt>  <tt class="py-line"><tt class="py-docstring">    msgid "Some entry with quotes \\" \\""</tt> </tt>
-<a name="L477"></a><tt class="py-lineno"> 477</tt>  <tt class="py-line"><tt class="py-docstring">    msgstr "Un message unicode avec des quotes \\" \\""</tt> </tt>
-<a name="L478"></a><tt class="py-lineno"> 478</tt>  <tt class="py-line"><tt class="py-docstring">    &lt;BLANKLINE&gt;</tt> </tt>
-<a name="L479"></a><tt class="py-lineno"> 479</tt>  <tt class="py-line"><tt class="py-docstring">    '''</tt> </tt>
-<a name="L480"></a><tt class="py-lineno"> 480</tt>  <tt class="py-line"> </tt>
-<a name="POFile.__str__"></a><div id="POFile.__str__-def"><a name="L481"></a><tt class="py-lineno"> 481</tt> <a class="py-toggle" href="#" id="POFile.__str__-toggle" onclick="return toggle('POFile.__str__');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="polib.POFile-class.html#__str__">__str__</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
-</div><div id="POFile.__str__-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="POFile.__str__-expanded"><a name="L482"></a><tt class="py-lineno"> 482</tt>  <tt class="py-line">        <tt class="py-docstring">"""Return the string representation of the po file"""</tt> </tt>
-<a name="L483"></a><tt class="py-lineno"> 483</tt>  <tt class="py-line">        <tt class="py-name">ret</tt><tt class="py-op">,</tt> <tt class="py-name">headers</tt> <tt class="py-op">=</tt> <tt class="py-string">''</tt><tt class="py-op">,</tt> <tt class="py-name">_strsplit</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">header</tt><tt class="py-op">,</tt> <tt class="py-string">'\n'</tt><tt class="py-op">)</tt> </tt>
-<a name="L484"></a><tt class="py-lineno"> 484</tt>  <tt class="py-line">        <tt class="py-keyword">for</tt> <tt class="py-name">header</tt> <tt class="py-keyword">in</tt> <tt class="py-name">headers</tt><tt class="py-op">:</tt> </tt>
-<a name="L485"></a><tt class="py-lineno"> 485</tt>  <tt class="py-line">            <tt class="py-keyword">if</tt> <tt class="py-name">header</tt><tt class="py-op">[</tt><tt class="py-op">:</tt><tt class="py-number">1</tt><tt class="py-op">]</tt> <tt class="py-keyword">in</tt> <tt class="py-op">[</tt><tt class="py-string">','</tt><tt class="py-op">,</tt> <tt class="py-string">':'</tt><tt class="py-op">]</tt><tt class="py-op">:</tt> </tt>
-<a name="L486"></a><tt class="py-lineno"> 486</tt>  <tt class="py-line">                <tt class="py-name">ret</tt> <tt class="py-op">+=</tt> <tt class="py-string">'#%s\n'</tt> <tt class="py-op">%</tt> <tt class="py-name">header</tt> </tt>
-<a name="L487"></a><tt class="py-lineno"> 487</tt>  <tt class="py-line">            <tt class="py-keyword">else</tt><tt class="py-op">:</tt> </tt>
-<a name="L488"></a><tt class="py-lineno"> 488</tt>  <tt class="py-line">                <tt class="py-name">ret</tt> <tt class="py-op">+=</tt> <tt class="py-string">'# %s\n'</tt> <tt class="py-op">%</tt> <tt class="py-name">header</tt> </tt>
-<a name="L489"></a><tt class="py-lineno"> 489</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">ret</tt> <tt class="py-op">+</tt> <tt id="link-22" class="py-name" targets="Class polib._BaseFile=polib._BaseFile-class.html"><a title="polib._BaseFile" class="py-name" href="#" onclick="return doclink('link-22', '_BaseFile', 'link-22');">_BaseFile</a></tt><tt class="py-op">.</tt><tt id="link-23" class="py-name"><a title="polib.MOEntry.__str__
+<a name="L465"></a><tt class="py-lineno"> 465</tt>  <tt class="py-line"><tt class="py-docstring">    '''</tt> </tt>
+<a name="L466"></a><tt class="py-lineno"> 466</tt>  <tt class="py-line"> </tt>
+<a name="POFile.__str__"></a><div id="POFile.__str__-def"><a name="L467"></a><tt class="py-lineno"> 467</tt> <a class="py-toggle" href="#" id="POFile.__str__-toggle" onclick="return toggle('POFile.__str__');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="polib.POFile-class.html#__str__">__str__</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
+</div><div id="POFile.__str__-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="POFile.__str__-expanded"><a name="L468"></a><tt class="py-lineno"> 468</tt>  <tt class="py-line">        <tt class="py-docstring">"""Return the string representation of the po file"""</tt> </tt>
+<a name="L469"></a><tt class="py-lineno"> 469</tt>  <tt class="py-line">        <tt class="py-name">ret</tt><tt class="py-op">,</tt> <tt class="py-name">headers</tt> <tt class="py-op">=</tt> <tt class="py-string">''</tt><tt class="py-op">,</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">header</tt><tt class="py-op">.</tt><tt class="py-name">split</tt><tt class="py-op">(</tt><tt class="py-string">'\n'</tt><tt class="py-op">)</tt> </tt>
+<a name="L470"></a><tt class="py-lineno"> 470</tt>  <tt class="py-line">        <tt class="py-keyword">for</tt> <tt class="py-name">header</tt> <tt class="py-keyword">in</tt> <tt class="py-name">headers</tt><tt class="py-op">:</tt> </tt>
+<a name="L471"></a><tt class="py-lineno"> 471</tt>  <tt class="py-line">            <tt class="py-keyword">if</tt> <tt class="py-name">header</tt><tt class="py-op">[</tt><tt class="py-op">:</tt><tt class="py-number">1</tt><tt class="py-op">]</tt> <tt class="py-keyword">in</tt> <tt class="py-op">[</tt><tt class="py-string">','</tt><tt class="py-op">,</tt> <tt class="py-string">':'</tt><tt class="py-op">]</tt><tt class="py-op">:</tt> </tt>
+<a name="L472"></a><tt class="py-lineno"> 472</tt>  <tt class="py-line">                <tt class="py-name">ret</tt> <tt class="py-op">+=</tt> <tt class="py-string">'#%s\n'</tt> <tt class="py-op">%</tt> <tt class="py-name">header</tt> </tt>
+<a name="L473"></a><tt class="py-lineno"> 473</tt>  <tt class="py-line">            <tt class="py-keyword">else</tt><tt class="py-op">:</tt> </tt>
+<a name="L474"></a><tt class="py-lineno"> 474</tt>  <tt class="py-line">                <tt class="py-name">ret</tt> <tt class="py-op">+=</tt> <tt class="py-string">'# %s\n'</tt> <tt class="py-op">%</tt> <tt class="py-name">header</tt> </tt>
+<a name="L475"></a><tt class="py-lineno"> 475</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">ret</tt> <tt class="py-op">+</tt> <tt id="link-22" class="py-name" targets="Class polib._BaseFile=polib._BaseFile-class.html"><a title="polib._BaseFile" class="py-name" href="#" onclick="return doclink('link-22', '_BaseFile', 'link-22');">_BaseFile</a></tt><tt class="py-op">.</tt><tt id="link-23" class="py-name"><a title="polib.MOEntry.__str__
 polib.POEntry.__str__
 polib.POFile.__str__
 polib._BaseEntry.__str__
 polib._BaseFile.__str__" class="py-name" href="#" onclick="return doclink('link-23', '__str__', 'link-13');">__str__</a></tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">)</tt> </tt>
-</div><a name="L490"></a><tt class="py-lineno"> 490</tt>  <tt class="py-line"> </tt>
-<a name="POFile.save_as_mofile"></a><div id="POFile.save_as_mofile-def"><a name="L491"></a><tt class="py-lineno"> 491</tt> <a class="py-toggle" href="#" id="POFile.save_as_mofile-toggle" onclick="return toggle('POFile.save_as_mofile');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="polib.POFile-class.html#save_as_mofile">save_as_mofile</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">fpath</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
-</div><div id="POFile.save_as_mofile-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="POFile.save_as_mofile-expanded"><a name="L492"></a><tt class="py-lineno"> 492</tt>  <tt class="py-line">        <tt class="py-docstring">"""</tt> </tt>
-<a name="L493"></a><tt class="py-lineno"> 493</tt>  <tt class="py-line"><tt class="py-docstring">        Save the binary representation of the file to *fpath*.</tt> </tt>
-<a name="L494"></a><tt class="py-lineno"> 494</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
-<a name="L495"></a><tt class="py-lineno"> 495</tt>  <tt class="py-line"><tt class="py-docstring">        **Keyword arguments**:</tt> </tt>
-<a name="L496"></a><tt class="py-lineno"> 496</tt>  <tt class="py-line"><tt class="py-docstring">          - *fpath*: string, full or relative path to the file.</tt> </tt>
-<a name="L497"></a><tt class="py-lineno"> 497</tt>  <tt class="py-line"><tt class="py-docstring">        """</tt> </tt>
-<a name="L498"></a><tt class="py-lineno"> 498</tt>  <tt class="py-line">        <tt id="link-24" class="py-name"><a title="polib._BaseFile" class="py-name" href="#" onclick="return doclink('link-24', '_BaseFile', 'link-22');">_BaseFile</a></tt><tt class="py-op">.</tt><tt id="link-25" class="py-name" targets="Method polib.MOFile.save()=polib.MOFile-class.html#save,Method polib._BaseFile.save()=polib._BaseFile-class.html#save"><a title="polib.MOFile.save
+</div><a name="L476"></a><tt class="py-lineno"> 476</tt>  <tt class="py-line"> </tt>
+<a name="POFile.save_as_mofile"></a><div id="POFile.save_as_mofile-def"><a name="L477"></a><tt class="py-lineno"> 477</tt> <a class="py-toggle" href="#" id="POFile.save_as_mofile-toggle" onclick="return toggle('POFile.save_as_mofile');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="polib.POFile-class.html#save_as_mofile">save_as_mofile</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">fpath</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
+</div><div id="POFile.save_as_mofile-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="POFile.save_as_mofile-expanded"><a name="L478"></a><tt class="py-lineno"> 478</tt>  <tt class="py-line">        <tt class="py-docstring">"""</tt> </tt>
+<a name="L479"></a><tt class="py-lineno"> 479</tt>  <tt class="py-line"><tt class="py-docstring">        Save the binary representation of the file to *fpath*.</tt> </tt>
+<a name="L480"></a><tt class="py-lineno"> 480</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
+<a name="L481"></a><tt class="py-lineno"> 481</tt>  <tt class="py-line"><tt class="py-docstring">        **Keyword arguments**:</tt> </tt>
+<a name="L482"></a><tt class="py-lineno"> 482</tt>  <tt class="py-line"><tt class="py-docstring">          - *fpath*: string, full or relative path to the file.</tt> </tt>
+<a name="L483"></a><tt class="py-lineno"> 483</tt>  <tt class="py-line"><tt class="py-docstring">        """</tt> </tt>
+<a name="L484"></a><tt class="py-lineno"> 484</tt>  <tt class="py-line">        <tt id="link-24" class="py-name"><a title="polib._BaseFile" class="py-name" href="#" onclick="return doclink('link-24', '_BaseFile', 'link-22');">_BaseFile</a></tt><tt class="py-op">.</tt><tt id="link-25" class="py-name" targets="Method polib.MOFile.save()=polib.MOFile-class.html#save,Method polib._BaseFile.save()=polib._BaseFile-class.html#save"><a title="polib.MOFile.save
 polib._BaseFile.save" class="py-name" href="#" onclick="return doclink('link-25', 'save', 'link-25');">save</a></tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">,</tt> <tt class="py-name">fpath</tt><tt class="py-op">,</tt> <tt class="py-string">'to_binary'</tt><tt class="py-op">)</tt> </tt>
-</div><a name="L499"></a><tt class="py-lineno"> 499</tt>  <tt class="py-line"> </tt>
-<a name="POFile.percent_translated"></a><div id="POFile.percent_translated-def"><a name="L500"></a><tt class="py-lineno"> 500</tt> <a class="py-toggle" href="#" id="POFile.percent_translated-toggle" onclick="return toggle('POFile.percent_translated');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="polib.POFile-class.html#percent_translated">percent_translated</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
-</div><div id="POFile.percent_translated-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="POFile.percent_translated-expanded"><a name="L501"></a><tt class="py-lineno"> 501</tt>  <tt class="py-line">        <tt class="py-docstring">"""</tt> </tt>
-<a name="L502"></a><tt class="py-lineno"> 502</tt>  <tt class="py-line"><tt class="py-docstring">        Convenience method that return the percentage of translated</tt> </tt>
-<a name="L503"></a><tt class="py-lineno"> 503</tt>  <tt class="py-line"><tt class="py-docstring">        messages.</tt> </tt>
-<a name="L504"></a><tt class="py-lineno"> 504</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
-<a name="L505"></a><tt class="py-lineno"> 505</tt>  <tt class="py-line"><tt class="py-docstring">        **Example**:</tt> </tt>
-<a name="L506"></a><tt class="py-lineno"> 506</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
-<a name="L507"></a><tt class="py-lineno"> 507</tt>  <tt class="py-line"><tt class="py-docstring">        &gt;&gt;&gt; import polib</tt> </tt>
-<a name="L508"></a><tt class="py-lineno"> 508</tt>  <tt class="py-line"><tt class="py-docstring">        &gt;&gt;&gt; po = polib.pofile('tests/test_pofile_helpers.po')</tt> </tt>
-<a name="L509"></a><tt class="py-lineno"> 509</tt>  <tt class="py-line"><tt class="py-docstring">        &gt;&gt;&gt; po.percent_translated()</tt> </tt>
-<a name="L510"></a><tt class="py-lineno"> 510</tt>  <tt class="py-line"><tt class="py-docstring">        50</tt> </tt>
-<a name="L511"></a><tt class="py-lineno"> 511</tt>  <tt class="py-line"><tt class="py-docstring">        &gt;&gt;&gt; po = POFile()</tt> </tt>
-<a name="L512"></a><tt class="py-lineno"> 512</tt>  <tt class="py-line"><tt class="py-docstring">        &gt;&gt;&gt; po.percent_translated()</tt> </tt>
-<a name="L513"></a><tt class="py-lineno"> 513</tt>  <tt class="py-line"><tt class="py-docstring">        100</tt> </tt>
-<a name="L514"></a><tt class="py-lineno"> 514</tt>  <tt class="py-line"><tt class="py-docstring">        """</tt> </tt>
-<a name="L515"></a><tt class="py-lineno"> 515</tt>  <tt class="py-line">        <tt class="py-name">total</tt> <tt class="py-op">=</tt> <tt class="py-name">len</tt><tt class="py-op">(</tt><tt class="py-op">[</tt><tt class="py-name">e</tt> <tt class="py-keyword">for</tt> <tt class="py-name">e</tt> <tt class="py-keyword">in</tt> <tt class="py-name">self</tt> <tt class="py-keyword">if</tt> <tt class="py-keyword">not</tt> <tt class="py-name">e</tt><tt class="py-op">.</tt><tt class="py-name">obsolete</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
-<a name="L516"></a><tt class="py-lineno"> 516</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-name">total</tt> <tt class="py-op">==</tt> <tt class="py-number">0</tt><tt class="py-op">:</tt> </tt>
-<a name="L517"></a><tt class="py-lineno"> 517</tt>  <tt class="py-line">            <tt class="py-keyword">return</tt> <tt class="py-number">100</tt> </tt>
-<a name="L518"></a><tt class="py-lineno"> 518</tt>  <tt class="py-line">        <tt id="link-26" class="py-name" targets="Method polib.POEntry.translated()=polib.POEntry-class.html#translated"><a title="polib.POEntry.translated" class="py-name" href="#" onclick="return doclink('link-26', 'translated', 'link-26');">translated</a></tt> <tt class="py-op">=</tt> <tt class="py-name">len</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-27" class="py-name"><a title="polib.MOFile.translated_entries
+</div><a name="L485"></a><tt class="py-lineno"> 485</tt>  <tt class="py-line"> </tt>
+<a name="POFile.percent_translated"></a><div id="POFile.percent_translated-def"><a name="L486"></a><tt class="py-lineno"> 486</tt> <a class="py-toggle" href="#" id="POFile.percent_translated-toggle" onclick="return toggle('POFile.percent_translated');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="polib.POFile-class.html#percent_translated">percent_translated</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
+</div><div id="POFile.percent_translated-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="POFile.percent_translated-expanded"><a name="L487"></a><tt class="py-lineno"> 487</tt>  <tt class="py-line">        <tt class="py-docstring">"""</tt> </tt>
+<a name="L488"></a><tt class="py-lineno"> 488</tt>  <tt class="py-line"><tt class="py-docstring">        Convenience method that return the percentage of translated</tt> </tt>
+<a name="L489"></a><tt class="py-lineno"> 489</tt>  <tt class="py-line"><tt class="py-docstring">        messages.</tt> </tt>
+<a name="L490"></a><tt class="py-lineno"> 490</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
+<a name="L491"></a><tt class="py-lineno"> 491</tt>  <tt class="py-line"><tt class="py-docstring">        **Example**:</tt> </tt>
+<a name="L492"></a><tt class="py-lineno"> 492</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
+<a name="L493"></a><tt class="py-lineno"> 493</tt>  <tt class="py-line"><tt class="py-docstring">        &gt;&gt;&gt; import polib</tt> </tt>
+<a name="L494"></a><tt class="py-lineno"> 494</tt>  <tt class="py-line"><tt class="py-docstring">        &gt;&gt;&gt; po = polib.pofile('tests/test_pofile_helpers.po')</tt> </tt>
+<a name="L495"></a><tt class="py-lineno"> 495</tt>  <tt class="py-line"><tt class="py-docstring">        &gt;&gt;&gt; po.percent_translated()</tt> </tt>
+<a name="L496"></a><tt class="py-lineno"> 496</tt>  <tt class="py-line"><tt class="py-docstring">        50</tt> </tt>
+<a name="L497"></a><tt class="py-lineno"> 497</tt>  <tt class="py-line"><tt class="py-docstring">        &gt;&gt;&gt; po = POFile()</tt> </tt>
+<a name="L498"></a><tt class="py-lineno"> 498</tt>  <tt class="py-line"><tt class="py-docstring">        &gt;&gt;&gt; po.percent_translated()</tt> </tt>
+<a name="L499"></a><tt class="py-lineno"> 499</tt>  <tt class="py-line"><tt class="py-docstring">        100</tt> </tt>
+<a name="L500"></a><tt class="py-lineno"> 500</tt>  <tt class="py-line"><tt class="py-docstring">        """</tt> </tt>
+<a name="L501"></a><tt class="py-lineno"> 501</tt>  <tt class="py-line">        <tt class="py-name">total</tt> <tt class="py-op">=</tt> <tt class="py-name">len</tt><tt class="py-op">(</tt><tt class="py-op">[</tt><tt class="py-name">e</tt> <tt class="py-keyword">for</tt> <tt class="py-name">e</tt> <tt class="py-keyword">in</tt> <tt class="py-name">self</tt> <tt class="py-keyword">if</tt> <tt class="py-keyword">not</tt> <tt class="py-name">e</tt><tt class="py-op">.</tt><tt class="py-name">obsolete</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
+<a name="L502"></a><tt class="py-lineno"> 502</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-name">total</tt> <tt class="py-op">==</tt> <tt class="py-number">0</tt><tt class="py-op">:</tt> </tt>
+<a name="L503"></a><tt class="py-lineno"> 503</tt>  <tt class="py-line">            <tt class="py-keyword">return</tt> <tt class="py-number">100</tt> </tt>
+<a name="L504"></a><tt class="py-lineno"> 504</tt>  <tt class="py-line">        <tt id="link-26" class="py-name" targets="Method polib.POEntry.translated()=polib.POEntry-class.html#translated"><a title="polib.POEntry.translated" class="py-name" href="#" onclick="return doclink('link-26', 'translated', 'link-26');">translated</a></tt> <tt class="py-op">=</tt> <tt class="py-name">len</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-27" class="py-name"><a title="polib.MOFile.translated_entries
 polib.POFile.translated_entries" class="py-name" href="#" onclick="return doclink('link-27', 'translated_entries', 'link-18');">translated_entries</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
-<a name="L519"></a><tt class="py-lineno"> 519</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">int</tt><tt class="py-op">(</tt><tt class="py-op">(</tt><tt class="py-number">100.00</tt> <tt class="py-op">/</tt> <tt class="py-name">float</tt><tt class="py-op">(</tt><tt class="py-name">total</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> <tt class="py-op">*</tt> <tt id="link-28" class="py-name"><a title="polib.POEntry.translated" class="py-name" href="#" onclick="return doclink('link-28', 'translated', 'link-26');">translated</a></tt><tt class="py-op">)</tt> </tt>
-</div><a name="L520"></a><tt class="py-lineno"> 520</tt>  <tt class="py-line"> </tt>
-<a name="POFile.translated_entries"></a><div id="POFile.translated_entries-def"><a name="L521"></a><tt class="py-lineno"> 521</tt> <a class="py-toggle" href="#" id="POFile.translated_entries-toggle" onclick="return toggle('POFile.translated_entries');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="polib.POFile-class.html#translated_entries">translated_entries</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
-</div><div id="POFile.translated_entries-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="POFile.translated_entries-expanded"><a name="L522"></a><tt class="py-lineno"> 522</tt>  <tt class="py-line">        <tt class="py-docstring">"""</tt> </tt>
-<a name="L523"></a><tt class="py-lineno"> 523</tt>  <tt class="py-line"><tt class="py-docstring">        Convenience method that return a list of translated entries.</tt> </tt>
-<a name="L524"></a><tt class="py-lineno"> 524</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
-<a name="L525"></a><tt class="py-lineno"> 525</tt>  <tt class="py-line"><tt class="py-docstring">        **Example**:</tt> </tt>
-<a name="L526"></a><tt class="py-lineno"> 526</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
-<a name="L527"></a><tt class="py-lineno"> 527</tt>  <tt class="py-line"><tt class="py-docstring">        &gt;&gt;&gt; import polib</tt> </tt>
-<a name="L528"></a><tt class="py-lineno"> 528</tt>  <tt class="py-line"><tt class="py-docstring">        &gt;&gt;&gt; po = polib.pofile('tests/test_pofile_helpers.po')</tt> </tt>
-<a name="L529"></a><tt class="py-lineno"> 529</tt>  <tt class="py-line"><tt class="py-docstring">        &gt;&gt;&gt; len(po.translated_entries())</tt> </tt>
-<a name="L530"></a><tt class="py-lineno"> 530</tt>  <tt class="py-line"><tt class="py-docstring">        6</tt> </tt>
-<a name="L531"></a><tt class="py-lineno"> 531</tt>  <tt class="py-line"><tt class="py-docstring">        """</tt> </tt>
-<a name="L532"></a><tt class="py-lineno"> 532</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-op">[</tt><tt class="py-name">e</tt> <tt class="py-keyword">for</tt> <tt class="py-name">e</tt> <tt class="py-keyword">in</tt> <tt class="py-name">self</tt> <tt class="py-keyword">if</tt> <tt class="py-name">e</tt><tt class="py-op">.</tt><tt id="link-29" class="py-name"><a title="polib.POEntry.translated" class="py-name" href="#" onclick="return doclink('link-29', 'translated', 'link-26');">translated</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> <tt class="py-keyword">and</tt> <tt class="py-keyword">not</tt> <tt class="py-name">e</tt><tt class="py-op">.</tt><tt class="py-name">obsolete</tt><tt class="py-op">]</tt> </tt>
-</div><a name="L533"></a><tt class="py-lineno"> 533</tt>  <tt class="py-line"> </tt>
-<a name="POFile.untranslated_entries"></a><div id="POFile.untranslated_entries-def"><a name="L534"></a><tt class="py-lineno"> 534</tt> <a class="py-toggle" href="#" id="POFile.untranslated_entries-toggle" onclick="return toggle('POFile.untranslated_entries');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="polib.POFile-class.html#untranslated_entries">untranslated_entries</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
-</div><div id="POFile.untranslated_entries-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="POFile.untranslated_entries-expanded"><a name="L535"></a><tt class="py-lineno"> 535</tt>  <tt class="py-line">        <tt class="py-docstring">"""</tt> </tt>
-<a name="L536"></a><tt class="py-lineno"> 536</tt>  <tt class="py-line"><tt class="py-docstring">        Convenience method that return a list of untranslated entries.</tt> </tt>
-<a name="L537"></a><tt class="py-lineno"> 537</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
-<a name="L538"></a><tt class="py-lineno"> 538</tt>  <tt class="py-line"><tt class="py-docstring">        **Example**:</tt> </tt>
-<a name="L539"></a><tt class="py-lineno"> 539</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
-<a name="L540"></a><tt class="py-lineno"> 540</tt>  <tt class="py-line"><tt class="py-docstring">        &gt;&gt;&gt; import polib</tt> </tt>
-<a name="L541"></a><tt class="py-lineno"> 541</tt>  <tt class="py-line"><tt class="py-docstring">        &gt;&gt;&gt; po = polib.pofile('tests/test_pofile_helpers.po')</tt> </tt>
-<a name="L542"></a><tt class="py-lineno"> 542</tt>  <tt class="py-line"><tt class="py-docstring">        &gt;&gt;&gt; len(po.untranslated_entries())</tt> </tt>
-<a name="L543"></a><tt class="py-lineno"> 543</tt>  <tt class="py-line"><tt class="py-docstring">        6</tt> </tt>
-<a name="L544"></a><tt class="py-lineno"> 544</tt>  <tt class="py-line"><tt class="py-docstring">        """</tt> </tt>