|
|
Created:
7 years, 11 months ago by scherkus (not reviewing) Modified:
7 years, 11 months ago Reviewers:
M-A Ruel CC:
chromium-reviews, pam+watch_chromium.org Base URL:
svn://svn.chromium.org/chrome/trunk/src Visibility:
Public. |
DescriptionAdd omahaproxy.py for accessing Chrome channel information from the command line.
Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=175962
Patch Set 1 #
Total comments: 18
Patch Set 2 : #
Total comments: 3
Patch Set 3 : align #Messages
Total messages: 10 (0 generated)
thakis I don't know if you're a python pro or not but I'm going to pick on you to review this
I am a python pro, but I'm also in a code yellow. Can this wait a few weeks? On Wed, Jan 9, 2013 at 11:23 AM, <scherkus@chromium.org> wrote: > Reviewers: Nico, > > Message: > thakis I don't know if you're a python pro or not but I'm going to pick on > you > to review this > > Description: > Add omahaproxy.py for accessing Chrome channel information from the command > line. > > > Please review this at https://codereview.chromium.org/11789004/ > > SVN Base: svn://svn.chromium.org/chrome/trunk/src > > Affected files: > A tools/omahaproxy.py > >
On 2013/01/09 22:30:56, Nico wrote: > I am a python pro, but I'm also in a code yellow. Can this wait a few weeks? Sure can. Feel free to suggest other reviewers, too.
tony@ can probably do a good review, or maruel@. On Wed, Jan 9, 2013 at 3:14 PM, <scherkus@chromium.org> wrote: > On 2013/01/09 22:30:56, Nico wrote: >> >> I am a python pro, but I'm also in a code yellow. Can this wait a few >> weeks? > > > Sure can. Feel free to suggest other reviewers, too. > > https://codereview.chromium.org/11789004/
maruel: care to take a look?
https://codereview.chromium.org/11789004/diff/1/tools/omahaproxy.py File tools/omahaproxy.py (right): https://codereview.chromium.org/11789004/diff/1/tools/omahaproxy.py#newcode8 tools/omahaproxy.py:8: A simple script to scrape the Chrome channel information and print out the Scrapes the .. I know it's simple. :) https://codereview.chromium.org/11789004/diff/1/tools/omahaproxy.py#newcode13 tools/omahaproxy.py:13: import os.path Sort. and in general we just "import os". https://codereview.chromium.org/11789004/diff/1/tools/omahaproxy.py#newcode19 tools/omahaproxy.py:19: URL = 'http://omahaproxy.appspot.com/json' https? https://codereview.chromium.org/11789004/diff/1/tools/omahaproxy.py#newcode20 tools/omahaproxy.py:20: 2 lines https://codereview.chromium.org/11789004/diff/1/tools/omahaproxy.py#newcode24 tools/omahaproxy.py:24: except: except Exception as e: then print str(e)? It's useful to know what's happening. https://codereview.chromium.org/11789004/diff/1/tools/omahaproxy.py#newcode53 tools/omahaproxy.py:53: choices = oses, No space around = https://codereview.chromium.org/11789004/diff/1/tools/omahaproxy.py#newcode71 tools/omahaproxy.py:71: if opts.os is None: It can't be None? If someone specifies --os foo, I think it'll error out in parse_args(). https://codereview.chromium.org/11789004/diff/1/tools/omahaproxy.py#newcode78 tools/omahaproxy.py:78: print 'Error: invalid channel' parser.error('Please use --channel') No need to return after since parser.error() calls sys.exit(2) https://codereview.chromium.org/11789004/diff/1/tools/omahaproxy.py#newcode84 tools/omahaproxy.py:84: print 'Error: invalid field' Same
thanks! https://codereview.chromium.org/11789004/diff/1/tools/omahaproxy.py File tools/omahaproxy.py (right): https://codereview.chromium.org/11789004/diff/1/tools/omahaproxy.py#newcode8 tools/omahaproxy.py:8: A simple script to scrape the Chrome channel information and print out the On 2013/01/09 23:45:21, Marc-Antoine Ruel wrote: > Scrapes the .. > > I know it's simple. :) Hah! Done! https://codereview.chromium.org/11789004/diff/1/tools/omahaproxy.py#newcode13 tools/omahaproxy.py:13: import os.path On 2013/01/09 23:45:21, Marc-Antoine Ruel wrote: > Sort. > > and in general we just "import os". Done. https://codereview.chromium.org/11789004/diff/1/tools/omahaproxy.py#newcode19 tools/omahaproxy.py:19: URL = 'http://omahaproxy.appspot.com/json' On 2013/01/09 23:45:21, Marc-Antoine Ruel wrote: > https? Done. https://codereview.chromium.org/11789004/diff/1/tools/omahaproxy.py#newcode20 tools/omahaproxy.py:20: On 2013/01/09 23:45:21, Marc-Antoine Ruel wrote: > 2 lines Done. https://codereview.chromium.org/11789004/diff/1/tools/omahaproxy.py#newcode24 tools/omahaproxy.py:24: except: On 2013/01/09 23:45:21, Marc-Antoine Ruel wrote: > except Exception as e: > then print str(e)? It's useful to know what's happening. Done. https://codereview.chromium.org/11789004/diff/1/tools/omahaproxy.py#newcode53 tools/omahaproxy.py:53: choices = oses, On 2013/01/09 23:45:21, Marc-Antoine Ruel wrote: > No space around = Done. https://codereview.chromium.org/11789004/diff/1/tools/omahaproxy.py#newcode71 tools/omahaproxy.py:71: if opts.os is None: On 2013/01/09 23:45:21, Marc-Antoine Ruel wrote: > It can't be None? If someone specifies --os foo, I think it'll error out in > parse_args(). You are correct! This is also means I don't need the error handlers below either. I had this code here before I discovered optparse had a choices feature. I opted to add a default option for --channel (stable) so we can leave everything up to optparse now https://codereview.chromium.org/11789004/diff/1/tools/omahaproxy.py#newcode78 tools/omahaproxy.py:78: print 'Error: invalid channel' On 2013/01/09 23:45:21, Marc-Antoine Ruel wrote: > parser.error('Please use --channel') > > No need to return after since parser.error() calls sys.exit(2) No longer needed. https://codereview.chromium.org/11789004/diff/1/tools/omahaproxy.py#newcode84 tools/omahaproxy.py:84: print 'Error: invalid field' On 2013/01/09 23:45:21, Marc-Antoine Ruel wrote: > Same No longer needed.
lgtm https://codereview.chromium.org/11789004/diff/3002/tools/omahaproxy.py File tools/omahaproxy.py (right): https://codereview.chromium.org/11789004/diff/3002/tools/omahaproxy.py#newcode57 tools/omahaproxy.py:57: '[default: %%default]' % ', '.join(oses)) In general, I prefer it to be aligned to = to be consistent.
https://codereview.chromium.org/11789004/diff/3002/tools/omahaproxy.py File tools/omahaproxy.py (right): https://codereview.chromium.org/11789004/diff/3002/tools/omahaproxy.py#newcode57 tools/omahaproxy.py:57: '[default: %%default]' % ', '.join(oses)) On 2013/01/10 01:06:11, Marc-Antoine Ruel wrote: > In general, I prefer it to be aligned to = to be consistent. comme ça?
https://codereview.chromium.org/11789004/diff/3002/tools/omahaproxy.py File tools/omahaproxy.py (right): https://codereview.chromium.org/11789004/diff/3002/tools/omahaproxy.py#newcode57 tools/omahaproxy.py:57: '[default: %%default]' % ', '.join(oses)) On 2013/01/10 01:12:23, scherkus wrote: > On 2013/01/10 01:06:11, Marc-Antoine Ruel wrote: > > In general, I prefer it to be aligned to = to be consistent. > > comme ça? Oui, c'est plus lisible. |