1. Doug Latornell
  2. randopony-tetra

Commits

Doug Latornell  committed b43510a

Change google_docs to google_drive.

  • Participants
  • Parent commits 2fe3ca7
  • Branches default

Comments (0)

Files changed (7)

File development.ini

View file
     127.0.0.1
     192.168.211.10
 
-# google_docs.username: Set in randopony/private_credentials.py
-# google_docs.password: Set in randopony/private_credentials.py
+# google_drive.username: Set in randopony/private_credentials.py
+# google_drive.password: Set in randopony/private_credentials.py
 
 # Use python -m smtpd -n -c DebuggingServer localhost:1025
 mail.queue_path = /tmp/randopony/mail

File randopony/__init__.py

View file
 from sqlalchemy.orm.exc import NoResultFound
 from .credentials import (
     persona_secret,
-    google_docs_username,
-    google_docs_password,
+    google_drive_username,
+    google_drive_password,
     email_host_username,
     email_host_password,
     )
     """
     settings.update({
         'persona.secret': persona_secret,
-        'google_docs.username': google_docs_username,
-        'google_docs.password': google_docs_password,
+        'google_drive.username': google_drive_username,
+        'google_drive.password': google_drive_password,
         'mail.username': email_host_username,
         'mail.password': email_host_password,
         })

File randopony/credentials.py

View file
 
 persona_secret = None
 
-google_docs_username = None
-google_docs_password = None
+google_drive_username = None
+google_drive_password = None
 
 email_host_username = None
 email_host_password = None
 try:
     from .private_credentials import (
         persona_secret,
-        google_docs_username,
-        google_docs_password,
+        google_drive_username,
+        google_drive_password,
         email_host_username,
         email_host_password,
         )

File randopony/tests/test_site.py

View file
         self.config = testing.setUp(
             settings={
                 'mako.directories': 'randopony:templates',
-                'google_docs.username': 'randopony',
-                'google_docs.password': 'sEcReT',
+                'google_drive.username': 'randopony',
+                'google_drive.password': 'sEcReT',
             })
         self.config.include('pyramid_mailer.testing')
         self.config.add_route('populaire', '/populaires/{short_name}')

File randopony/views/admin/core.py

View file
         return tmpl_vars
 
 
-def google_docs_login(service, username, password):
+def google_drive_login(service, username, password):
     client = service()
     client.ssl = True
     client.ClientLogin(username, password, 'randopony')

File randopony/views/admin/populaire.py

View file
 from pyramid.view import view_config
 import transaction
 from .core import (
-    google_docs_login,
+    google_drive_login,
     get_rider_list_template,
     share_rider_list_publicly,
     )
         request.session.flash('error')
         request.session.flash('Rider list spreadsheet already created')
         return HTTPFound(redirect_url)
-    client = google_docs_login(
+    client = google_drive_login(
         DocsClient,
-        request.registry.settings['google_docs.username'],
-        request.registry.settings['google_docs.password'])
+        request.registry.settings['google_drive.username'],
+        request.registry.settings['google_drive.password'])
     template = get_rider_list_template('Populaire Rider List Template', client)
     created_doc = client.copy_resource(template, str(populaire))
     share_rider_list_publicly(created_doc, client)

File randopony/views/site/populaire.py

View file
 import pytz
 import transaction
 from .core import SiteViews
-from ..admin.core import google_docs_login
+from ..admin.core import google_drive_login
 from ...models import (
     Brevet,
     EmailAddress,
                 update_google_spreadsheet.delay(
                     [rider for rider in populaire.riders],
                     populaire.google_doc_id.split(':')[1],
-                    self.request.registry.settings['google_docs.username'],
-                    self.request.registry.settings['google_docs.password'])
+                    self.request.registry.settings['google_drive.username'],
+                    self.request.registry.settings['google_drive.password'])
                 message = self._rider_message(populaire, rider)
                 mailer.send_to_queue(message)
                 message = self._organizer_message(populaire, rider)
 
 @task(ignore_result=True)
 def update_google_spreadsheet(riders, doc_key, username, password):
-    client = google_docs_login(SpreadsheetsService, username, password)
+    client = google_drive_login(SpreadsheetsService, username, password)
     spreadsheet_list = client.GetListFeed(doc_key)
     spreadsheet_rows = len(spreadsheet_list.entry)
     # Update the rows already in the spreadsheet