Skip to content

Commit 33d05b3

Browse files
chore(gae): migrate region tags from standard: users, remote_api and urlfetch folders (#13087)
* chore(gae): add requirements-test.txt and requirements-test.txt * chore(gae): delete and rename region tags from standard/users/main.py * chore(gae): rename region tag 'all' from standard/remote_api/client.py * chore(gae): add support for Python 3 to requirements-test.txt * chore(gae): rename region tags in standard/urlfetch/requests/main.py * chore(gae): add suffix 'app' to remote_api/client.py * chore(gae): try to fix the snippet-bot format issue * chore(gae): remove region tag 'app' * chore(gae): fix typo in region tag
1 parent 141c46f commit 33d05b3

File tree

6 files changed

+24
-21
lines changed

6 files changed

+24
-21
lines changed

appengine/standard/remote_api/client.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@
1515
"""Sample app that uses the Google App Engine Remote API to make calls to the
1616
live App Engine APIs."""
1717

18-
# [START all]
19-
18+
# [START gae_remoteapi_client_app]
2019
import argparse
2120

2221
try:
@@ -52,4 +51,4 @@ def main(project_id):
5251
args = parser.parse_args()
5352

5453
main(args.project_id)
55-
# [END all]
54+
# [END gae_remoteapi_client_app]

appengine/standard/urlfetch/requests/main.py

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,31 +12,31 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
# [START app]
15+
# [START gae_urlfetch_requests]
1616
import logging
1717

1818
from flask import Flask
1919

20-
# [START imports]
20+
# [START gae_urlfech_requests_imports]
2121
import requests
2222
import requests_toolbelt.adapters.appengine
2323

24-
# Use the App Engine Requests adapter. This makes sure that Requests uses
25-
# URLFetch.
24+
# Use the App Engine Requests adapter.
25+
# This makes sure that Requests uses URLFetch.
2626
requests_toolbelt.adapters.appengine.monkeypatch()
27-
# [END imports]
27+
# [END gae_urlfech_requests_imports]
2828

2929
app = Flask(__name__)
3030

3131

3232
@app.route("/")
3333
def index():
34-
# [START requests_get]
34+
# [START gae_urlfetch_requests_get]
3535
url = "http://www.google.com/humans.txt"
3636
response = requests.get(url)
3737
response.raise_for_status()
3838
return response.text
39-
# [END requests_get]
39+
# [END gae_urlfetch_requests_get]
4040

4141

4242
@app.errorhandler(500)
@@ -51,6 +51,4 @@ def server_error(e):
5151
),
5252
500,
5353
)
54-
55-
56-
# [END app]
54+
# [END gae_urlfetch_requests]
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,6 @@
11
# pin pytest to 4.6.11 for Python2.
22
pytest==4.6.11; python_version < '3.0'
3+
4+
# pytest==8.3.4 and six==1.17.0 for Python3.
5+
pytest==8.3.4; python_version >= '3.0'
6+
six==1.17.0

appengine/standard/users/main.py

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,21 +12,18 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
"""
16-
Sample Google App Engine application that demonstrates using the Users API
15+
"""Sample Google App Engine application that demonstrates using the Users API.
1716
1817
For more information about App Engine, see README.md under /appengine.
1918
"""
2019

21-
# [START all]
22-
2320
from google.appengine.api import users
2421
import webapp2
2522

2623

2724
class MainPage(webapp2.RequestHandler):
2825
def get(self):
29-
# [START user_details]
26+
# [START gae_users_get_details]
3027
user = users.get_current_user()
3128
if user:
3229
nickname = user.nickname()
@@ -37,7 +34,7 @@ def get(self):
3734
else:
3835
login_url = users.create_login_url("/")
3936
greeting = '<a href="{}">Sign in</a>'.format(login_url)
40-
# [END user_details]
37+
# [END gae_users_get_details]
4138
self.response.write("<html><body>{}</body></html>".format(greeting))
4239

4340

@@ -54,5 +51,3 @@ def get(self):
5451

5552

5653
app = webapp2.WSGIApplication([("/", MainPage), ("/admin", AdminPage)], debug=True)
57-
58-
# [END all]
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# pin pytest to 4.6.11 for Python2.
2+
pytest==4.6.11; python_version < '3.0'
3+
4+
# pytest==8.3.4 and six==1.17.0 for Python3.
5+
pytest==8.3.4; python_version >= '3.0'
6+
six==1.17.0
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+

0 commit comments

Comments
 (0)