clean: remove unused imports

This commit is contained in:
mathieui 2022-02-10 18:42:54 +01:00
parent e4b21822d3
commit b7b221c988
14 changed files with 9 additions and 29 deletions

View file

@ -1,7 +1,6 @@
from typing import Tuple, Dict, List, Union from typing import Tuple, Dict, List, Union
import curses import curses
import hashlib import hashlib
import math
from . import hsluv from . import hsluv

View file

@ -14,7 +14,7 @@ from datetime import (
timezone, timezone,
) )
from pathlib import Path from pathlib import Path
from typing import Dict, List, Optional, Tuple, Union, Any from typing import Dict, List, Optional, Tuple, Union
import os import os
import subprocess import subprocess
@ -23,7 +23,7 @@ import string
import logging import logging
import itertools import itertools
from slixmpp import JID, InvalidJID, Message from slixmpp import Message
from poezio.poezio_shlex import shlex from poezio.poezio_shlex import shlex
log = logging.getLogger(__name__) log = logging.getLogger(__name__)

View file

@ -8,7 +8,7 @@ from xml.etree import ElementTree as ET
from typing import List, Optional, Tuple from typing import List, Optional, Tuple
import logging import logging
from slixmpp import Iq, JID, InvalidJID from slixmpp import JID, InvalidJID
from slixmpp.exceptions import XMPPError, IqError, IqTimeout from slixmpp.exceptions import XMPPError, IqError, IqTimeout
from slixmpp.xmlstream.xmlstream import NotConnectedError from slixmpp.xmlstream.xmlstream import NotConnectedError
from slixmpp.xmlstream.stanzabase import StanzaBase from slixmpp.xmlstream.stanzabase import StanzaBase

View file

@ -15,7 +15,6 @@ import pipes
import sys import sys
import shutil import shutil
import time import time
import uuid
from collections import defaultdict from collections import defaultdict
from typing import ( from typing import (
Any, Any,

View file

@ -4,19 +4,16 @@ XMPP-related handlers for the Core class
import logging import logging
from typing import Optional, Union from typing import Optional
import asyncio import asyncio
import curses import curses
import functools
import select import select
import signal import signal
import ssl import ssl
import sys import sys
import time import time
from datetime import datetime
from hashlib import sha1, sha256, sha512 from hashlib import sha1, sha256, sha512
from os import path
import pyasn1.codec.der.decoder import pyasn1.codec.der.decoder
import pyasn1.codec.der.encoder import pyasn1.codec.der.encoder
@ -25,8 +22,6 @@ from slixmpp import InvalidJID, JID, Message, Iq, Presence
from slixmpp.xmlstream.stanzabase import StanzaBase, ElementBase from slixmpp.xmlstream.stanzabase import StanzaBase, ElementBase
from xml.etree import ElementTree as ET from xml.etree import ElementTree as ET
from poezio import common
from poezio import fixes
from poezio import tabs from poezio import tabs
from poezio import xhtml from poezio import xhtml
from poezio import multiuserchat as muc from poezio import multiuserchat as muc
@ -36,12 +31,10 @@ from poezio.core.structs import Status
from poezio.contact import Resource from poezio.contact import Resource
from poezio.logger import logger from poezio.logger import logger
from poezio.roster import roster from poezio.roster import roster
from poezio.text_buffer import CorrectionError, AckError from poezio.text_buffer import AckError
from poezio.theming import dump_tuple, get_theme from poezio.theming import dump_tuple, get_theme
from poezio.ui.types import ( from poezio.ui.types import (
XMLLog, XMLLog,
Message as PMessage,
BaseMessage,
InfoMessage, InfoMessage,
PersistentInfoMessage, PersistentInfoMessage,
) )

View file

@ -5,17 +5,14 @@ upstream.
TODO: Check that they are fixed and remove those hacks TODO: Check that they are fixed and remove those hacks
""" """
import asyncio from slixmpp import ClientXMPP, Message
from typing import Callable, Any
from slixmpp import Message, Iq, ClientXMPP
from slixmpp.xmlstream import ET
import logging import logging
log = logging.getLogger(__name__) log = logging.getLogger(__name__)
def _filter_add_receipt_request(self, stanza): def _filter_add_receipt_request(self: ClientXMPP, stanza):
""" """
Auto add receipt requests to outgoing messages, if: Auto add receipt requests to outgoing messages, if:

View file

@ -5,7 +5,6 @@
from __future__ import annotations from __future__ import annotations
import asyncio
import logging import logging
from datetime import datetime, timedelta, timezone from datetime import datetime, timedelta, timezone
from hashlib import md5 from hashlib import md5

View file

@ -22,7 +22,6 @@ from slixmpp import JID, InvalidJID, Message as SMessage
from poezio.tabs.basetabs import OneToOneTab, Tab from poezio.tabs.basetabs import OneToOneTab, Tab
from poezio import common from poezio import common
from poezio import tabs
from poezio import windows from poezio import windows
from poezio import xhtml from poezio import xhtml
from poezio.config import config, get_image_cache from poezio.config import config, get_image_cache

View file

@ -10,7 +10,6 @@ log = logging.getLogger(__name__)
import curses import curses
import os import os
from typing import Union, Optional
from slixmpp import JID, InvalidJID from slixmpp import JID, InvalidJID
from slixmpp.xmlstream import matcher, StanzaBase from slixmpp.xmlstream import matcher, StanzaBase
from slixmpp.xmlstream.tostring import tostring from slixmpp.xmlstream.tostring import tostring

View file

@ -73,7 +73,6 @@ except ImportError:
import curses import curses
import functools import functools
import os
from typing import Dict, List, Union, Tuple, Optional, cast from typing import Dict, List, Union, Tuple, Optional, cast
from pathlib import Path from pathlib import Path
from os import path from os import path

View file

@ -1,5 +1,3 @@
from datetime import datetime
FORMAT_CHAR = '\x19' FORMAT_CHAR = '\x19'
# These are non-printable chars, so they should never appear in the input, # These are non-printable chars, so they should never appear in the input,
# I guess. But maybe we can find better chars that are even less risky. # I guess. But maybe we can find better chars that are even less risky.

View file

@ -12,7 +12,6 @@ A user is a MUC participant, not a roster contact (see contact.py)
import logging import logging
from datetime import timedelta, datetime from datetime import timedelta, datetime
from hashlib import md5 from hashlib import md5
from random import choice
from typing import Optional, Tuple from typing import Optional, Tuple
from poezio import xhtml, colors from poezio import xhtml, colors

View file

@ -5,7 +5,7 @@ Text inputs.
import curses import curses
import logging import logging
import string import string
from typing import List, Dict, Callable, Optional, ClassVar, Union from typing import List, Dict, Callable, Optional, ClassVar
from poezio import keyboard from poezio import keyboard
from poezio import common from poezio import common

View file

@ -6,11 +6,10 @@ import logging
log = logging.getLogger(__name__) log = logging.getLogger(__name__)
from datetime import datetime from datetime import datetime
from typing import Optional, List, Union, Dict from typing import Optional, List, Union
from poezio.windows.base_wins import Win from poezio.windows.base_wins import Win
from poezio import common
from poezio.config import config from poezio.config import config
from poezio.contact import Contact, Resource from poezio.contact import Contact, Resource
from poezio.roster import Roster, RosterGroup from poezio.roster import Roster, RosterGroup