summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEmmanuel Gil Peyrot <linkmauve@linkmauve.fr>2020-12-27 00:49:53 +0100
committerLink Mauve <linkmauve@linkmauve.fr>2020-12-28 19:10:53 +0100
commit826fa779c431033549545b0a8c0240c60fd712f4 (patch)
tree248d9eb25310fce8a4eaa468664503c3e7ba13ef
parentcf58bceb559b56a46d9b4f6ba4f5aa5da927ecac (diff)
downloadpoezio-826fa779c431033549545b0a8c0240c60fd712f4.tar.gz
poezio-826fa779c431033549545b0a8c0240c60fd712f4.tar.bz2
poezio-826fa779c431033549545b0a8c0240c60fd712f4.tar.xz
poezio-826fa779c431033549545b0a8c0240c60fd712f4.zip
xmltab: Add some types.
-rw-r--r--poezio/tabs/xmltab.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/poezio/tabs/xmltab.py b/poezio/tabs/xmltab.py
index c765278f..0409b445 100644
--- a/poezio/tabs/xmltab.py
+++ b/poezio/tabs/xmltab.py
@@ -25,7 +25,7 @@ from poezio.decorators import command_args_parser, refresh_wrapper
class MatchJID:
- def __init__(self, jid, dest=''):
+ def __init__(self, jid: JID, dest: str = ''):
self.jid = jid
self.dest = dest
@@ -173,7 +173,7 @@ class XMLTab(Tab):
self.text_win.toggle_lock()
self.refresh()
- def match_stanza(self, stanza):
+ def match_stanza(self, stanza) -> bool:
for matcher_ in self.filters:
if not matcher_.match(stanza):
return False
@@ -232,7 +232,7 @@ class XMLTab(Tab):
self.refresh()
@command_args_parser.raw
- def command_filter_xpath(self, xpath):
+ def command_filter_xpath(self, xpath: str):
"""/filter_xpath <xpath>"""
try:
self.update_filters(
@@ -289,7 +289,7 @@ class XMLTab(Tab):
self.input.do_command("/") # we add the slash
@refresh_wrapper.always
- def reset_help_message(self, _=None):
+ def reset_help_message(self, _=None) -> bool:
if self.closed:
return True
if self.core.tabs.current_tab is self:
@@ -297,10 +297,10 @@ class XMLTab(Tab):
self.input = self.default_help_message
return True
- def on_scroll_up(self):
+ def on_scroll_up(self) -> bool:
return self.text_win.scroll_up(self.text_win.height - 1)
- def on_scroll_down(self):
+ def on_scroll_down(self) -> bool:
return self.text_win.scroll_down(self.text_win.height - 1)
@command_args_parser.ignored
@@ -314,7 +314,7 @@ class XMLTab(Tab):
self.refresh()
self.core.doupdate()
- def execute_slash_command(self, txt):
+ def execute_slash_command(self, txt: str) -> bool:
if txt.startswith('/'):
self.input.key_enter()
self.execute_command(txt)