Skip to content

Commit 12a171a

Browse files
committed
Python 3 linting fixes
1 parent cff060c commit 12a171a

3 files changed

Lines changed: 12 additions & 8 deletions

File tree

.pylintrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -424,3 +424,6 @@ max-public-methods=50
424424
# Exceptions that will emit a warning when being caught. Defaults to
425425
# "Exception"
426426
overgeneral-exceptions=Exception
427+
428+
# Python 2/3 compatibility
429+
disable=useless-object-inheritance

drive/driveapp/main.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
This script uploads a single file to Google Drive.
66
"""
77

8+
from __future__ import print_function
89
import pprint
910
import httplib2
1011
import apiclient.discovery
@@ -30,7 +31,7 @@
3031
flow = oauth2client.client.flow_from_clientsecrets(CLIENT_SECRETS, OAUTH2_SCOPE)
3132
flow.redirect_uri = oauth2client.client.OOB_CALLBACK_URN
3233
authorize_url = flow.step1_get_authorize_url()
33-
print 'Go to the following link in your browser: ' + authorize_url
34+
print('Go to the following link in your browser: ' + authorize_url)
3435
code = raw_input('Enter verification code: ').strip()
3536
credentials = flow.step2_exchange(code)
3637

slides/snippets/test_snippets.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -97,13 +97,13 @@ def test_image_merging(self):
9797
SnippetsTest.CUSTOMER_NAME)
9898
presentation_id = response.get('presentationId')
9999
self.assertIsNotNone(presentation_id, msg=pformat(response))
100-
self.assertEquals(2, len(response.get('replies')),
100+
self.assertEqual(2, len(response.get('replies')),
101101
msg=pformat(response))
102102
num_replacements = 0
103103
for reply in response.get('replies'):
104104
num_replacements += reply.get('replaceAllShapesWithImage') \
105105
.get('occurrencesChanged')
106-
self.assertEquals(2, num_replacements)
106+
self.assertEqual(2, num_replacements)
107107
self.delete_file_on_cleanup(presentation_id)
108108

109109
def test_simple_text_replace(self):
@@ -112,31 +112,31 @@ def test_simple_text_replace(self):
112112
box_id = self.create_test_textbox(presentation_id, page_id)
113113
response = self.snippets.simple_text_replace(
114114
presentation_id, box_id, 'MY NEW TEXT')
115-
self.assertEquals(2, len(response.get('replies')),
115+
self.assertEqual(2, len(response.get('replies')),
116116
msg=pformat(response))
117117

118118
def test_text_style_update(self):
119119
presentation_id = self.create_test_presentation()
120120
page_id = self.add_slides(presentation_id, 1, 'BLANK')[0]
121121
box_id = self.create_test_textbox(presentation_id, page_id)
122122
response = self.snippets.text_style_update(presentation_id, box_id)
123-
self.assertEquals(3, len(response.get('replies')),
123+
self.assertEqual(3, len(response.get('replies')),
124124
msg=pformat(response))
125125

126126
def test_create_bulleted_text(self):
127127
presentation_id = self.create_test_presentation()
128128
page_id = self.add_slides(presentation_id, 1, 'BLANK')[0]
129129
box_id = self.create_test_textbox(presentation_id, page_id)
130130
response = self.snippets.create_bulleted_text(presentation_id, box_id)
131-
self.assertEquals(1, len(response.get('replies')),
131+
self.assertEqual(1, len(response.get('replies')),
132132
msg=pformat(response))
133133

134134
def test_create_sheets_chart(self):
135135
presentation_id = self.create_test_presentation()
136136
page_id = self.add_slides(presentation_id, 1, 'BLANK')[0]
137137
response = self.snippets.create_sheets_chart(presentation_id,
138138
page_id, SnippetsTest.DATA_SPREADSHEET_ID, SnippetsTest.CHART_ID)
139-
self.assertEquals(1, len(response.get('replies')),
139+
self.assertEqual(1, len(response.get('replies')),
140140
msg=pformat(response))
141141
chart_id = response.get('replies')[0].get('createSheetsChart') \
142142
.get('objectId')
@@ -148,7 +148,7 @@ def test_refresh_sheets_chart(self):
148148
chart_id = self.create_test_sheets_chart(presentation_id,
149149
page_id, SnippetsTest.DATA_SPREADSHEET_ID, SnippetsTest.CHART_ID)
150150
response = self.snippets.refresh_sheets_chart(presentation_id, chart_id)
151-
self.assertEquals(1, len(response.get('replies')),
151+
self.assertEqual(1, len(response.get('replies')),
152152
msg=pformat(response))
153153

154154
if __name__ == '__main__':

0 commit comments

Comments
 (0)