Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(80)

Side by Side Diff: tools/findit/common/utils.py

Issue 465403004: [Findit] Support sending cookies for http requests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix nit. Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 # Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 # Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 import re 5 import re
6 import sys 6 import sys
7 7
8 from http_client_local import HttpClientLocal
9
8 10
9 GIT_HASH_PATTERN = re.compile(r'^[0-9a-fA-F]{40}$') 11 GIT_HASH_PATTERN = re.compile(r'^[0-9a-fA-F]{40}$')
10 12
11 13
12 def GetOSName(platform_name=sys.platform): 14 def GetOSName(platform_name=sys.platform):
13 if platform_name == 'cygwin' or platform_name.startswith('win'): 15 if platform_name == 'cygwin' or platform_name.startswith('win'):
14 return 'win' 16 return 'win'
15 elif platform_name.startswith('linux'): 17 elif platform_name.startswith('linux'):
16 return 'unix' 18 return 'unix'
17 elif platform_name.startswith('darwin'): 19 elif platform_name.startswith('darwin'):
18 return 'mac' 20 return 'mac'
19 else: 21 else:
20 return platform_name 22 return platform_name
21 23
22 24
23 def IsGitHash(revision): 25 def IsGitHash(revision):
24 return GIT_HASH_PATTERN.match(str(revision)) 26 return GIT_HASH_PATTERN.match(str(revision))
27
28
29 def GetHttpClient():
30 # TODO(stgao): return implementation for appengine when running on appengine.
Martin Barbella 2014/08/15 23:00:02 Are two implementations necessary? Isn't setting C
stgao 2014/08/15 23:11:03 Yes, we need two different implementation. On appe
31 return HttpClientLocal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698