Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[2186] Refine macOS Removal #2200

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ exclude =
FDevIDs/
venv/
.venv/
hotkey/darwin.py # FIXME: Check under macOS VM at some point

# Show exactly where in a line the error happened
#show-source = True
Expand Down
1 change: 0 additions & 1 deletion .mypy.ini
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,4 @@ scripts_are_modules = True
; `<var> = <value>`
; i.e. no typing info.
check_untyped_defs = True
; platform = darwin
explicit_package_bases = True
2 changes: 1 addition & 1 deletion Contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -679,7 +679,7 @@ the following does not work:

```py
from sys import platform
if platform == 'darwin':
if platform == 'win32':
...
```

Expand Down
358 changes: 136 additions & 222 deletions EDMarketConnector.py

Large diffs are not rendered by default.

24 changes: 0 additions & 24 deletions L10n/en.template
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,6 @@
/* EDMarketConnector.py: 'Edit' menu title on OSX; EDMarketConnector.py: 'Edit' menu title; In files: EDMarketConnector.py:922; EDMarketConnector.py:940; EDMarketConnector.py:943; */
"Edit" = "Edit";

/* EDMarketConnector.py: 'View' menu title on OSX; In files: EDMarketConnector.py:923; */
"View" = "View";

/* EDMarketConnector.py: 'Window' menu title on OSX; In files: EDMarketConnector.py:924; */
"Window" = "Window";

/* EDMarketConnector.py: Help' menu title on OSX; EDMarketConnector.py: 'Help' menu title; In files: EDMarketConnector.py:925; EDMarketConnector.py:941; EDMarketConnector.py:944; */
"Help" = "Help";

Expand Down Expand Up @@ -351,9 +345,6 @@
/* inara.py: INARA API returned some kind of error (error message will be contained in {MSG}); In files: inara.py:1650; inara.py:1663; */
"Error: Inara {MSG}" = "Error: Inara {MSG}";

/* prefs.py: File > Preferences menu entry for macOS; In files: prefs.py:237; */
"Preferences" = "Preferences";

/* prefs.py: Settings > Output - choosing what data to save to files; In files: prefs.py:335; */
"Please choose what data to save" = "Please choose what data to save";

Expand All @@ -372,9 +363,6 @@
/* prefs.py: Settings > Output - Label for "where files are located"; In files: prefs.py:379; prefs.py:398; */
"File location" = "File location";

/* prefs.py: macOS Preferences - files location selection button; In files: prefs.py:387; prefs.py:437; */
"Change..." = "Change...";

/* prefs.py: NOT-macOS Settings - files location selection button; prefs.py: NOT-macOS Setting - files location selection button; In files: prefs.py:390; prefs.py:440; */
"Browse..." = "Browse...";

Expand All @@ -390,21 +378,9 @@
/* prefs.py: Configuration - Enable or disable the Fleet Carrier CAPI calls; In files: prefs.py:475; */
"Enable Fleetcarrier CAPI Queries" = "Enable Fleetcarrier CAPI Queries";

/* prefs.py: Hotkey/Shortcut settings prompt on OSX; In files: prefs.py:490; */
"Keyboard shortcut" = "Keyboard shortcut";

/* prefs.py: Hotkey/Shortcut settings prompt on Windows; In files: prefs.py:492; */
"Hotkey" = "Hotkey";

/* prefs.py: macOS Preferences > Configuration - restart the app message; In files: prefs.py:501; */
"Re-start {APP} to use shortcuts" = "Re-start {APP} to use shortcuts";

/* prefs.py: macOS - Configuration - need to grant the app permission for keyboard shortcuts; In files: prefs.py:510; */
"{APP} needs permission to use shortcuts" = "{APP} needs permission to use shortcuts";

/* prefs.py: Shortcut settings button on OSX; In files: prefs.py:515; */
"Open System Preferences" = "Open System Preferences";

/* prefs.py: Configuration - Act on hotkey only when ED is in foreground; In files: prefs.py:538; */
"Only when Elite: Dangerous is the active app" = "Only when Elite: Dangerous is the active app";

Expand Down
2 changes: 0 additions & 2 deletions build.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,8 @@ def generate_data_files(
"ChangeLog.md",
"snd_good.wav",
"snd_bad.wav",
"modules.p", # TODO: Remove in 6.0
"modules.json",
"ships.json",
"ships.p", # TODO: Remove in 6.0
f"{app_name}.ico",
f"resources/{appcmdname}.ico",
"EDMarketConnector - TRACE.bat",
Expand Down
7 changes: 1 addition & 6 deletions config/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

Windows uses the Registry to store values in a flat manner.
Linux uses a file, but for commonality it's still a flat data structure.
macOS uses a 'defaults' object.
"""
from __future__ import annotations

Expand Down Expand Up @@ -54,7 +53,7 @@
# <https://semver.org/#semantic-versioning-specification-semver>
# Major.Minor.Patch(-prerelease)(+buildmetadata)
# NB: Do *not* import this, use the functions appversion() and appversion_nobuild()
_static_appversion = '5.10.3'
_static_appversion = '5.11.0-alpha0'

_cached_version: semantic_version.Version | None = None
copyright = '© 2015-2019 Jonathan Harris, 2020-2024 EDCD'
Expand Down Expand Up @@ -468,10 +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 == "darwin": # pragma: sys-platform-darwin
from .darwin import MacConfig
return MacConfig(*args, **kwargs)

if sys.platform == "win32": # pragma: sys-platform-win32
from .windows import WinConfig
return WinConfig(*args, **kwargs)
Expand Down
191 changes: 0 additions & 191 deletions config/darwin.py

This file was deleted.

6 changes: 3 additions & 3 deletions dashboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@

logger = get_main_logger()

if sys.platform in ('darwin', 'win32'):
if sys.platform == 'win32':
from watchdog.events import FileSystemEventHandler
from watchdog.observers import Observer
else:
# Linux's inotify doesn't work over CIFS or NFS, so poll
class FileSystemEventHandler: # type: ignore
"""Dummy class to represent a file system event handler on platforms other than macOS and Windows."""
"""Dummy class to represent a file system event handler on platforms other than Windows."""


class Dashboard(FileSystemEventHandler):
Expand Down Expand Up @@ -160,7 +160,7 @@ def poll(self, first_time: bool = False) -> None:

def on_modified(self, event) -> None:
"""
Watchdog callback - DirModifiedEvent on macOS, FileModifiedEvent on Windows.
Watchdog callback - FileModifiedEvent on Windows.

:param event: Watchdog event.
"""
Expand Down
6 changes: 3 additions & 3 deletions docs/examples/click_counter/load.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def on_unload(self) -> None:
"""
self.on_preferences_closed("", False) # Save our prefs

def setup_preferences(self, parent: nb.Notebook, cmdr: str, is_beta: bool) -> tk.Frame | None:
def setup_preferences(self, parent: nb.Notebook, cmdr: str, is_beta: bool) -> nb.Frame | None:
"""
setup_preferences is called by plugin_prefs below.

Expand All @@ -63,7 +63,7 @@ def setup_preferences(self, parent: nb.Notebook, cmdr: str, is_beta: bool) -> tk

# setup our config in a "Click Count: number"
nb.Label(frame, text='Click Count').grid(row=current_row)
nb.Entry(frame, textvariable=self.click_count).grid(row=current_row, column=1)
nb.EntryMenu(frame, textvariable=self.click_count).grid(row=current_row, column=1)
current_row += 1 # Always increment our row counter, makes for far easier tkinter design.
return frame

Expand Down Expand Up @@ -126,7 +126,7 @@ def plugin_stop() -> None:
return cc.on_unload()


def plugin_prefs(parent: nb.Notebook, cmdr: str, is_beta: bool) -> tk.Frame | None:
def plugin_prefs(parent: nb.Notebook, cmdr: str, is_beta: bool) -> nb.Frame | None:
"""
Handle preferences tab for the plugin.

Expand Down
4 changes: 0 additions & 4 deletions hotkey/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,6 @@ def get_hotkeymgr() -> AbstractHotkeyMgr:
:return: Appropriate class instance.
:raises ValueError: If unsupported platform.
"""
if sys.platform == 'darwin':
from hotkey.darwin import MacHotkeyMgr
return MacHotkeyMgr()

if sys.platform == 'win32':
from hotkey.windows import WindowsHotkeyMgr
return WindowsHotkeyMgr()
Expand Down
Loading