Skip to content

Commit 141c46f

Browse files
chore(gae): delete region tags from standard/xmpp folder (#13090)
* chore(gae): add requirements.txt and requirements-test.txt * chore(gae): delete region tags from standard/xmpp/xmpp.py
1 parent dfdeaad commit 141c46f

File tree

3 files changed

+7
-16
lines changed

3 files changed

+7
-16
lines changed
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/xmpp/xmpp.py

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,8 @@
1616

1717
import logging
1818

19-
# [START xmpp-imports]
2019
from google.appengine.api import xmpp
2120

22-
# [END xmpp-imports]
2321
import mock
2422
import webapp2
2523

@@ -29,18 +27,15 @@
2927

3028
class SubscribeHandler(webapp2.RequestHandler):
3129
def post(self):
32-
# [START track]
3330
# Split the bare XMPP address (e.g., user@gmail.com)
3431
# from the resource (e.g., gmail), and then add the
3532
# address to the roster.
3633
sender = self.request.get("from").split("/")[0]
3734
roster.add_contact(sender)
38-
# [END track]
3935

4036

4137
class PresenceHandler(webapp2.RequestHandler):
4238
def post(self):
43-
# [START presence]
4439
# Split the bare XMPP address (e.g., user@gmail.com)
4540
# from the resource (e.g., gmail), and then add the
4641
# address to the roster.
@@ -50,33 +45,27 @@ def post(self):
5045
status=self.request.get("status"),
5146
presence_show=self.request.get("show"),
5247
)
53-
# [END presence]
5448

5549

5650
class SendPresenceHandler(webapp2.RequestHandler):
5751
def post(self):
58-
# [START send-presence]
5952
jid = self.request.get("jid")
6053
xmpp.send_presence(jid, status="My app's status")
61-
# [END send-presence]
6254

6355

6456
class ErrorHandler(webapp2.RequestHandler):
6557
def post(self):
66-
# [START error]
6758
# In the handler for _ah/xmpp/error
6859
# Log an error
6960
error_sender = self.request.get("from")
7061
error_stanza = self.request.get("stanza")
7162
logging.error(
7263
"XMPP error received from {} ({})".format(error_sender, error_stanza)
7364
)
74-
# [END error]
7565

7666

7767
class SendChatHandler(webapp2.RequestHandler):
7868
def post(self):
79-
# [START send-chat-to-user]
8069
user_address = "example@gmail.com"
8170
msg = (
8271
"Someone has sent you a gift on Example.com. "
@@ -87,21 +76,16 @@ def post(self):
8776

8877
if not chat_message_sent:
8978
# Send an email message instead...
90-
# [END send-chat-to-user]
9179
pass
9280

9381

94-
# [START chat]
9582
class XMPPHandler(webapp2.RequestHandler):
9683
def post(self):
9784
message = xmpp.Message(self.request.POST)
9885
if message.body[0:5].lower() == "hello":
9986
message.reply("Greetings!")
10087

10188

102-
# [END chat]
103-
104-
10589
app = webapp2.WSGIApplication(
10690
[
10791
("/_ah/xmpp/message/chat/", XMPPHandler),

0 commit comments

Comments
 (0)