Commit 8b1d4e1c by William Tisäter

Update documentation and readme files

parent a6d892c2
......@@ -4,7 +4,9 @@ Pure Python GeoIP API
This library is based on `Maxmind's GeoIP C
API <https://github.com/maxmind/geoip-api-c>`__.
Tested with Python version 2.5, 2.6, 2.7, 3.1, 3.2 and 3.3.
Tested with Python version 2.5, 2.6, 2.7, 3.2 and 3.3.
|Build Status|
Installation
------------
......@@ -134,3 +136,6 @@ ASN Lookup
For more information, `check out the full API
documentation <http://packages.python.org/pygeoip>`__.
.. |Build Status| image:: https://travis-ci.org/appliedsec/pygeoip.png
:target: https://travis-ci.org/appliedsec/pygeoip
......@@ -61,23 +61,29 @@ pygeoip.util.ip2long pygeoip.util-module.html#ip2long
pygeoip.util.__package__ pygeoip.util-module.html#__package__
pygeoip.GeoIP pygeoip.GeoIP-class.html
pygeoip.GeoIP.country_code_by_addr pygeoip.GeoIP-class.html#country_code_by_addr
pygeoip.GeoIP.region_by_name pygeoip.GeoIP-class.html#region_by_name
pygeoip.GeoIP.__metaclass__ pygeoip._GeoIPMetaclass-class.html
pygeoip.GeoIP.record_by_name pygeoip.GeoIP-class.html#record_by_name
pygeoip.GeoIP._setup_segments pygeoip.GeoIP-class.html#_setup_segments
pygeoip.GeoIP._seek_country pygeoip.GeoIP-class.html#_seek_country
pygeoip.GeoIP.region_by_name pygeoip.GeoIP-class.html#region_by_name
pygeoip.GeoIP.__init__ pygeoip.GeoIP-class.html#__init__
pygeoip.GeoIP.time_zone_by_name pygeoip.GeoIP-class.html#time_zone_by_name
pygeoip.GeoIP._get_region pygeoip.GeoIP-class.html#_get_region
pygeoip.GeoIP.country_code_by_name pygeoip.GeoIP-class.html#country_code_by_name
pygeoip.GeoIP._get_org pygeoip.GeoIP-class.html#_get_org
pygeoip.GeoIP._str_to_fp pygeoip.GeoIP-class.html#_str_to_fp
pygeoip.GeoIP.time_zone_by_addr pygeoip.GeoIP-class.html#time_zone_by_addr
pygeoip.GeoIP.id_by_addr pygeoip.GeoIP-class.html#id_by_addr
pygeoip.GeoIP.time_zone_by_name pygeoip.GeoIP-class.html#time_zone_by_name
pygeoip.GeoIP._id_by_addr pygeoip.GeoIP-class.html#_id_by_addr
pygeoip.GeoIP._get_record pygeoip.GeoIP-class.html#_get_record
pygeoip.GeoIP.org_by_addr pygeoip.GeoIP-class.html#org_by_addr
pygeoip.GeoIP.region_by_addr pygeoip.GeoIP-class.html#region_by_addr
pygeoip.GeoIP._gethostbyname pygeoip.GeoIP-class.html#_gethostbyname
pygeoip.GeoIP.record_by_addr pygeoip.GeoIP-class.html#record_by_addr
pygeoip.GeoIP._gethostbyname pygeoip.GeoIP-class.html#_gethostbyname
pygeoip.GeoIP.country_name_by_addr pygeoip.GeoIP-class.html#country_name_by_addr
pygeoip.GeoIP.org_by_name pygeoip.GeoIP-class.html#org_by_name
pygeoip.GeoIP.country_name_by_name pygeoip.GeoIP-class.html#country_name_by_name
pygeoip.GeoIPError pygeoip.GeoIPError-class.html
pygeoip._GeoIPMetaclass pygeoip._GeoIPMetaclass-class.html
pygeoip._GeoIPMetaclass._instances pygeoip._GeoIPMetaclass-class.html#_instances
pygeoip._GeoIPMetaclass.__call__ pygeoip._GeoIPMetaclass-class.html#__call__
pygeoip._GeoIPMetaclass._instance_lock pygeoip._GeoIPMetaclass-class.html#_instance_lock
......@@ -73,10 +73,14 @@
</li>
</ul>
</li>
<li> <strong class="uidlink">pygeoip._GeoIPBase</strong>
<ul>
<li> <strong class="uidlink"><a href="pygeoip.GeoIP-class.html">pygeoip.GeoIP</a></strong>
</li>
<li> <strong class="uidlink">type</strong>:
<em class="summary">type(object) -&gt; the object's type type(name, bases, dict) -&gt;
a new type</em>
<ul>
<li> <strong class="uidlink"><a href="pygeoip._GeoIPMetaclass-class.html" onclick="show_private();">pygeoip._GeoIPMetaclass</a></strong>
</li>
</ul>
</li>
</ul>
......@@ -113,7 +117,7 @@
<table border="0" cellpadding="0" cellspacing="0" width="100%%">
<tr>
<td align="left" class="footer">
Generated by Epydoc 3.0.1 on Tue Jul 16 01:07:04 2013
Generated by Epydoc 3.0.1 on Mon Jul 22 17:52:51 2013
</td>
<td align="right" class="footer">
<a target="mainFrame" href="http://epydoc.sourceforge.net"
......
......@@ -254,7 +254,7 @@ page was last updated. </p>
<table border="0" cellpadding="0" cellspacing="0" width="100%%">
<tr>
<td align="left" class="footer">
Generated by Epydoc 3.0.1 on Tue Jul 16 01:07:04 2013
Generated by Epydoc 3.0.1 on Mon Jul 22 17:52:51 2013
</td>
<td align="right" class="footer">
<a target="mainFrame" href="http://epydoc.sourceforge.net"
......
......@@ -214,19 +214,14 @@
<td valign="top">
<table class="link-index" width="100%" border="1">
<tr>
<td width="33%" class="link-index"><a href="pygeoip.GeoIP-class.html#id_by_addr">id_by_addr()</a><br />
<span class="index-where">(in&nbsp;<a href="pygeoip.GeoIP-class.html">GeoIP</a>)</span></td>
<td width="33%" class="link-index"><a href="pygeoip.const-module.html#IPV6_EDITIONS">IPV6_EDITIONS</a><br />
<span class="index-where">(in&nbsp;<a href="pygeoip.const-module.html">pygeoip.const</a>)</span></td>
<td width="33%" class="link-index">&nbsp;</td>
</tr>
<tr>
<td width="33%" class="link-index"><a href="pygeoip.util-module.html#ip2long">ip2long()</a><br />
<span class="index-where">(in&nbsp;<a href="pygeoip.util-module.html">pygeoip.util</a>)</span></td>
<td width="33%" class="link-index"><a href="pygeoip.const-module.html#IPV6_EDITIONS">IPV6_EDITIONS</a><br />
<span class="index-where">(in&nbsp;<a href="pygeoip.const-module.html">pygeoip.const</a>)</span></td>
<td width="33%" class="link-index"><a href="pygeoip.const-module.html#ISP_EDITION">ISP_EDITION</a><br />
<span class="index-where">(in&nbsp;<a href="pygeoip.const-module.html">pygeoip.const</a>)</span></td>
<td width="33%" class="link-index">&nbsp;</td>
</tr>
<tr><td class="link-index">&nbsp;</td><td class="link-index">&nbsp;</td><td class="link-index">&nbsp;</td></tr>
</table>
</td></tr>
<tr valign="top"><td valign="top" width="1%"><h2 class="epydoc"><a name="M">M</a></h2></td>
......@@ -402,20 +397,34 @@
<td valign="top">
<table class="link-index" width="100%" border="1">
<tr>
<td width="33%" class="link-index"><a href="pygeoip._GeoIPMetaclass-class.html#__call__">__call__()</a><br />
<span class="index-where">(in&nbsp;<a href="pygeoip._GeoIPMetaclass-class.html" onclick="show_private();">_GeoIPMetaclass</a>)</span></td>
<td width="33%" class="link-index"><a href="pygeoip.timezone-module.html#__package__">__package__</a><br />
<span class="index-where">(in&nbsp;<a href="pygeoip.timezone-module.html">pygeoip.timezone</a>)</span></td>
<td width="33%" class="link-index"><a href="pygeoip._GeoIPMetaclass-class.html#_instance_lock">_instance_lock</a><br />
<span class="index-where">(in&nbsp;<a href="pygeoip._GeoIPMetaclass-class.html" onclick="show_private();">_GeoIPMetaclass</a>)</span></td>
</tr>
<tr>
<td width="33%" class="link-index"><a href="pygeoip.GeoIP-class.html#__init__">__init__()</a><br />
<span class="index-where">(in&nbsp;<a href="pygeoip.GeoIP-class.html">GeoIP</a>)</span></td>
<td width="33%" class="link-index"><a href="pygeoip.const-module.html#__package__">__package__</a><br />
<span class="index-where">(in&nbsp;<a href="pygeoip.const-module.html">pygeoip.const</a>)</span></td>
<td width="33%" class="link-index"><a href="pygeoip.util-module.html#__package__">__package__</a><br />
<span class="index-where">(in&nbsp;<a href="pygeoip.util-module.html">pygeoip.util</a>)</span></td>
<td width="33%" class="link-index"><a href="pygeoip._GeoIPMetaclass-class.html#_instances">_instances</a><br />
<span class="index-where">(in&nbsp;<a href="pygeoip._GeoIPMetaclass-class.html" onclick="show_private();">_GeoIPMetaclass</a>)</span></td>
</tr>
<tr>
<td width="33%" class="link-index"><a href="pygeoip-module.html#__package__">__package__</a><br />
<span class="index-where">(in&nbsp;<a href="pygeoip-module.html">pygeoip</a>)</span></td>
<td width="33%" class="link-index"><a href="pygeoip.timezone-module.html#__package__">__package__</a><br />
<span class="index-where">(in&nbsp;<a href="pygeoip.timezone-module.html">pygeoip.timezone</a>)</span></td>
<td width="33%" class="link-index"><a href="pygeoip.timezone-module.html#_country">_country</a><br />
<span class="index-where">(in&nbsp;<a href="pygeoip.timezone-module.html">pygeoip.timezone</a>)</span></td>
<td width="33%" class="link-index">&nbsp;</td>
</tr>
<tr>
<td width="33%" class="link-index"><a href="pygeoip.const-module.html#__package__">__package__</a><br />
<span class="index-where">(in&nbsp;<a href="pygeoip.const-module.html">pygeoip.const</a>)</span></td>
<td width="33%" class="link-index"><a href="pygeoip._GeoIPMetaclass-class.html">_GeoIPMetaclass</a><br />
<span class="index-where">(in&nbsp;<a href="pygeoip-module.html">pygeoip</a>)</span></td>
<td width="33%" class="link-index">&nbsp;</td>
</tr>
</table>
</td></tr>
......@@ -451,7 +460,7 @@
<table border="0" cellpadding="0" cellspacing="0" width="100%%">
<tr>
<td align="left" class="footer">
Generated by Epydoc 3.0.1 on Tue Jul 16 01:07:04 2013
Generated by Epydoc 3.0.1 on Mon Jul 22 17:52:51 2013
</td>
<td align="right" class="footer">
<a target="mainFrame" href="http://epydoc.sourceforge.net"
......
......@@ -97,7 +97,7 @@
<table border="0" cellpadding="0" cellspacing="0" width="100%%">
<tr>
<td align="left" class="footer">
Generated by Epydoc 3.0.1 on Tue Jul 16 01:07:04 2013
Generated by Epydoc 3.0.1 on Mon Jul 22 17:52:51 2013
</td>
<td align="right" class="footer">
<a target="mainFrame" href="http://epydoc.sourceforge.net"
......
......@@ -196,7 +196,7 @@
<table border="0" cellpadding="0" cellspacing="0" width="100%%">
<tr>
<td align="left" class="footer">
Generated by Epydoc 3.0.1 on Tue Jul 16 01:07:04 2013
Generated by Epydoc 3.0.1 on Mon Jul 22 17:52:51 2013
</td>
<td align="right" class="footer">
<a target="mainFrame" href="http://epydoc.sourceforge.net"
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -60,14 +60,28 @@
<!-- ==================== CLASS DESCRIPTION ==================== -->
<h1 class="epydoc">Class GeoIP</h1><p class="nomargin-top"><span class="codelink"><a href="pygeoip-pysrc.html#GeoIP">source&nbsp;code</a></span></p>
<pre class="base-tree">
object --+
|
_GeoIPBase --+
|
<strong class="uidshort">GeoIP</strong>
object --+
|
<strong class="uidshort">GeoIP</strong>
</pre>
<hr />
<!-- ==================== NESTED CLASSES ==================== -->
<a name="section-NestedClasses"></a>
<table class="summary" border="1" cellpadding="3"
cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
<td align="left" colspan="2" class="table-header">
<span class="table-header">Nested Classes</span></td>
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type">&nbsp;</span>
</td><td class="summary">
<a href="pygeoip._GeoIPMetaclass-class.html" class="summary-name">__metaclass__</a>
</td>
</tr>
</table>
<!-- ==================== INSTANCE METHODS ==================== -->
<a name="section-InstanceMethods"></a>
<table class="summary" border="1" cellpadding="3"
......@@ -84,7 +98,8 @@ _GeoIPBase --+
<tr>
<td><span class="summary-sig"><a href="pygeoip.GeoIP-class.html#__init__" class="summary-sig-name">__init__</a>(<span class="summary-sig-arg">self</span>,
<span class="summary-sig-arg">filename</span>,
<span class="summary-sig-arg">flags</span>=<span class="summary-sig-default">0</span>)</span><br />
<span class="summary-sig-arg">flags</span>=<span class="summary-sig-default">0</span>,
<span class="summary-sig-arg">cache</span>=<span class="summary-sig-default">True</span>)</span><br />
Initialize the class.</td>
<td align="right" valign="top">
<span class="codelink"><a href="pygeoip-pysrc.html#GeoIP.__init__">source&nbsp;code</a></span>
......@@ -97,24 +112,6 @@ _GeoIPBase --+
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type">int</span>
</td><td class="summary">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td><span class="summary-sig"><a href="pygeoip.GeoIP-class.html#id_by_addr" class="summary-sig-name">id_by_addr</a>(<span class="summary-sig-arg">self</span>,
<span class="summary-sig-arg">addr</span>)</span><br />
Get the country index.</td>
<td align="right" valign="top">
<span class="codelink"><a href="pygeoip-pysrc.html#GeoIP.id_by_addr">source&nbsp;code</a></span>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type">str</span>
</td><td class="summary">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
......@@ -382,7 +379,8 @@ _GeoIPBase --+
<tr valign="top"><td>
<h3 class="epydoc"><span class="sig"><span class="sig-name">__init__</span>(<span class="sig-arg">self</span>,
<span class="sig-arg">filename</span>,
<span class="sig-arg">flags</span>=<span class="sig-default">0</span>)</span>
<span class="sig-arg">flags</span>=<span class="sig-default">0</span>,
<span class="sig-arg">cache</span>=<span class="sig-default">True</span>)</span>
<br /><em class="fname">(Constructor)</em>
</h3>
</td><td align="right" valign="top"
......@@ -399,6 +397,7 @@ _GeoIPBase --+
supported flags are STANDARD (the default), MEMORY_CACHE (preload
the whole file into memory) and MMAP_CACHE (access the file via
mmap).</li>
<li><strong class="pname"><code>cache</code></strong> (bool) - Used in tests to skip instance caching</li>
</ul></dd>
<dt>Overrides:
object.__init__
......@@ -406,33 +405,6 @@ _GeoIPBase --+
</dl>
</td></tr></table>
</div>
<a name="id_by_addr"></a>
<div>
<table class="details" border="1" cellpadding="3"
cellspacing="0" width="100%" bgcolor="white">
<tr><td>
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr valign="top"><td>
<h3 class="epydoc"><span class="sig"><span class="sig-name">id_by_addr</span>(<span class="sig-arg">self</span>,
<span class="sig-arg">addr</span>)</span>
</h3>
</td><td align="right" valign="top"
><span class="codelink"><a href="pygeoip-pysrc.html#GeoIP.id_by_addr">source&nbsp;code</a></span>&nbsp;
</td>
</tr></table>
<p>Get the country index. Looks up the index for the country which is the
key for the code and name.</p>
<dl class="fields">
<dt>Parameters:</dt>
<dd><ul class="nomargin-top">
<li><strong class="pname"><code>addr</code></strong> (str) - The IP address</li>
</ul></dd>
<dt>Returns: int</dt>
<dd>network byte order 32-bit integer</dd>
</dl>
</td></tr></table>
</div>
<a name="country_code_by_addr"></a>
<div>
<table class="details" border="1" cellpadding="3"
......@@ -793,7 +765,7 @@ _GeoIPBase --+
<table border="0" cellpadding="0" cellspacing="0" width="100%%">
<tr>
<td align="left" class="footer">
Generated by Epydoc 3.0.1 on Tue Jul 16 01:07:04 2013
Generated by Epydoc 3.0.1 on Mon Jul 22 17:52:51 2013
</td>
<td align="right" class="footer">
<a target="mainFrame" href="http://epydoc.sourceforge.net"
......
......@@ -157,7 +157,7 @@ exceptions.BaseException --+
<table border="0" cellpadding="0" cellspacing="0" width="100%%">
<tr>
<td align="left" class="footer">
Generated by Epydoc 3.0.1 on Tue Jul 16 01:07:04 2013
Generated by Epydoc 3.0.1 on Mon Jul 22 17:52:51 2013
</td>
<td align="right" class="footer">
<a target="mainFrame" href="http://epydoc.sourceforge.net"
......
<?xml version="1.0" encoding="ascii"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>pygeoip._GeoIPMetaclass</title>
<link rel="stylesheet" href="epydoc.css" type="text/css" />
<script type="text/javascript" src="epydoc.js"></script>
</head>
<body bgcolor="white" text="black" link="blue" vlink="#204080"
alink="#204080">
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
bgcolor="#a0c0ff" cellspacing="0">
<tr valign="middle">
<!-- Home link -->
<th>&nbsp;&nbsp;&nbsp;<a
href="pygeoip-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>
<!-- Tree link -->
<th>&nbsp;&nbsp;&nbsp;<a
href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>
<!-- Index link -->
<th>&nbsp;&nbsp;&nbsp;<a
href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>
<!-- Help link -->
<th>&nbsp;&nbsp;&nbsp;<a
href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>
<!-- Project homepage -->
<th class="navbar" align="right" width="100%">
<table border="0" cellpadding="0" cellspacing="0">
<tr><th class="navbar" align="center"
><a class="navbar" target="_top" href="https://github.com/appliedsec/pygeoip">pygeoip</a></th>
</tr></table></th>
</tr>
</table>
<table width="100%" cellpadding="0" cellspacing="0">
<tr valign="top">
<td width="100%">
<span class="breadcrumbs">
<a href="pygeoip-module.html">Package&nbsp;pygeoip</a> ::
Class&nbsp;_GeoIPMetaclass
</span>
</td>
<td>
<table cellpadding="0" cellspacing="0">
<!-- hide/show private -->
<tr><td align="right"><span class="options"
>[<a href="frames.html" target="_top">frames</a
>]&nbsp;|&nbsp;<a href="pygeoip._GeoIPMetaclass-class.html"
target="_top">no&nbsp;frames</a>]</span></td></tr>
</table>
</td>
</tr>
</table>
<!-- ==================== TYPE DESCRIPTION ==================== -->
<h1 class="epydoc">Type _GeoIPMetaclass</h1><p class="nomargin-top"><span class="codelink"><a href="pygeoip-pysrc.html#_GeoIPMetaclass">source&nbsp;code</a></span></p>
<pre class="base-tree">
object --+
|
type --+
|
<strong class="uidshort">_GeoIPMetaclass</strong>
</pre>
<hr />
<!-- ==================== INSTANCE METHODS ==================== -->
<a name="section-InstanceMethods"></a>
<table class="summary" border="1" cellpadding="3"
cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
<td align="left" colspan="2" class="table-header">
<span class="table-header">Instance Methods</span></td>
</tr>
<tr>
<td width="15%" align="right" valign="top" class="summary">
<span class="summary-type">&nbsp;</span>
</td><td class="summary">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td><span class="summary-sig"><a href="pygeoip._GeoIPMetaclass-class.html#__call__" class="summary-sig-name">__call__</a>(<span class="summary-sig-arg">cls</span>,
<span class="summary-sig-arg">*args</span>,
<span class="summary-sig-arg">**kwargs</span>)</span><br />
Singleton method to gets an instance without reparsing the database,
the filename is being used as cache key.</td>
<td align="right" valign="top">
<span class="codelink"><a href="pygeoip-pysrc.html#_GeoIPMetaclass.__call__">source&nbsp;code</a></span>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td colspan="2" class="summary">
<p class="indent-wrapped-lines"><b>Inherited from <code>type</code></b>:
<code>__delattr__</code>,
<code>__eq__</code>,
<code>__ge__</code>,
<code>__getattribute__</code>,
<code>__gt__</code>,
<code>__hash__</code>,
<code>__init__</code>,
<code>__instancecheck__</code>,
<code>__le__</code>,
<code>__lt__</code>,
<code>__ne__</code>,
<code>__new__</code>,
<code>__repr__</code>,
<code>__setattr__</code>,
<code>__subclasscheck__</code>,
<code>__subclasses__</code>,
<code>mro</code>
</p>
<p class="indent-wrapped-lines"><b>Inherited from <code>object</code></b>:
<code>__format__</code>,
<code>__reduce__</code>,
<code>__reduce_ex__</code>,
<code>__sizeof__</code>,
<code>__str__</code>,
<code>__subclasshook__</code>
</p>
</td>
</tr>
</table>
<!-- ==================== PROPERTIES ==================== -->
<a name="section-Properties"></a>
<table class="summary" border="1" cellpadding="3"
cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
<td align="left" colspan="2" class="table-header">
<span class="table-header">Properties</span></td>
</tr>
<tr>
<td colspan="2" class="summary">
<p class="indent-wrapped-lines"><b>Inherited from <code>type</code></b>:
<code>__abstractmethods__</code>,
<code>__base__</code>,
<code>__bases__</code>,
<code>__basicsize__</code>,
<code>__dictoffset__</code>,
<code>__flags__</code>,
<code>__itemsize__</code>,
<code>__mro__</code>,
<code>__name__</code>,
<code>__weakrefoffset__</code>
</p>
<p class="indent-wrapped-lines"><b>Inherited from <code>object</code></b>:
<code>__class__</code>
</p>
</td>
</tr>
</table>
<!-- ==================== METHOD DETAILS ==================== -->
<a name="section-MethodDetails"></a>
<table class="details" border="1" cellpadding="3"
cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
<td align="left" colspan="2" class="table-header">
<span class="table-header">Method Details</span></td>
</tr>
</table>
<a name="__call__"></a>
<div>
<table class="details" border="1" cellpadding="3"
cellspacing="0" width="100%" bgcolor="white">
<tr><td>
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr valign="top"><td>
<h3 class="epydoc"><span class="sig"><span class="sig-name">__call__</span>(<span class="sig-arg">cls</span>,
<span class="sig-arg">*args</span>,
<span class="sig-arg">**kwargs</span>)</span>
<br /><em class="fname">(Call operator)</em>
</h3>
</td><td align="right" valign="top"
><span class="codelink"><a href="pygeoip-pysrc.html#_GeoIPMetaclass.__call__">source&nbsp;code</a></span>&nbsp;
</td>
</tr></table>
<p>Singleton method to gets an instance without reparsing the database,
the filename is being used as cache key.</p>
<dl class="fields">
<dt>Overrides:
type.__call__
</dt>
</dl>
</td></tr></table>
</div>
<br />
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
bgcolor="#a0c0ff" cellspacing="0">
<tr valign="middle">
<!-- Home link -->
<th>&nbsp;&nbsp;&nbsp;<a
href="pygeoip-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>
<!-- Tree link -->
<th>&nbsp;&nbsp;&nbsp;<a
href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>
<!-- Index link -->
<th>&nbsp;&nbsp;&nbsp;<a
href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>
<!-- Help link -->
<th>&nbsp;&nbsp;&nbsp;<a
href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>
<!-- Project homepage -->
<th class="navbar" align="right" width="100%">
<table border="0" cellpadding="0" cellspacing="0">
<tr><th class="navbar" align="center"
><a class="navbar" target="_top" href="https://github.com/appliedsec/pygeoip">pygeoip</a></th>
</tr></table></th>
</tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="100%%">
<tr>
<td align="left" class="footer">
Generated by Epydoc 3.0.1 on Mon Jul 22 17:52:51 2013
</td>
<td align="right" class="footer">
<a target="mainFrame" href="http://epydoc.sourceforge.net"
>http://epydoc.sourceforge.net</a>
</td>
</tr>
</table>
<script type="text/javascript">
<!--
// Private objects are initially displayed (because if
// javascript is turned off then we want them to be
// visible); but by default, we want to hide them. So hide
// them unless we have a cookie that says to show them.
checkCookie();
// -->
</script>
</body>
</html>
......@@ -622,7 +622,7 @@
<table border="0" cellpadding="0" cellspacing="0" width="100%%">
<tr>
<td align="left" class="footer">
Generated by Epydoc 3.0.1 on Tue Jul 16 01:07:04 2013
Generated by Epydoc 3.0.1 on Mon Jul 22 17:52:51 2013
</td>
<td align="right" class="footer">
<a target="mainFrame" href="http://epydoc.sourceforge.net"
......
......@@ -532,7 +532,7 @@ expandto(location.href);
<table border="0" cellpadding="0" cellspacing="0" width="100%%">
<tr>
<td align="left" class="footer">
Generated by Epydoc 3.0.1 on Tue Jul 16 01:07:04 2013
Generated by Epydoc 3.0.1 on Mon Jul 22 17:52:51 2013
</td>
<td align="right" class="footer">
<a target="mainFrame" href="http://epydoc.sourceforge.net"
......
......@@ -136,7 +136,7 @@
<table border="0" cellpadding="0" cellspacing="0" width="100%%">
<tr>
<td align="left" class="footer">
Generated by Epydoc 3.0.1 on Tue Jul 16 01:07:04 2013
Generated by Epydoc 3.0.1 on Mon Jul 22 17:52:51 2013
</td>
<td align="right" class="footer">
<a target="mainFrame" href="http://epydoc.sourceforge.net"
......
......@@ -801,25 +801,22 @@
<a name="L740"></a><tt class="py-lineno">740</tt> <tt class="py-line"> <tt class="py-string">'ZA'</tt><tt class="py-op">:</tt> <tt class="py-string">'Africa/Johannesburg'</tt><tt class="py-op">,</tt> </tt>
<a name="L741"></a><tt class="py-lineno">741</tt> <tt class="py-line"> <tt class="py-string">'ZM'</tt><tt class="py-op">:</tt> <tt class="py-string">'Africa/Lusaka'</tt><tt class="py-op">,</tt> </tt>
<a name="L742"></a><tt class="py-lineno">742</tt> <tt class="py-line"> <tt class="py-string">'ZW'</tt><tt class="py-op">:</tt> <tt class="py-string">'Africa/Harare'</tt> </tt>
<a name="L743"></a><tt class="py-lineno">743</tt> <tt class="py-line"> <tt class="py-op">}</tt> </tt>
<a name="L743"></a><tt class="py-lineno">743</tt> <tt class="py-line"><tt class="py-op">}</tt> </tt>
<a name="L744"></a><tt class="py-lineno">744</tt> <tt class="py-line"> </tt>
<a name="L745"></a><tt class="py-lineno">745</tt> <tt class="py-line"> </tt>
<a name="time_zone_by_country_and_region"></a><div id="time_zone_by_country_and_region-def"><a name="L746"></a><tt class="py-lineno">746</tt> <a class="py-toggle" href="#" id="time_zone_by_country_and_region-toggle" onclick="return toggle('time_zone_by_country_and_region');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="pygeoip.timezone-module.html#time_zone_by_country_and_region">time_zone_by_country_and_region</a><tt class="py-op">(</tt><tt class="py-param">country_code</tt><tt class="py-op">,</tt> <tt class="py-param">region_name</tt><tt class="py-op">=</tt><tt class="py-name">None</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="time_zone_by_country_and_region-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="time_zone_by_country_and_region-expanded"><a name="L747"></a><tt class="py-lineno">747</tt> <tt class="py-line"> <tt class="py-keyword">if</tt> <tt class="py-name">country_code</tt> <tt class="py-keyword">not</tt> <tt class="py-keyword">in</tt> <tt id="link-1" class="py-name"><a title="pygeoip.timezone._country" class="py-name" href="#" onclick="return doclink('link-1', '_country', 'link-0');">_country</a></tt><tt class="py-op">:</tt> </tt>
<a name="L748"></a><tt class="py-lineno">748</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt class="py-string">''</tt> </tt>
<a name="L749"></a><tt class="py-lineno">749</tt> <tt class="py-line"> </tt>
<a name="L750"></a><tt class="py-lineno">750</tt> <tt class="py-line"> <tt class="py-keyword">if</tt> <tt class="py-keyword">not</tt> <tt class="py-name">region_name</tt> <tt class="py-keyword">or</tt> <tt class="py-name">region_name</tt> <tt class="py-op">==</tt> <tt class="py-string">'00'</tt><tt class="py-op">:</tt> </tt>
<a name="L751"></a><tt class="py-lineno">751</tt> <tt class="py-line"> <tt class="py-name">region_name</tt> <tt class="py-op">=</tt> <tt class="py-name">None</tt> </tt>
<a name="L752"></a><tt class="py-lineno">752</tt> <tt class="py-line"> </tt>
<a name="L753"></a><tt class="py-lineno">753</tt> <tt class="py-line"> <tt class="py-name">timezones</tt> <tt class="py-op">=</tt> <tt id="link-2" class="py-name"><a title="pygeoip.timezone._country" class="py-name" href="#" onclick="return doclink('link-2', '_country', 'link-0');">_country</a></tt><tt class="py-op">[</tt><tt class="py-name">country_code</tt><tt class="py-op">]</tt> </tt>
<a name="L754"></a><tt class="py-lineno">754</tt> <tt class="py-line"> <tt class="py-keyword">if</tt> <tt class="py-name">isinstance</tt><tt class="py-op">(</tt><tt class="py-name">timezones</tt><tt class="py-op">,</tt> <tt class="py-name">str</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<a name="L755"></a><tt class="py-lineno">755</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt class="py-name">timezones</tt> </tt>
</div><div id="time_zone_by_country_and_region-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="time_zone_by_country_and_region-expanded"><a name="L747"></a><tt class="py-lineno">747</tt> <tt class="py-line"> <tt class="py-name">timezones</tt> <tt class="py-op">=</tt> <tt id="link-1" class="py-name"><a title="pygeoip.timezone._country" class="py-name" href="#" onclick="return doclink('link-1', '_country', 'link-0');">_country</a></tt><tt class="py-op">.</tt><tt class="py-name">get</tt><tt class="py-op">(</tt><tt class="py-name">country_code</tt><tt class="py-op">)</tt> </tt>
<a name="L748"></a><tt class="py-lineno">748</tt> <tt class="py-line"> <tt class="py-keyword">if</tt> <tt class="py-keyword">not</tt> <tt class="py-name">timezones</tt><tt class="py-op">:</tt> </tt>
<a name="L749"></a><tt class="py-lineno">749</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt class="py-name">None</tt> </tt>
<a name="L750"></a><tt class="py-lineno">750</tt> <tt class="py-line"> </tt>
<a name="L751"></a><tt class="py-lineno">751</tt> <tt class="py-line"> <tt class="py-keyword">if</tt> <tt class="py-name">isinstance</tt><tt class="py-op">(</tt><tt class="py-name">timezones</tt><tt class="py-op">,</tt> <tt class="py-name">str</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<a name="L752"></a><tt class="py-lineno">752</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt class="py-name">timezones</tt> </tt>
<a name="L753"></a><tt class="py-lineno">753</tt> <tt class="py-line"> </tt>
<a name="L754"></a><tt class="py-lineno">754</tt> <tt class="py-line"> <tt class="py-keyword">if</tt> <tt class="py-keyword">not</tt> <tt class="py-name">region_name</tt><tt class="py-op">:</tt> </tt>
<a name="L755"></a><tt class="py-lineno">755</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt class="py-name">None</tt> </tt>
<a name="L756"></a><tt class="py-lineno">756</tt> <tt class="py-line"> </tt>
<a name="L757"></a><tt class="py-lineno">757</tt> <tt class="py-line"> <tt class="py-keyword">if</tt> <tt class="py-keyword">not</tt> <tt class="py-name">region_name</tt><tt class="py-op">:</tt> </tt>
<a name="L758"></a><tt class="py-lineno">758</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt class="py-string">''</tt> </tt>
<a name="L759"></a><tt class="py-lineno">759</tt> <tt class="py-line"> </tt>
<a name="L760"></a><tt class="py-lineno">760</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt class="py-name">timezones</tt><tt class="py-op">.</tt><tt class="py-name">get</tt><tt class="py-op">(</tt><tt class="py-name">region_name</tt><tt class="py-op">)</tt> </tt>
</div><a name="L761"></a><tt class="py-lineno">761</tt> <tt class="py-line"> </tt><script type="text/javascript">
<a name="L757"></a><tt class="py-lineno">757</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt class="py-name">timezones</tt><tt class="py-op">.</tt><tt class="py-name">get</tt><tt class="py-op">(</tt><tt class="py-name">region_name</tt><tt class="py-op">)</tt> </tt>
</div><a name="L758"></a><tt class="py-lineno">758</tt> <tt class="py-line"> </tt><script type="text/javascript">
<!--
expandto(location.href);
// -->
......@@ -857,7 +854,7 @@ expandto(location.href);
<table border="0" cellpadding="0" cellspacing="0" width="100%%">
<tr>
<td align="left" class="footer">
Generated by Epydoc 3.0.1 on Tue Jul 16 01:07:04 2013
Generated by Epydoc 3.0.1 on Mon Jul 22 17:52:52 2013
</td>
<td align="right" class="footer">
<a target="mainFrame" href="http://epydoc.sourceforge.net"
......
......@@ -185,7 +185,7 @@
<table border="0" cellpadding="0" cellspacing="0" width="100%%">
<tr>
<td align="left" class="footer">
Generated by Epydoc 3.0.1 on Tue Jul 16 01:07:04 2013
Generated by Epydoc 3.0.1 on Mon Jul 22 17:52:51 2013
</td>
<td align="right" class="footer">
<a target="mainFrame" href="http://epydoc.sourceforge.net"
......
......@@ -133,7 +133,7 @@ expandto(location.href);
<table border="0" cellpadding="0" cellspacing="0" width="100%%">
<tr>
<td align="left" class="footer">
Generated by Epydoc 3.0.1 on Tue Jul 16 01:07:04 2013
Generated by Epydoc 3.0.1 on Mon Jul 22 17:52:52 2013
</td>
<td align="right" class="footer">
<a target="mainFrame" href="http://epydoc.sourceforge.net"
......
......@@ -7,7 +7,7 @@
<body>
<script type="text/javascript">
<!--
var pages = ["pygeoip.GeoIPError-c", "pygeoip.timezone-m", "pygeoip.const-m", "pygeoip.GeoIP-c", "pygeoip.util-m", "pygeoip-m"];
var pages = ["pygeoip._GeoIPMetaclass-c", "pygeoip.GeoIPError-c", "pygeoip.timezone-m", "pygeoip.const-m", "pygeoip.GeoIP-c", "pygeoip.util-m", "pygeoip-m"];
var dottedName = get_anchor();
if (dottedName) {
var target = redirect_url(dottedName);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment