mirror of
https://github.com/EDCD/EDMarketConnector.git
synced 2025-04-08 05:20:03 +03:00
Cleaned up imports, removed incase imports
closes EDCD/EDMarketConnector#569
This commit is contained in:
parent
f3b8df6548
commit
fe90f1f0b3
3
EDMC.py
3
EDMC.py
@ -19,9 +19,8 @@ os.environ["EDMC_NO_UI"] = "1"
|
||||
# See EDMCLogging.py docs.
|
||||
# workaround for https://github.com/EDCD/EDMarketConnector/issues/568
|
||||
from EDMCLogging import edmclogger, logger, logging
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from logging import trace, TRACE # type: ignore # noqa: F401
|
||||
from logging import TRACE # type: ignore # noqa: F401 # needed to make mypy happy
|
||||
|
||||
edmclogger.set_channels_loglevel(logging.INFO)
|
||||
|
||||
|
@ -262,10 +262,10 @@ if __name__ == '__main__': # noqa: C901
|
||||
# See EDMCLogging.py docs.
|
||||
# isort: off
|
||||
if TYPE_CHECKING:
|
||||
from logging import trace, TRACE # type: ignore # noqa: F401
|
||||
import update
|
||||
from logging import TRACE # type: ignore # noqa: F401 # Needed to update mypy
|
||||
# import update
|
||||
# from infi.systray import SysTrayIcon
|
||||
# isort: on
|
||||
# isort: on
|
||||
|
||||
def _(x: str) -> str:
|
||||
"""Fake the l10n translation functions for typing."""
|
||||
|
@ -19,8 +19,6 @@ import urllib.parse
|
||||
import webbrowser
|
||||
from builtins import object, range, str
|
||||
from email.utils import parsedate
|
||||
# TODO: see https://github.com/EDCD/EDMarketConnector/issues/569
|
||||
from http.cookiejar import LWPCookieJar # noqa: F401 - No longer needed but retained in case plugins use it
|
||||
from os.path import join
|
||||
from typing import TYPE_CHECKING, Any, Dict, List, Mapping, Optional, OrderedDict, TypeVar, Union
|
||||
|
||||
|
20
plug.py
20
plug.py
@ -1,21 +1,18 @@
|
||||
"""
|
||||
Plugin hooks for EDMC - Ian Norton, Jonathan Harris
|
||||
"""
|
||||
from builtins import str
|
||||
from builtins import object
|
||||
import os
|
||||
import importlib
|
||||
import sys
|
||||
import logging
|
||||
import operator
|
||||
import threading # noqa: F401 - We don't use it, but plugins might
|
||||
from typing import Optional
|
||||
import os
|
||||
import sys
|
||||
import tkinter as tk
|
||||
from builtins import object, str
|
||||
from typing import Optional
|
||||
|
||||
import myNotebook as nb # noqa: N813
|
||||
|
||||
from config import appcmdname, appname, config
|
||||
from config import config
|
||||
from EDMCLogging import get_main_logger
|
||||
import logging
|
||||
|
||||
logger = get_main_logger()
|
||||
|
||||
@ -140,7 +137,7 @@ def load_plugins(master):
|
||||
found = []
|
||||
# Load any plugins that are also packages first
|
||||
for name in sorted(os.listdir(config.plugin_dir_path),
|
||||
key = lambda n: (not os.path.isfile(os.path.join(config.plugin_dir_path, n, '__init__.py')), n.lower())):
|
||||
key=lambda n: (not os.path.isfile(os.path.join(config.plugin_dir_path, n, '__init__.py')), n.lower())):
|
||||
if not os.path.isdir(os.path.join(config.plugin_dir_path, name)) or name[0] in ['.', '_']:
|
||||
pass
|
||||
elif name.endswith('.disabled'):
|
||||
@ -172,6 +169,7 @@ def provides(fn_name):
|
||||
"""
|
||||
return [p.name for p in PLUGINS if p._get_func(fn_name)]
|
||||
|
||||
|
||||
def invoke(plugin_name, fallback, fn_name, *args):
|
||||
"""
|
||||
Invoke a function on a named plugin
|
||||
@ -187,7 +185,7 @@ def invoke(plugin_name, fallback, fn_name, *args):
|
||||
return plugin._get_func(fn_name)(*args)
|
||||
for plugin in PLUGINS:
|
||||
if plugin.name == fallback:
|
||||
assert plugin._get_func(fn_name), plugin.name # fallback plugin should provide the function
|
||||
assert plugin._get_func(fn_name), plugin.name # fallback plugin should provide the function
|
||||
return plugin._get_func(fn_name)(*args)
|
||||
|
||||
|
||||
|
@ -9,19 +9,19 @@
|
||||
# 4) Ensure the EDSM API call(back) for setting the image at end of system
|
||||
# text is always fired. i.e. CAPI cmdr_data() processing.
|
||||
|
||||
from companion import CAPIData
|
||||
import json
|
||||
import sys
|
||||
import tkinter as tk
|
||||
from queue import Queue
|
||||
from threading import Thread
|
||||
from typing import TYPE_CHECKING, Any, List, Mapping, MutableMapping, Optional, Tuple, cast
|
||||
from typing import TYPE_CHECKING, Any, List, Mapping, MutableMapping, Optional, Tuple
|
||||
|
||||
import requests
|
||||
|
||||
import killswitch
|
||||
import myNotebook as nb # noqa: N813
|
||||
import plug
|
||||
from companion import CAPIData
|
||||
from config import applongname, appversion, config
|
||||
from EDMCLogging import get_main_logger
|
||||
from ttkHyperlinkLabel import HyperlinkLabel
|
||||
@ -629,11 +629,11 @@ def worker() -> None:
|
||||
else:
|
||||
|
||||
if msg_num // 100 == 1:
|
||||
# logger.trace('Overall OK')
|
||||
# logger.trace('Overall OK')
|
||||
pass
|
||||
|
||||
elif msg_num // 100 == 5:
|
||||
# logger.trace('Event(s) not currently processed, but saved for later')
|
||||
# logger.trace('Event(s) not currently processed, but saved for later')
|
||||
pass
|
||||
|
||||
else:
|
||||
|
2
setup.py
2
setup.py
@ -191,6 +191,8 @@ elif sys.platform == 'win32':
|
||||
'shutil', # Included for plugins
|
||||
'timeout_session',
|
||||
'zipfile', # Included for plugins
|
||||
'threading', # Included for plugins (though it should always be there anyway)
|
||||
'http', # Included for plugins
|
||||
],
|
||||
'excludes': [
|
||||
'distutils',
|
||||
|
6
td.py
6
td.py
@ -1,13 +1,11 @@
|
||||
# Export to Trade Dangerous
|
||||
|
||||
from os.path import join
|
||||
import time
|
||||
from collections import defaultdict
|
||||
import codecs
|
||||
import numbers
|
||||
from operator import itemgetter
|
||||
from os.path import join
|
||||
from platform import system
|
||||
from sys import platform
|
||||
import time
|
||||
|
||||
from config import applongname, appversion, config
|
||||
|
||||
|
4
theme.py
4
theme.py
@ -12,14 +12,14 @@ from sys import platform
|
||||
from tkinter import font as tkFont
|
||||
from tkinter import ttk
|
||||
|
||||
from config import applongname, appname, config
|
||||
from config import config
|
||||
from ttkHyperlinkLabel import HyperlinkLabel
|
||||
|
||||
if __debug__:
|
||||
from traceback import print_exc
|
||||
|
||||
if platform == "linux":
|
||||
from ctypes import POINTER, c_char_p, c_int, c_long, c_uint, c_ulong, c_void_p, cdll, Structure, byref
|
||||
from ctypes import POINTER, Structure, byref, c_char_p, c_int, c_long, c_uint, c_ulong, c_void_p, cdll
|
||||
|
||||
|
||||
if platform == 'win32':
|
||||
|
Loading…
x
Reference in New Issue
Block a user