Mercurial > repos > guerler > springsuite
comparison planemo/lib/python3.7/site-packages/urllib3/contrib/_appengine_environ.py @ 1:56ad4e20f292 draft
"planemo upload commit 6eee67778febed82ddd413c3ca40b3183a3898f1"
author | guerler |
---|---|
date | Fri, 31 Jul 2020 00:32:28 -0400 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
0:d30785e31577 | 1:56ad4e20f292 |
---|---|
1 """ | |
2 This module provides means to detect the App Engine environment. | |
3 """ | |
4 | |
5 import os | |
6 | |
7 | |
8 def is_appengine(): | |
9 return is_local_appengine() or is_prod_appengine() | |
10 | |
11 | |
12 def is_appengine_sandbox(): | |
13 """Reports if the app is running in the first generation sandbox. | |
14 | |
15 The second generation runtimes are technically still in a sandbox, but it | |
16 is much less restrictive, so generally you shouldn't need to check for it. | |
17 see https://cloud.google.com/appengine/docs/standard/runtimes | |
18 """ | |
19 return is_appengine() and os.environ["APPENGINE_RUNTIME"] == "python27" | |
20 | |
21 | |
22 def is_local_appengine(): | |
23 return "APPENGINE_RUNTIME" in os.environ and os.environ.get( | |
24 "SERVER_SOFTWARE", "" | |
25 ).startswith("Development/") | |
26 | |
27 | |
28 def is_prod_appengine(): | |
29 return "APPENGINE_RUNTIME" in os.environ and os.environ.get( | |
30 "SERVER_SOFTWARE", "" | |
31 ).startswith("Google App Engine/") | |
32 | |
33 | |
34 def is_prod_appengine_mvms(): | |
35 """Deprecated.""" | |
36 return False |