mirror of
https://github.com/EDCD/EDMarketConnector.git
synced 2025-04-12 15:27:14 +03:00
[Nit] Cleanup some Flake8
This commit is contained in:
parent
56a4ae25e0
commit
b5a4ee6ed2
@ -467,7 +467,6 @@ def get_config(*args, **kwargs) -> AbstractConfig:
|
||||
:param kwargs: Args to be passed through to implementation.
|
||||
:return: Instance of the implementation.
|
||||
"""
|
||||
|
||||
if sys.platform == "win32": # pragma: sys-platform-win32
|
||||
from .windows import WinConfig
|
||||
return WinConfig(*args, **kwargs)
|
||||
|
@ -27,7 +27,6 @@ import os
|
||||
import pathlib
|
||||
import re
|
||||
import sqlite3
|
||||
import sys
|
||||
import tkinter as tk
|
||||
from platform import system
|
||||
from textwrap import dedent
|
||||
|
@ -26,6 +26,7 @@ is_wine = False
|
||||
|
||||
if sys.platform == 'win32':
|
||||
from ctypes import windll # type: ignore
|
||||
|
||||
try:
|
||||
if windll.ntdll.wine_get_version:
|
||||
is_wine = True
|
||||
@ -58,7 +59,7 @@ class GenericProtocolHandler:
|
||||
self.master.event_generate('<<CompanionAuthEvent>>', when="tail")
|
||||
|
||||
|
||||
if (config.auth_force_edmc_protocol
|
||||
if (config.auth_force_edmc_protocol # noqa: C901
|
||||
or (
|
||||
sys.platform == 'win32'
|
||||
and getattr(sys, 'frozen', False)
|
||||
@ -421,7 +422,6 @@ def get_handler_impl() -> Type[GenericProtocolHandler]:
|
||||
|
||||
:return: An instantiatable GenericProtocolHandler
|
||||
"""
|
||||
|
||||
if (
|
||||
(sys.platform == 'win32' and config.auth_force_edmc_protocol)
|
||||
or (getattr(sys, 'frozen', False) and not is_wine and not config.auth_force_localserver)
|
||||
|
@ -5,8 +5,8 @@ import numbers
|
||||
import sys
|
||||
import warnings
|
||||
from configparser import NoOptionError
|
||||
from os import getenv, makedirs, mkdir, pardir
|
||||
from os.path import dirname, expanduser, isdir, join, normpath
|
||||
from os import getenv, makedirs, mkdir
|
||||
from os.path import dirname, expanduser, isdir, join
|
||||
from typing import TYPE_CHECKING
|
||||
from config import applongname, appname, update_interval
|
||||
from EDMCLogging import get_main_logger
|
||||
@ -109,7 +109,7 @@ class OldConfig:
|
||||
OUT_EDDN_DELAY = 4096
|
||||
OUT_STATION_ANY = OUT_EDDN_SEND_STATION_DATA | OUT_MKT_TD | OUT_MKT_CSV
|
||||
|
||||
if sys.platform == 'win32':
|
||||
if sys.platform == 'win32': # noqa: C901
|
||||
|
||||
def __init__(self):
|
||||
self.app_dir = join(known_folder_path(FOLDERID_LocalAppData), appname) # type: ignore
|
||||
|
Loading…
x
Reference in New Issue
Block a user