From 1f07baaa416f0bd6d7aa4f374c7965f571257f46 Mon Sep 17 00:00:00 2001 From: Jonas Geduldig Date: Tue, 25 Jun 2013 21:43:05 -0400 Subject: [PATCH] Fixed printing --- CHANGES.txt | 2 ++ MANIFEST | 2 ++ TwitterGeoPics/GetNewGeo.py | 11 +++++++++++ TwitterGeoPics/GetNewPics.py | 11 +++++++++++ TwitterGeoPics/GetOldGeo.py | 11 +++++++++++ TwitterGeoPics/GetOldPics.py | 11 +++++++++++ TwitterGeoPics/__init__.py | 2 +- setup.py | 2 +- 8 files changed, 50 insertions(+), 2 deletions(-) diff --git a/CHANGES.txt b/CHANGES.txt index d03f579..6d7c116 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -15,3 +15,5 @@ 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. diff --git a/MANIFEST b/MANIFEST index ad4a897..a1ea86a 100644 --- a/MANIFEST +++ b/MANIFEST @@ -7,3 +7,5 @@ TwitterGeoPics/GetNewPics.py TwitterGeoPics/GetOldGeo.py TwitterGeoPics/GetOldPics.py TwitterGeoPics/__init__.py +TwitterGeoPics/pygeocoder.py +TwitterGeoPics/pygeolib.py diff --git a/TwitterGeoPics/GetNewGeo.py b/TwitterGeoPics/GetNewGeo.py index 79a7914..0cd275f 100644 --- a/TwitterGeoPics/GetNewGeo.py +++ b/TwitterGeoPics/GetNewGeo.py @@ -3,11 +3,22 @@ __license__ = "MIT" import argparse +import codecs from Geocoder import Geocoder import sys from TwitterAPI import TwitterAPI, TwitterOAuth +try: + # python 3 + sys.stdout = codecs.getwriter('utf8')(sys.stdout.buffer) + sys.stderr = codecs.getwriter('utf8')(sys.stderr.buffer) +except: + # python 2 + sys.stdout = codecs.getwriter('utf8')(sys.stdout) + sys.stderr = codecs.getwriter('utf8')(sys.stderr) + + GEO = Geocoder() diff --git a/TwitterGeoPics/GetNewPics.py b/TwitterGeoPics/GetNewPics.py index a5641b3..a7a3f22 100644 --- a/TwitterGeoPics/GetNewPics.py +++ b/TwitterGeoPics/GetNewPics.py @@ -3,6 +3,7 @@ __license__ = "MIT" import argparse +import codecs from Geocoder import Geocoder import os import sys @@ -10,6 +11,16 @@ import urllib +try: + # python 3 + sys.stdout = codecs.getwriter('utf8')(sys.stdout.buffer) + sys.stderr = codecs.getwriter('utf8')(sys.stderr.buffer) +except: + # python 2 + sys.stdout = codecs.getwriter('utf8')(sys.stdout) + sys.stderr = codecs.getwriter('utf8')(sys.stderr) + + GEO = Geocoder() diff --git a/TwitterGeoPics/GetOldGeo.py b/TwitterGeoPics/GetOldGeo.py index c66bd45..4ee0619 100644 --- a/TwitterGeoPics/GetOldGeo.py +++ b/TwitterGeoPics/GetOldGeo.py @@ -3,11 +3,22 @@ __license__ = "MIT" import argparse +import codecs from Geocoder import Geocoder import sys from TwitterAPI import TwitterAPI, TwitterOAuth, TwitterRestPager +try: + # python 3 + sys.stdout = codecs.getwriter('utf8')(sys.stdout.buffer) + sys.stderr = codecs.getwriter('utf8')(sys.stderr.buffer) +except: + # python 2 + sys.stdout = codecs.getwriter('utf8')(sys.stdout) + sys.stderr = codecs.getwriter('utf8')(sys.stderr) + + GEO = Geocoder() diff --git a/TwitterGeoPics/GetOldPics.py b/TwitterGeoPics/GetOldPics.py index 7ee05ca..2f9f9dd 100644 --- a/TwitterGeoPics/GetOldPics.py +++ b/TwitterGeoPics/GetOldPics.py @@ -3,6 +3,7 @@ __license__ = "MIT" import argparse +import codecs from Geocoder import Geocoder import os import sys @@ -10,6 +11,16 @@ import urllib +try: + # python 3 + sys.stdout = codecs.getwriter('utf8')(sys.stdout.buffer) + sys.stderr = codecs.getwriter('utf8')(sys.stderr.buffer) +except: + # python 2 + sys.stdout = codecs.getwriter('utf8')(sys.stdout) + sys.stderr = codecs.getwriter('utf8')(sys.stderr) + + GEO = Geocoder() diff --git a/TwitterGeoPics/__init__.py b/TwitterGeoPics/__init__.py index 0628d0e..7df2784 100644 --- a/TwitterGeoPics/__init__.py +++ b/TwitterGeoPics/__init__.py @@ -1,5 +1,5 @@ __title__ = 'TwitterGeoPics' -__version__ = '2.0.1' +__version__ = '2.0.3' __author__ = 'Jonas Geduldig' __license__ = 'MIT' __copyright__ = 'Copyright 2013 Jonas Geduldig' diff --git a/setup.py b/setup.py index 09bc825..3f20ac4 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ setup( name='TwitterGeoPics', - version='2.0.2', + version='2.0.3', author='Jonas Geduldig', author_email='boxnumber03@gmail.com', packages=['TwitterGeoPics'],