Beispiel #1
0
 def __init__(self, request):
     socialuser = UserSocialAuth.objects.get(user=request.user)
     access_token=socialuser.extra_data['access_token']
     self.consumer_key = util.getEntry('google_oauth', 'CONSUMER_KEY')
     self.consumer_secret = util.getEntry('google_oauth', 'CONSUMER_SECRET')
     self.signature_method = gdata.auth.OAuthSignatureMethod.HMAC_SHA1
     self.token = self.GetOAuthToken(access_token)
     self.clientDB = DatabaseClient()
     self.autenticaClientService(self.clientDB._GetSpreadsheetsClient())
     self.autenticaClientService(self.clientDB._GetDocsClient())
Beispiel #2
0
#  This Source Code Form is subject to the terms of the Mozilla Public
#  License, v. 2.0. If a copy of the MPL was not distributed with this
#  file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
#  Copyright (c) 2012-2013, Dennis Sun <*****@*****.**>

from ohms.config import PATH_TO_GDATA, GMAIL_EMAIL, GMAIL_PW
import sys
sys.path.insert(0, PATH_TO_GDATA)
from gdata.spreadsheet.text_db import DatabaseClient

client = DatabaseClient(GMAIL_EMAIL, GMAIL_PW)