Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Issue 6402627529080832: Issue 2610 - Return notification version in a response header (Closed)

Created:
May 30, 2015, 8:32 p.m. by Felix Dahlke
Modified:
June 16, 2015, 9:31 a.m.
Reviewers:
Sebastian Noack
CC:
Wladimir Palant
Visibility:
Public.

Description

Issue 2610 - Return notification version in a response header

Patch Set 1 #

Total comments: 4
Unified diffs Side-by-side diffs Delta from patch set Stats (+19 lines, -5 lines) Patch
M sitescripts/notifications/test/notification.py View 1 chunk +11 lines, -0 lines 2 comments Download
M sitescripts/notifications/web/notification.py View 2 chunks +8 lines, -5 lines 0 comments Download

Messages

Total messages: 4
Felix Dahlke
This patch is based on http://codereview.adblockplus.org/4883267715072000/, which hasn't landed yet. http://codereview.adblockplus.org/6402627529080832/diff/5629499534213120/sitescripts/notifications/test/notification.py File sitescripts/notifications/test/notification.py (right): http://codereview.adblockplus.org/6402627529080832/diff/5629499534213120/sitescripts/notifications/test/notification.py#newcode309 ...
May 30, 2015, 8:37 p.m. (2015-05-30 20:37:07 UTC) #1
Sebastian Noack
http://codereview.adblockplus.org/6402627529080832/diff/5629499534213120/sitescripts/notifications/test/notification.py File sitescripts/notifications/test/notification.py (right): http://codereview.adblockplus.org/6402627529080832/diff/5629499534213120/sitescripts/notifications/test/notification.py#newcode309 sitescripts/notifications/test/notification.py:309: for name, value in response_headers: On 2015/05/30 20:37:07, Felix ...
June 2, 2015, 10:35 p.m. (2015-06-02 22:35:47 UTC) #2
Felix Dahlke
http://codereview.adblockplus.org/6402627529080832/diff/5629499534213120/sitescripts/notifications/test/notification.py File sitescripts/notifications/test/notification.py (right): http://codereview.adblockplus.org/6402627529080832/diff/5629499534213120/sitescripts/notifications/test/notification.py#newcode309 sitescripts/notifications/test/notification.py:309: for name, value in response_headers: On 2015/06/02 22:35:47, Sebastian ...
June 3, 2015, 3:21 a.m. (2015-06-03 03:21:07 UTC) #3
Sebastian Noack
June 3, 2015, 8:34 a.m. (2015-06-03 08:34:58 UTC) #4
LGTM

http://codereview.adblockplus.org/6402627529080832/diff/5629499534213120/site...
File sitescripts/notifications/test/notification.py (right):

http://codereview.adblockplus.org/6402627529080832/diff/5629499534213120/site...
sitescripts/notifications/test/notification.py:309: for name, value in
response_headers:
On 2015/06/03 03:21:07, Felix H. Dahlke wrote:
> On 2015/06/02 22:35:47, Sebastian Noack wrote:
> > On 2015/05/30 20:37:07, Felix H. Dahlke wrote:
> > > Suggestions for a simpler way welcome - feels pretty hacky to me.
> > 
> > Not much simpler, but here you go:
> > 
> >   response_header_map = None
> >   def start_response(status, response_headers):
> >     response_header_map = dict(response_headers)
> 
> I've tried this before - unfortunately it doesn't work because I cannot assign
> to a variable from the parent scope, apparently. That's why I'm initialising
the
> dict in the parent scope and just add elements to it in the function, but it
> feels like a hack.

Alright, that it's actually True. Variables are always set locally unless
declared otherwise. However, in Python 2 there is only a "global" keyword, but
here you would need the "nonlocal" keyword introduced in Python 3.

Powered by Google App Engine
This is Rietveld