matrix: Style fixes.

This commit is contained in:
Damir Jelić 2018-08-30 16:35:05 +02:00
parent 798e779391
commit d97655d68c
6 changed files with 17 additions and 14 deletions

View file

@ -20,7 +20,7 @@ from __future__ import unicode_literals
import time
from builtins import super
from functools import partial
from typing import Dict, List, NamedTuple, Set, Optional
from typing import Dict, List, NamedTuple, Optional, Set
from nio import (
Api,

View file

@ -346,9 +346,12 @@ class Formatted(object):
# If we're quoted code add quotation marks now.
if attributes["quote"] and key == "code" and value:
text = indent(text, "{}>{} ".format(
W.color(G.CONFIG.color.quote),
W.color("reset")))
text = indent(
text,
"{}>{} ".format(
W.color(G.CONFIG.color.quote), W.color("reset")
),
)
# If we're code don't remove multiple newlines blindly
if attributes["code"]:

View file

@ -20,8 +20,8 @@ from collections import namedtuple
from enum import Enum, unique
import logbook
import nio
import nio
from matrix.globals import SCRIPT_NAME, SERVERS, W
from matrix.utf import utf8_decode

View file

@ -17,11 +17,10 @@
from __future__ import unicode_literals
import sys
from typing import Dict, Optional
from .utf import WeechatWrapper
from typing import Dict, Optional
if False:
from .server import MatrixServer
from .config import MatrixConfig

View file

@ -24,19 +24,16 @@ import time
from collections import defaultdict, deque
from typing import Any, Deque, Dict, Optional
if False:
from .colors import Formatted
from nio import (
HttpClient,
LocalProtocolError,
LoginResponse,
Response,
Rooms,
RoomSendResponse,
SyncRepsponse,
TransportResponse,
TransportType,
Rooms,
Response
)
from . import globals as G
@ -46,6 +43,10 @@ from .globals import SCRIPT_NAME, SERVERS, W
from .utf import utf8_decode
from .utils import create_server_buffer, key_from_value, server_buffer_prnt
if False:
from .colors import Formatted
try:
FileNotFoundError # type: ignore
except NameError:

View file

@ -19,11 +19,11 @@ from __future__ import unicode_literals
import time
from typing import Any, Dict, List
from .globals import W
if False:
from .server import MatrixServer
from .globals import W
def key_from_value(dictionary, value):
# type: (Dict[str, Any], Any) -> str