From b5bd6a12dda2fa459b0d3e5bcae10471f993c7a2 Mon Sep 17 00:00:00 2001 From: Emmanuel Gil Peyrot Date: Sun, 22 Jul 2018 17:00:26 +0200 Subject: xhtml: Fix a few typing errors. --- poezio/xhtml.py | 6 +++--- 1 file 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 = ["

"] -- cgit v1.2.3