summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEmmanuel Gil Peyrot <linkmauve@linkmauve.fr>2018-07-22 17:00:26 +0200
committerEmmanuel Gil Peyrot <linkmauve@linkmauve.fr>2018-07-22 17:00:26 +0200
commitb5bd6a12dda2fa459b0d3e5bcae10471f993c7a2 (patch)
tree145838c9da3a65ee960df7db53e328712c4da3b2
parent9ec1b20b9070364946076456776d4e067e2ed9e9 (diff)
downloadpoezio-b5bd6a12dda2fa459b0d3e5bcae10471f993c7a2.tar.gz
poezio-b5bd6a12dda2fa459b0d3e5bcae10471f993c7a2.tar.bz2
poezio-b5bd6a12dda2fa459b0d3e5bcae10471f993c7a2.tar.xz
poezio-b5bd6a12dda2fa459b0d3e5bcae10471f993c7a2.zip
xhtml: Fix a few typing errors.
-rw-r--r--poezio/xhtml.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/poezio/xhtml.py b/poezio/xhtml.py
index 9632855a..b28eed4f 100644
--- a/poezio/xhtml.py
+++ b/poezio/xhtml.py
@@ -21,7 +21,7 @@ from pathlib import Path
from io import BytesIO
from xml import sax
from xml.sax import saxutils
-from typing import Dict, Optional, Tuple
+from typing import List, Dict, Optional, Union, Tuple
from slixmpp.xmlstream import ET
from poezio.config import config
@@ -299,7 +299,7 @@ def get_hash(data: bytes) -> str:
class XHTMLHandler(sax.ContentHandler):
- def __init__(self, force_ns=False, tmp_image_dir: Optional[Path] = None):
+ def __init__(self, force_ns=False, tmp_image_dir: Optional[Path] = None) -> None:
self.builder = [] # type: List[str]
self.formatting = [] # type: List[str]
self.attrs = [] # type: List[Dict[str, str]]
@@ -526,7 +526,7 @@ def poezio_colors_to_html(string: str) -> str:
# Maintain a list of the current css attributes used
# And check if a tag is open (by design, we only open
# spans tag, and they cannot be nested.
- current_attrs = {}
+ current_attrs = {} # type: Dict[str, str]
tag_open = False
next_attr_char = string.find('\x19')
build = ["<body xmlns='http://www.w3.org/1999/xhtml'><p>"]