[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [stem/master] Deprecate the is_geoip_unavailable method



commit d0fb9fd91d127e2a80f7535f2887d5f6d67d69b2
Author: Damian Johnson <atagar@xxxxxxxxxxxxxx>
Date:   Sat Sep 9 14:31:53 2017 -0700

    Deprecate the is_geoip_unavailable method
    
    This is now available via GETINFO instead. Our Controller's method will be
    removed in 2.x...
    
      https://trac.torproject.org/projects/tor/ticket/23237
      https://gitweb.torproject.org/torspec.git/commit/?id=dc973f8
---
 docs/change_log.rst | 1 +
 stem/control.py     | 7 ++++---
 stem/version.py     | 2 ++
 3 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/docs/change_log.rst b/docs/change_log.rst
index 5a581ff3..40764efb 100644
--- a/docs/change_log.rst
+++ b/docs/change_log.rst
@@ -55,6 +55,7 @@ The following are only available within Stem's `git repository
   * Tor change caused :func:`~stem.control.Controller.list_ephemeral_hidden_services` to provide empty strings if unset (:trac:`21329`)
   * Better error message when :func:`~stem.control.Controller.set_conf` fails due to an option being immutable
   * :func:`~stem.control.Controller.is_geoip_unavailable` now determines if database is available right away
+  * Deprecated :func:`~stem.control.Controller.is_geoip_unavailable`, this is now available via getinfo instead (:trac:`23237`, :spec:`dc973f8`)
   * Caching manual information as sqlite rather than stem.util.conf, making :func:`stem.manual.Manual.from_cache` about ~8x faster
   * Added :func:`~stem.manual.database` to get a cursor for the manual cache
   * Failed to parse torrcs without a port on ipv6 exit policy entries
diff --git a/stem/control.py b/stem/control.py
index 048d9e90..53e8f9b3 100644
--- a/stem/control.py
+++ b/stem/control.py
@@ -3647,10 +3647,11 @@ class Controller(BaseController):
        No longer requires previously failed GETINFO requests to determine this.
 
     .. deprecated:: 1.6.0
-       If this becomes available in tor we'll be deprecating this in our 2.x
-       release (:trac:`23237`). If not this will be renamed to
-       is_geoip_available.
+       This is available as of Tor 0.3.2.1 through the following instead...
 
+       ::
+
+         controller.get_info('ip-to-country/ipv4-available', 0) == '1'
 
     :returns: **bool** indicating if we've determined tor's geoip database to
       be unavailable or not
diff --git a/stem/version.py b/stem/version.py
index 7c347d56..4f0ffb9c 100644
--- a/stem/version.py
+++ b/stem/version.py
@@ -60,6 +60,7 @@ easily parsed and compared, for instance...
   **FEATURE_EXTENDED_EVENTS**           'EXTENDED_EVENTS' optional feature
   **FEATURE_VERBOSE_NAMES**             'VERBOSE_NAMES' optional feature
   **GETINFO_CONFIG_TEXT**               'GETINFO config-text' query
+  **GETINFO_GEOIP_AVAILABLE**           'GETINFO ip-to-country/ipv4-available' query and its ipv6 counterpart
   **HSFETCH**                           HSFETCH requests
   **HSPOST**                            HSPOST requests
   **ADD_ONION**                         ADD_ONION and DEL_ONION requests
@@ -370,6 +371,7 @@ Requirement = stem.util.enum.Enum(
   ('FEATURE_EXTENDED_EVENTS', Version('0.2.2.1-alpha')),
   ('FEATURE_VERBOSE_NAMES', Version('0.2.2.1-alpha')),
   ('GETINFO_CONFIG_TEXT', Version('0.2.2.7-alpha')),
+  ('GETINFO_GEOIP_AVAILABLE', Version('0.3.2.1-alpha')),
   ('HSFETCH', Version('0.2.7.1-alpha')),
   ('HSPOST', Version('0.2.7.1-alpha')),
   ('ADD_ONION', Version('0.2.7.1-alpha')),

_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits