Skip to content

Commit ea451f7

Browse files
committed
On second thought, nah
1 parent 881840c commit ea451f7

File tree

4 files changed

+9
-40
lines changed

4 files changed

+9
-40
lines changed

EDMarketConnector.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -184,12 +184,6 @@
184184
'--killswitches-file',
185185
help='Specify a custom killswitches file',
186186
)
187-
188-
parser.add_argument(
189-
'--ttk-catalog',
190-
help='Replace plugins with a catalog of Ttk widgets',
191-
action='store_true',
192-
)
193187
###########################################################################
194188

195189
args: argparse.Namespace = parser.parse_args()
@@ -226,9 +220,6 @@
226220
if args.eddn_tracking_ui:
227221
config.set_eddn_tracking_ui()
228222

229-
if args.ttk_catalog:
230-
config.set_ttk_catalog()
231-
232223
if args.force_edmc_protocol:
233224
if sys.platform == 'win32':
234225
config.set_auth_force_edmc_protocol()

config/__init__.py

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,6 @@ class AbstractConfig(abc.ABC):
202202
__auth_force_edmc_protocol = False # Should we force edmc:// protocol ?
203203
__eddn_url = None # Non-default EDDN URL
204204
__eddn_tracking_ui = False # Show EDDN tracking UI ?
205-
__ttk_catalog = False # Load Ttk catalog plugin ?
206205

207206
def __init__(self) -> None:
208207
self.home_path = pathlib.Path.home()
@@ -246,19 +245,6 @@ def auth_force_edmc_protocol(self) -> bool:
246245
"""
247246
return self.__auth_force_edmc_protocol
248247

249-
def set_ttk_catalog(self):
250-
"""Set flag to load the Ttk widget catalog plugin."""
251-
self.__ttk_catalog = True
252-
253-
@property
254-
def ttk_catalog(self) -> bool:
255-
"""
256-
Determine if the Ttk widget catalog plugin is loaded.
257-
258-
:return: bool - Should the Ttk catalog plugin be loaded?
259-
"""
260-
return self.__ttk_catalog
261-
262248
def set_eddn_url(self, eddn_url: str):
263249
"""Set the specified eddn URL."""
264250
self.__eddn_url = eddn_url

plugins/_ttk_catalog.py renamed to docs/examples/ttk_catalog/load.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,16 @@
77
88
Based on https://github.com/rdbende/Azure-ttk-theme/blob/main/example.py
99
"""
10+
import logging
11+
import os
1012
import tkinter as tk
1113
from tkinter import ttk
1214

13-
from EDMCLogging import get_main_logger
15+
from constants import appname
1416

15-
logger = get_main_logger()
17+
plugin_name = os.path.basename(os.path.dirname(__file__))
18+
19+
logger = logging.getLogger(f"{appname}.{plugin_name}")
1620

1721

1822
class Catalog(ttk.Frame):
@@ -291,7 +295,7 @@ def setup_widgets(self):
291295

292296

293297
def plugin_start3(path: str) -> str:
294-
return 'TtkCatalog'
298+
return plugin_name
295299

296300

297301
plugin_app = Catalog

plug.py

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -162,11 +162,8 @@ def load_plugins(master: tk.Tk) -> None:
162162
# Add plugin folder to load path so packages can be loaded from plugin folder
163163
sys.path.append(config.plugin_dir)
164164

165-
if config.ttk_catalog:
166-
PLUGINS.append(_load_ttk_catalog_plugin())
167-
else:
168-
found = _load_found_plugins()
169-
PLUGINS.extend(sorted(found, key=lambda p: operator.attrgetter('name')(p).lower()))
165+
found = _load_found_plugins()
166+
PLUGINS.extend(sorted(found, key=lambda p: operator.attrgetter('name')(p).lower()))
170167

171168

172169
def _load_internal_plugins():
@@ -182,15 +179,6 @@ def _load_internal_plugins():
182179
return internal
183180

184181

185-
def _load_ttk_catalog_plugin():
186-
try:
187-
plugin = Plugin('ttk_catalog', os.path.join(config.internal_plugin_dir_path, '_ttk_catalog.py'), logger)
188-
plugin.folder = None
189-
return plugin
190-
except Exception:
191-
logger.exception(f'Failure loading internal Plugin "ttk_catalog"')
192-
193-
194182
def _load_found_plugins():
195183
found = []
196184
# Load any plugins that are also packages first, but note it's *still*

0 commit comments

Comments
 (0)