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

Side by Side Diff: appengine/findit/common/appengine_util.py

Issue 2299883005: [Findit] Add findit_for_client to do analysis based on client_id (Closed)
Patch Set: Rebase. Created 4 years, 3 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
« no previous file with comments | « no previous file | appengine/findit/common/constants.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2016 The Chromium Authors. All rights reserved. 1 # Copyright 2016 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 os 5 import os
6 6
7 from google.appengine.api import app_identity
7 from google.appengine.api import modules 8 from google.appengine.api import modules
8 9
9 10
10 def IsInDevServer(): # pragma: no cover. 11 def IsInDevServer(): # pragma: no cover.
11 """Returns whether the code runs in dev server locally.""" 12 """Returns whether the code runs in dev server locally."""
12 return os.environ['APPLICATION_ID'].startswith('dev') 13 return os.environ['APPLICATION_ID'].startswith('dev')
13 14
14 15
15 def GetCurrentVersion(): # pragma: no cover. 16 def GetCurrentVersion(): # pragma: no cover.
16 """Returns the version of this module.""" 17 """Returns the version of this module."""
17 return modules.get_current_version_name() 18 return modules.get_current_version_name()
18 19
19 20
21 def GetDefaultVersionHostname(): # pragma: no cover.
22 """Returns the default version hostname of this service."""
23 return app_identity.get_default_version_hostname()
24
25
20 def GetTargetNameForModule(module_name, version=None): # pragma: no cover. 26 def GetTargetNameForModule(module_name, version=None): # pragma: no cover.
21 """Returns the target name for the given module and version. 27 """Returns the target name for the given module and version.
22 28
23 Version defaults to the one running this code. 29 Version defaults to the one running this code.
24 """ 30 """
25 if IsInDevServer(): 31 if IsInDevServer():
26 # Dev server doesn't support multiple versions of a module. 32 # Dev server doesn't support multiple versions of a module.
27 return module_name 33 return module_name
28 else: 34 else:
29 version = version or GetCurrentVersion() 35 version = version or GetCurrentVersion()
30 return '%s.%s' % (version, module_name) 36 return '%s.%s' % (version, module_name)
31 37
OLDNEW
« no previous file with comments | « no previous file | appengine/findit/common/constants.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698