templates: Use Python 3 syntax for typing.

This commit is contained in:
rht 2017-11-27 13:19:13 +00:00 committed by Greg Price
parent 92d62f62e1
commit 5a1869901d
2 changed files with 11 additions and 11 deletions

View File

@ -56,10 +56,10 @@ class MyBotHandler(object):
A docstring documenting this bot.
'''
def usage(self):
def usage(self) -> str:
return '''Your description of the bot'''
def handle_message(self, message, bot_handler):
def handle_message(self, message, bot_handler) -> None:
# add your code here
handler_class = MyBotHandler
@ -176,7 +176,7 @@ is called to retrieve information about the bot.
#### Example implementation
```
def usage(self):
def usage(self) -> str:
return '''
This plugin will allow users to flag messages
as being follow-up items. Users should preface
@ -207,7 +207,7 @@ None.
#### Example implementation
```
def handle_message(self, message, bot_handler):
def handle_message(self, message, bot_handler) -> None:
original_content = message['content']
original_sender = message['sender_email']
new_content = original_content.replace('@followup',
@ -408,7 +408,7 @@ refactor them.
class TestHelloWorldBot(BotTestCase):
bot_name = "helloworld" # The bot's name (should be the name of the bot module to test).
def test_bot(self): # A test case (must start with `test`)
def test_bot(self) -> None: # A test case (must start with `test`)
# Messages we want to test and the expected bot responses.
message_response_pairs = [("", "beep boop"),
("foo", "beep boop"),

View File

@ -77,16 +77,16 @@
</tr>
<tr>
<td class="preserve_spaces">```
def zulip():
print "Zulip"
def zulip() -> None:
print("Zulip")
```</td>
<td><pre>def zulip():
print "Zulip"</pre></td>
<td><pre>def zulip() -> None:
print("Zulip")</pre></td>
</tr>
<tr>
<td class="preserve_spaces">```python
def zulip():
print "Zulip"
def zulip() -> None:
print("Zulip")
```</td>
<td>
<div class="codehilite"><pre><span class="k">def</span> <span class="nf">zulip</span><span class="p">():</span>