Skip to content

Commit 37f55e0

Browse files
author
Jon Wayne Parrott
committed
Fixing lint issues
Change-Id: Ia5284c1cf8df7548a4cede41feaa5dbfef31ccb3
1 parent 9531954 commit 37f55e0

File tree

2 files changed

+19
-20
lines changed

2 files changed

+19
-20
lines changed

appengine/channel/chatactoe.py

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
14+
1415
"""
1516
Channel Tic Tac Toe
1617
This module demonstrates the App Engine Channel API by implementing a
@@ -19,17 +20,13 @@
1920
"""
2021

2122
# [START all]
22-
23-
import datetime
24-
import logging
23+
import json
2524
import os
26-
import random
2725
import re
28-
import json
2926

27+
from google.appengine.api import app_identity
3028
from google.appengine.api import channel
3129
from google.appengine.api import users
32-
from google.appengine.api import app_identity
3330
from google.appengine.ext import db
3431
import jinja2
3532
import webapp2
@@ -102,7 +99,8 @@ def check_win(self):
10299
return
103100

104101
def make_move(self, position, user):
105-
if position >= 0 and user == self.game.userX or user == self.game.userO:
102+
if (position >= 0 and user == self.game.userX or
103+
user == self.game.userO):
106104
if self.game.moveX == (user == self.game.userX):
107105
boardList = list(self.game.board)
108106
if (boardList[position] == ' '):
@@ -174,7 +172,8 @@ def get(self):
174172
game.put()
175173

176174
global CLOUD_PROJECT_ID
177-
game_link = 'https://' + CLOUD_PROJECT_ID + '.appspot.com/?g=' + game_key
175+
game_link = (
176+
'https://' + CLOUD_PROJECT_ID + '.appspot.com/?g=' + game_key)
178177

179178
if game:
180179
token = channel.create_channel(user.user_id() + game_key)
@@ -195,10 +194,10 @@ def get(self):
195194
jinja_environment = jinja2.Environment(
196195
loader=jinja2.FileSystemLoader(os.path.dirname(__file__)))
197196

198-
app = webapp2.WSGIApplication(
199-
[
200-
('/', MainPage), ('/opened', OpenedPage), ('/move', MovePage)
201-
],
202-
debug=True)
197+
app = webapp2.WSGIApplication([
198+
('/', MainPage),
199+
('/opened', OpenedPage),
200+
('/move', MovePage)
201+
], debug=True)
203202

204203
# [END all]

appengine/channel/index.html

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -131,11 +131,11 @@
131131
isMyMove = function() {
132132
return (state.winner == "") &&
133133
(state.moveX == (state.userX == state.me));
134-
}
134+
};
135135

136136
myPiece = function() {
137137
return state.userX == state.me ? 'X' : 'O';
138-
}
138+
};
139139

140140
sendMessage = function(path, opt_param) {
141141
path += '?g=' + state.game_key;
@@ -151,7 +151,7 @@
151151
if (isMyMove() && state.board[id] == ' ') {
152152
sendMessage('/move', 'i=' + id);
153153
}
154-
}
154+
};
155155

156156
highlightSquare = function(id) {
157157
if (state.winner != "") {
@@ -170,7 +170,7 @@
170170

171171
document.getElementById(i).style['background'] = color;
172172
}
173-
}
173+
};
174174

175175
onOpened = function() {
176176
sendMessage('/opened');
@@ -185,7 +185,7 @@
185185
state.winner = newState.winner || "";
186186
state.winningBoard = newState.winningBoard || "";
187187
updateGame();
188-
}
188+
};
189189

190190
openChannel = function() {
191191
var token = '{{ token }}';
@@ -201,7 +201,7 @@
201201
// [END create_channel_2]
202202
// socket.onopen = onOpened;
203203
// socket.onmessage = onMessage;
204-
}
204+
};
205205

206206
initialize = function() {
207207
openChannel();
@@ -212,7 +212,7 @@
212212
square.onclick = new Function('moveInSquare(' + i + ')');
213213
}
214214
onMessage({data: '{{ initial_message }}'});
215-
}
215+
};
216216

217217
setTimeout(initialize, 100);
218218

0 commit comments

Comments
 (0)