matrix: Style fixes.
This commit is contained in:
parent
798e779391
commit
d97655d68c
6 changed files with 17 additions and 14 deletions
|
@ -20,7 +20,7 @@ from __future__ import unicode_literals
|
||||||
import time
|
import time
|
||||||
from builtins import super
|
from builtins import super
|
||||||
from functools import partial
|
from functools import partial
|
||||||
from typing import Dict, List, NamedTuple, Set, Optional
|
from typing import Dict, List, NamedTuple, Optional, Set
|
||||||
|
|
||||||
from nio import (
|
from nio import (
|
||||||
Api,
|
Api,
|
||||||
|
|
|
@ -346,9 +346,12 @@ class Formatted(object):
|
||||||
|
|
||||||
# If we're quoted code add quotation marks now.
|
# If we're quoted code add quotation marks now.
|
||||||
if attributes["quote"] and key == "code" and value:
|
if attributes["quote"] and key == "code" and value:
|
||||||
text = indent(text, "{}>{} ".format(
|
text = indent(
|
||||||
W.color(G.CONFIG.color.quote),
|
text,
|
||||||
W.color("reset")))
|
"{}>{} ".format(
|
||||||
|
W.color(G.CONFIG.color.quote), W.color("reset")
|
||||||
|
),
|
||||||
|
)
|
||||||
|
|
||||||
# If we're code don't remove multiple newlines blindly
|
# If we're code don't remove multiple newlines blindly
|
||||||
if attributes["code"]:
|
if attributes["code"]:
|
||||||
|
|
|
@ -20,8 +20,8 @@ from collections import namedtuple
|
||||||
from enum import Enum, unique
|
from enum import Enum, unique
|
||||||
|
|
||||||
import logbook
|
import logbook
|
||||||
import nio
|
|
||||||
|
|
||||||
|
import nio
|
||||||
from matrix.globals import SCRIPT_NAME, SERVERS, W
|
from matrix.globals import SCRIPT_NAME, SERVERS, W
|
||||||
from matrix.utf import utf8_decode
|
from matrix.utf import utf8_decode
|
||||||
|
|
||||||
|
|
|
@ -17,11 +17,10 @@
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
|
from typing import Dict, Optional
|
||||||
|
|
||||||
from .utf import WeechatWrapper
|
from .utf import WeechatWrapper
|
||||||
|
|
||||||
from typing import Dict, Optional
|
|
||||||
|
|
||||||
if False:
|
if False:
|
||||||
from .server import MatrixServer
|
from .server import MatrixServer
|
||||||
from .config import MatrixConfig
|
from .config import MatrixConfig
|
||||||
|
|
|
@ -24,19 +24,16 @@ import time
|
||||||
from collections import defaultdict, deque
|
from collections import defaultdict, deque
|
||||||
from typing import Any, Deque, Dict, Optional
|
from typing import Any, Deque, Dict, Optional
|
||||||
|
|
||||||
if False:
|
|
||||||
from .colors import Formatted
|
|
||||||
|
|
||||||
from nio import (
|
from nio import (
|
||||||
HttpClient,
|
HttpClient,
|
||||||
LocalProtocolError,
|
LocalProtocolError,
|
||||||
LoginResponse,
|
LoginResponse,
|
||||||
|
Response,
|
||||||
|
Rooms,
|
||||||
RoomSendResponse,
|
RoomSendResponse,
|
||||||
SyncRepsponse,
|
SyncRepsponse,
|
||||||
TransportResponse,
|
TransportResponse,
|
||||||
TransportType,
|
TransportType,
|
||||||
Rooms,
|
|
||||||
Response
|
|
||||||
)
|
)
|
||||||
|
|
||||||
from . import globals as G
|
from . import globals as G
|
||||||
|
@ -46,6 +43,10 @@ from .globals import SCRIPT_NAME, SERVERS, W
|
||||||
from .utf import utf8_decode
|
from .utf import utf8_decode
|
||||||
from .utils import create_server_buffer, key_from_value, server_buffer_prnt
|
from .utils import create_server_buffer, key_from_value, server_buffer_prnt
|
||||||
|
|
||||||
|
if False:
|
||||||
|
from .colors import Formatted
|
||||||
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
FileNotFoundError # type: ignore
|
FileNotFoundError # type: ignore
|
||||||
except NameError:
|
except NameError:
|
||||||
|
|
|
@ -19,11 +19,11 @@ from __future__ import unicode_literals
|
||||||
import time
|
import time
|
||||||
from typing import Any, Dict, List
|
from typing import Any, Dict, List
|
||||||
|
|
||||||
|
from .globals import W
|
||||||
|
|
||||||
if False:
|
if False:
|
||||||
from .server import MatrixServer
|
from .server import MatrixServer
|
||||||
|
|
||||||
from .globals import W
|
|
||||||
|
|
||||||
|
|
||||||
def key_from_value(dictionary, value):
|
def key_from_value(dictionary, value):
|
||||||
# type: (Dict[str, Any], Any) -> str
|
# type: (Dict[str, Any], Any) -> str
|
||||||
|
|
Loading…
Add table
Reference in a new issue