<a name="L6"></a><tt class="py-lineno"> 6</tt> <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment"># This program is free software; you can redistribute it and/or</tt> </tt>
<a name="L7"></a><tt class="py-lineno"> 7</tt> <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment"># modify it under the terms of the GNU General Public License</tt> </tt>
<a name="L8"></a><tt class="py-lineno"> 8</tt> <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment"># as published by the Free Software Foundation; either version 2 </tt> </tt>
<a name="L9"></a><tt class="py-lineno"> 9</tt> <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment"># of the License, or (at your option) any later version.</tt> </tt>
<a name="L11"></a><tt class="py-lineno"> 11</tt> <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment"># This program is distributed in the hope that it will be useful,</tt> </tt>
<a name="L12"></a><tt class="py-lineno"> 12</tt> <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment"># but WITHOUT ANY WARRANTY; without even the implied warranty of</tt> </tt>
<a name="L13"></a><tt class="py-lineno"> 13</tt> <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment"># MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the</tt> </tt>
<a name="L14"></a><tt class="py-lineno"> 14</tt> <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment"># GNU General Public License for more details. </tt> </tt>
<a name="L16"></a><tt class="py-lineno"> 16</tt> <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment"># You should have received a copy of the GNU General Public License</tt> </tt>
<a name="L17"></a><tt class="py-lineno"> 17</tt> <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment"># along with this program; if not, write to the Free Software</tt> </tt>
<a name="L18"></a><tt class="py-lineno"> 18</tt> <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment"># Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.</tt> </tt>
<a name="L21"></a><tt class="py-lineno"> 21</tt> <tt class="py-line"><tt class="py-docstring">Parser for the XML format returned by PubMed's Web API</tt> </tt>
</div><div id="Reader-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="Reader-expanded"><a name="L33"></a><tt class="py-lineno"> 33</tt> <tt class="py-line"> <tt class="py-docstring">""" Parse records as returned by PubMed's web service."""</tt> </tt>
<a name="L40"></a><tt class="py-lineno"> 40</tt> <tt class="py-line"><tt class="py-docstring"> Used when outputting a warning for instance."""</tt> </tt>
</div><div id="Reader.do_default-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="Reader.do_default-expanded"><a name="L48"></a><tt class="py-lineno"> 48</tt> <tt class="py-line"> <tt class="py-docstring">""" Called when no specific handler exist."""</tt> </tt>
</div><div id="Reader.do_MedlineJournalInfo-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="Reader.do_MedlineJournalInfo-expanded"><a name="L55"></a><tt class="py-lineno"> 55</tt> <tt class="py-line"> <tt class="py-comment"># this can contain the journal title, but as a fallback</tt> </tt>
<a name="L78"></a><tt class="py-lineno"> 78</tt> <tt class="py-line"> <tt class="py-comment"># optionally, the title can come from the MedlineTA field</tt> </tt>
<a name="L95"></a><tt class="py-lineno"> 95</tt> <tt class="py-line"> <tt class="py-comment"># believe it if you want, but some records specify a</tt> </tt>
<a name="L96"></a><tt class="py-lineno"> 96</tt> <tt class="py-line"><tt class="py-comment"></tt> <tt class="py-comment"># "ForeName", and others a "FirstName"...</tt> </tt>
<a name="L107"></a><tt class="py-lineno">107</tt> <tt class="py-line"><tt class="py-comment"></tt> <tt class="py-comment"># meaning 1234-1245). We transform them into full ranges,</tt> </tt>
<a name="L108"></a><tt class="py-lineno">108</tt> <tt class="py-line"><tt class="py-comment"></tt> <tt class="py-comment"># as this is only some kind of space saving convention.</tt> </tt>
<a name="L116"></a><tt class="py-lineno">116</tt> <tt class="py-line"> <tt class="py-comment"># we could play with logs to find out the actual cut</tt> </tt>
<a name="L117"></a><tt class="py-lineno">117</tt> <tt class="py-line"><tt class="py-comment"></tt> <tt class="py-comment"># point, but using the textual representation is</tt> </tt>
</div><div id="Reader.record_end-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="Reader.record_end-expanded"><a name="L134"></a><tt class="py-lineno">134</tt> <tt class="py-line"> <tt class="py-comment"># in some cases, the journal title wasn't in the Journal node,</tt> </tt>
<a name="L135"></a><tt class="py-lineno">135</tt> <tt class="py-line"><tt class="py-comment"></tt> <tt class="py-comment"># but can be recovered from the MedlineTA field.</tt> </tt>