Skip to content

Commit 47d5b15

Browse files
chore(gae): fix region tags from standard: mailjet mail and flask folders (#13106)
* chore(gae): rename and delete region tags in standard/mailjet/main.py * chore(gae): add requirements.txt and requirements-test.txt * chore(gae): rename region tags in standard/mail/handle_incoming_email.py * chore(gae): rename region tags in appengine/standard/mail/handle_bounced_email.py * chore(gae): rename region tags in appengine/standard/mail/header.py * chore(gae): rename region tags in appengine/standard/mail/send_mail.py * chore(gae): rename region tags in appengine/standard/mail/send_message.py * chore(gae): rename region tags in appengine/standard/mail/user_signup.py * chore(gae): add requirements.txt and requirements-test.txt * chore(gae): rename region tag 'app' from standard/flask/hello_world/main.py
1 parent bc9251c commit 47d5b15

File tree

12 files changed

+35
-33
lines changed

12 files changed

+35
-33
lines changed

appengine/standard/flask/hello_world/main.py

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

15-
# [START app]
1615
import logging
1716

1817
from flask import Flask
@@ -31,6 +30,3 @@ def server_error(e):
3130
# Log the error and stacktrace.
3231
logging.exception("An error occurred during a request.")
3332
return "An internal error occurred.", 500
34-
35-
36-
# [END app]
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+

appengine/standard/mail/handle_bounced_email.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,13 @@
1818
import webapp2
1919

2020

21-
# [START bounce_handler]
21+
# [START gae_mail_bounce_handler]
2222
class LogBounceHandler(BounceNotificationHandler):
2323
def receive(self, bounce_message):
2424
logging.info("Received bounce post ... [%s]", self.request)
2525
logging.info("Bounce original: %s", bounce_message.original)
2626
logging.info("Bounce notification: %s", bounce_message.notification)
27-
28-
29-
# [END bounce_handler]
27+
# [END gae_mail_bounce_handler]
3028

3129

3230
app = webapp2.WSGIApplication([LogBounceHandler.mapping()], debug=True)

appengine/standard/mail/handle_incoming_email.py

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

15-
# [START log_sender_handler]
15+
# [START gae_mail_log_sender_handler]
1616
import logging
1717

1818
from google.appengine.ext.webapp.mail_handlers import InboundMailHandler
@@ -22,21 +22,21 @@
2222
class LogSenderHandler(InboundMailHandler):
2323
def receive(self, mail_message):
2424
logging.info("Received a message from: " + mail_message.sender)
25-
# [END log_sender_handler]
26-
# [START bodies]
25+
# [END gae_mail_log_sender_handler]
26+
# [START gae_mail_log_sender_handler_bodies]
2727
plaintext_bodies = mail_message.bodies("text/plain")
2828
html_bodies = mail_message.bodies("text/html")
2929

3030
for content_type, body in html_bodies:
3131
decoded_html = body.decode()
32-
# ...
33-
# [END bodies]
3432
logging.info("Html body of length %d.", len(decoded_html))
3533
for content_type, body in plaintext_bodies:
3634
plaintext = body.decode()
3735
logging.info("Plain text body of length %d.", len(plaintext))
36+
# ...
37+
# [END gae_mail_log_sender_handler_bodies]
3838

3939

40-
# [START app]
40+
# [START gae_mail_log_sender_handler_app]
4141
app = webapp2.WSGIApplication([LogSenderHandler.mapping()], debug=True)
42-
# [END app]
42+
# [END gae_mail_log_sender_handler_app]

appengine/standard/mail/header.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121

2222
def send_example_mail(sender_address, email_thread_id):
23-
# [START send_mail]
23+
# [START gae_mail_header_send_mail]
2424
mail.send_mail(
2525
sender=sender_address,
2626
to="Albert Johnson <[email protected]>",
@@ -32,7 +32,7 @@ def send_example_mail(sender_address, email_thread_id):
3232
""",
3333
headers={"References": email_thread_id},
3434
)
35-
# [END send_mail]
35+
# [END gae_mail_header_send_mail]
3636

3737

3838
class SendMailHandler(webapp2.RequestHandler):
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+

appengine/standard/mail/send_mail.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919

2020
def send_approved_mail(sender_address):
21-
# [START send_mail]
21+
# [START gae_mail_send_approved_mail]
2222
mail.send_mail(
2323
sender=sender_address,
2424
to="Albert Johnson <[email protected]>",
@@ -34,7 +34,7 @@ def send_approved_mail(sender_address):
3434
The example.com Team
3535
""",
3636
)
37-
# [END send_mail]
37+
# [END gae_mail_send_approved_mail]
3838

3939

4040
class SendMailHandler(webapp2.RequestHandler):

appengine/standard/mail/send_message.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919

2020
def send_approved_mail(sender_address):
21-
# [START send_message]
21+
# [START gae_mail_send_approved_message]
2222
message = mail.EmailMessage(
2323
sender=sender_address, subject="Your account has been approved"
2424
)
@@ -35,7 +35,7 @@ def send_approved_mail(sender_address):
3535
The example.com Team
3636
"""
3737
message.send()
38-
# [END send_message]
38+
# [END gae_mail_send_approved_message]
3939

4040

4141
class SendMessageHandler(webapp2.RequestHandler):

0 commit comments

Comments
 (0)