firetactoe pull request#558
Conversation
|
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed, please reply here (e.g.
|
| var config = { | ||
| apiKey: "AIzaSyB_pwNiBi8Q3iakJitkQHtEQ5SZWmp9EiY", | ||
| authDomain: "imposing-mind-131903.firebaseapp.com", | ||
| databaseURL: "https://imposing-mind-131903.firebaseio.com" |
There was a problem hiding this comment.
probably best to put placeholders here, preferably put all this stuff in a single file that gets pulled in somehow.
|
I signed it! On Wed, Oct 5, 2016 at 4:15 PM, googlebot notifications@github.com wrote:
|
|
CLAs look good, thanks! |
|
Assuming there's more context for this PR someone else knows about? |
|
Absolutely! I work at Google, actually. Keys/secrets are in there so that On Wed, Oct 5, 2016 at 4:34 PM, Bill Prin notifications@github.com wrote:
|
| @@ -0,0 +1,288 @@ | |||
| #!/usr/bin/python2.4 | |||
| # | |||
|
Ok cool. I would still refactor out all the config and secrets and add a README on how to generate them. We will need that anyway, so no good reason not to do it now before merge. |
|
|
||
| <style type='text/css'> | ||
| body { | ||
| font-family: 'Helvetica'; |
There was a problem hiding this comment.
think we should also factor out css and js into separate files.
| var square = document.getElementById(i); | ||
| square.innerHTML = state.board[i]; | ||
| if (state.winner != '' && state.winningBoard != '') { | ||
| if (state.winningBoard[i] == state.board[i]) { |
There was a problem hiding this comment.
Believe we should be using triple =. Have you run this through jslint?
|
All good points. Is there any way you can hand my review over to jonwayne@ Thanks! On Wed, Oct 5, 2016 at 4:43 PM, Bill Prin notifications@github.com wrote:
|
Yep, I'm here. Bill just beat me to the punch. 👍 I'm gonna add some comments but definite want you to address what bill has mentioned as well. |
theacodes
left a comment
There was a problem hiding this comment.
Finished first pass, please ping me when you're ready for the next round of review.
| @@ -0,0 +1,11 @@ | |||
| runtime: python27 | |||
There was a problem hiding this comment.
(Github won't let me comment on a binary file): Please remove .DS_Store. I'd recommend adding it to your global gitignore.
|
|
||
| libraries: | ||
| - name: pycrypto | ||
| version: latest No newline at end of file |
There was a problem hiding this comment.
Always use explicit versions. Latest sometimes isn't the latest, and even if it were we don't want the sample to suddenly break.
| <head> | ||
|
|
||
| <script src="https://www.gstatic.com/firebasejs/3.3.2/firebase.js"></script> | ||
| <!-- <script src="https://www.gstatic.com/firebasejs/3.3.0/firebase-database.js"></script> --> |
There was a problem hiding this comment.
If this isn't necessary, remove it.
|
|
||
| <script src="https://www.gstatic.com/firebasejs/3.3.2/firebase.js"></script> | ||
| <!-- <script src="https://www.gstatic.com/firebasejs/3.3.0/firebase-database.js"></script> --> | ||
| <script> |
There was a problem hiding this comment.
Please move all this to a separate .js file.
| </style> | ||
| </head> | ||
| <body> | ||
| <script type='text/javascript'> |
There was a problem hiding this comment.
Please move this to a js file, probably can combine it with the snippet above.
| game = GameFromRequest(self.request).get_game() | ||
| user = users.get_current_user() | ||
| if game and user: | ||
| FireChannel(fire_url).send_message(u_id=user.user_id() + game.key().id_or_name(), |
There was a problem hiding this comment.
Hanging indents are really unreadable, please line break after send_message(.
| method_type = urlfetch.PATCH | ||
| # always using patch in this example for writes | ||
| # because it updates or creates but never overwrites | ||
| result = urlfetch.fetch( |
There was a problem hiding this comment.
urlfetch is rough, why not use requests? We have a sample here.
| json_data = simplejson.loads(result.content) | ||
| logging.info(json_data.get("message")) | ||
| return result.content | ||
| except urlfetch.Error: |
There was a problem hiding this comment.
In samples, it's better to let the exception raise all the way up so that the user can see the stacktrace. This helps us figure out what's wrong if they report issues.
| game.userO = user | ||
| game.put() | ||
|
|
||
| game_link = 'http://localhost:8080/?g=' + game_key |
| ('/move', MovePage)], debug=True) | ||
|
|
||
|
|
||
| def main(): |
There was a problem hiding this comment.
This isn't needed for app engine.
|
Oh whoops. I'm totally working on a refactor of this -_-; |
Here's the pull request. Includes all the python and html source files for firetactoe