Dreamstime

Wednesday 9 September 2015

Customizing Google API Python Client Version 1.2 For Python 2.4

I extended RavenPlus to support Google OAuth2 authentication for Blogger/Blogspot with the help of the Google API Client Library for Python version 1.2. Out of the box, this library does not support Python version 2.4, the version in which RavenPlus (and Raven) was built. Below are the modifications, in RED, that I have made to this library to get it working with version 2.4 of Python.

Do take note that I did not use the following modules in this library in RavenPlus - thus I am not sure if they will choke when running under Python version 2.4:

  • apiclient\sample_tools.py
  • apiclient\channel.py
  • oauth2client\appengine.py
  • oauth2client\django_orm.py
  • oauth2client\gce.py
  • oauth2client\keyring_storage.py
  • oauth2client\locked_file.py
  • oauth2client\multistore_file.py
  • oauth2client\xsrfutil.py

oauth2client\client.py

At line 226:

#
# ChuahTC Date: 6-6-2015 - Fix for Python 2.4.
# From: https://code.google.com/p/paver/issues/detail?id=28
# m = __import__(module, fromlist=module.split('.')[:-1])
m = __import__(module, globals(), locals(), module.split('.')[:-1])
#

apiclient\discovery.py

At line 31:

#
# Chuah TC 30-5-2015
# from email.mime.multipart import MIMEMultipart
# from email.mime.nonmultipart import MIMENonMultipart
#
from email.MIMEMultipart import MIMEMultipart
from email.MIMENonMultipart import MIMENonMultipart
#

apiclient\http.py

At line 40:

# Chuah TC 30-5-2015
# from email.generator import Generator
# from email.mime.multipart import MIMEMultipart
# from email.mime.nonmultipart import MIMENonMultipart
# from email.parser import FeedParser
#
from email.Generator import Generator
from email.MIMEMultipart import MIMEMultipart
from email.MIMENonMultipart import MIMENonMultipart
from email.Parser import FeedParser
#

6 comments:

  1. Hi T.C.!
    Do you have any new about Picasa?

    ReplyDelete
  2. I am still working on it. I need to take a break looking at computer code. My brain has gone numb.

    ReplyDelete
  3. Hello T.C.!

    Do you have any new about Picasa problem?

    Thanks!

    ReplyDelete
    Replies
    1. It is coming along nicely. My plan to modify GData Photo (the portion of GData that talks to Picasa) is working out as planned.

      What I do not have much of is free time to work on it. So please be patient.

      Delete
    2. For future queries on my work on Picasa uploads from Raven+, can you please post your comments here (which is more appropriate):

      http://chuahtc.blogspot.com/2015/10/a-brief-update-on-picasa-and-ravenplus.html

      Thank you.

      Delete