Skip to content

Commit

Permalink
Changed print_stats to return string
Browse files Browse the repository at this point in the history
  • Loading branch information
geduldig committed Jun 3, 2016
1 parent dbabb19 commit e574395
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 17 deletions.
14 changes: 1 addition & 13 deletions CHANGES.txt
Original file line number Diff line number Diff line change
@@ -1,29 +1,17 @@
v0.1.0, 01 Jan 2013 -- Initial release.

v0.1.1, 08 Jan 2013 -- Added cache for Google geocoder

v0.1.2, 20 Jan 2013 -- Improved exception handling for less fragile connections to twitter.com.
Streaming 'location' option now uses the API's 'locations' parameter.
Dynamic throttling of Google geocode requests to not exceed rate limit.

v1.0.0, 30 Jan 2013 -- Uploaded to github.

v1.1.0, 12 Feb 2013 -- Replaced TwitterAPI with puttytat for Twitter requests.

v1.1.1, 19 Feb 2013 -- Geocoder uses viewport instead of bounds.

v2.0.1, 14 Jun 2013 -- Switch to TwitterAPI and renamed to TwitterGeoPics.

v2.0.2, 14 Jun 2013 -- Included pygeocoder source until fixed for python 3.

v2.0.3, 25 Jun 2013 -- Fixed printing.

v2.1.0, 17 Sep 2013 -- Requires TwitterAPI 3.

v2.1.1, 11 Oct 2013 -- Prints GEOCODE with place and lat,lng.

v2.2.0, 15 Oct 2013 -- Combined scripts.

v2.2.1, 27 Dec 2013 -- Added pygeocoder to setup.py.

v2.2.3, 27 Oct 2015 -- Added tzwhere to setup.py.
v2.2.4, 03 Jun 2016 -- Changed print_stats to return string.
9 changes: 6 additions & 3 deletions TwitterGeoPics/Geocoder.py
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ def print_stats(self):
stats = \
('\n--STATS--\n'
'geo requests: %s\n'
'geo requets ok: %s\n'
'geo requests ok: %s\n'
'geo quota exceeded: %s\n'
'geo throttle: %s\n'
'has none: %s\n'
Expand All @@ -269,7 +269,7 @@ def print_stats(self):
(self.count_request, self.count_request_ok, self.quota_exceeded_at, self.throttle,
self.count_nowhere, self.count_has_geocode, self.count_has_location)

sys.stdout.write(stats)
# sys.stdout.write(stats)

if self.cache:
counts = [ 0, 0, 0 ]
Expand All @@ -289,4 +289,7 @@ def print_stats(self):
'size: %s\n'
'counts: %s\n'
'max place: %s\n') % (len(self.cache), counts, max_place)
sys.stdout.write(cache)
# sys.stdout.write(cache)
stats = stats + cache

return stats
2 changes: 1 addition & 1 deletion TwitterGeoPics/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
__title__ = 'TwitterGeoPics'
__version__ = '2.2.3'
__version__ = '2.2.4'
__author__ = 'Jonas Geduldig'
__license__ = 'MIT'
__copyright__ = 'Copyright 2013 Jonas Geduldig'

0 comments on commit e574395

Please sign in to comment.