From 0c8c080aabc1b9d7d939ff3897332da90be161b7 Mon Sep 17 00:00:00 2001 From: Sumner Evans Date: Wed, 18 Mar 2020 15:24:09 -0600 Subject: [PATCH] Minimal necessary to get things running on macos --- sublime/app.py | 9 ++++----- sublime/config.py | 3 ++- sublime/state_manager.py | 3 +-- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/sublime/app.py b/sublime/app.py index 6f5dc4a..125113c 100644 --- a/sublime/app.py +++ b/sublime/app.py @@ -7,8 +7,7 @@ from typing import Any, Callable, Dict, Iterable, List, Optional, Tuple import gi gi.require_version('Gtk', '3.0') -gi.require_version('Notify', '0.7') -from gi.repository import Gdk, GdkPixbuf, Gio, GLib, Gtk, Notify +from gi.repository import Gdk, GdkPixbuf, Gio, GLib, Gtk from .cache_manager import CacheManager from .config import ReplayGainType @@ -24,7 +23,7 @@ from .ui.settings import SettingsDialog class SublimeMusicApp(Gtk.Application): def __init__(self, config_file: str): super().__init__(application_id="com.sumnerevans.sublimemusic") - Notify.init('Sublime Music') + # Notify.init('Sublime Music') self.window: Optional[Gtk.Window] = None self.state = ApplicationState() @@ -760,7 +759,7 @@ class SublimeMusicApp(Gtk.Application): return False def on_app_shutdown(self, app: 'SublimeMusicApp'): - Notify.uninit() + # Notify.uninit() if self.state.config.server is None: return @@ -874,7 +873,7 @@ class SublimeMusicApp(Gtk.Application): self.should_scrobble_song = True # Show a song play notification. - if self.state.config.song_play_notification: + if self.state.config.song_play_notification and False: try: notification_lines = [] if song.album: diff --git a/sublime/config.py b/sublime/config.py index 4c6fea9..7314d09 100644 --- a/sublime/config.py +++ b/sublime/config.py @@ -3,7 +3,7 @@ import os from enum import Enum from typing import Any, Dict, List, Optional -import keyring +# import keyring class ReplayGainType(Enum): @@ -52,6 +52,7 @@ class ServerConfiguration: self.local_network_ssid = local_network_ssid self.username = username self.sync_enabled = sync_enabled + self._password = password self.disable_cert_verify = disable_cert_verify # Try to save the password in the keyring, but if we can't, then save diff --git a/sublime/state_manager.py b/sublime/state_manager.py index 41e979f..a7e31e2 100644 --- a/sublime/state_manager.py +++ b/sublime/state_manager.py @@ -3,10 +3,8 @@ import os from enum import Enum from typing import Any, Dict, List, Optional, Set -import gi gi.require_version('NM', '1.0') from gi.repository import NM - from .cache_manager import CacheManager from .config import AppConfiguration from .from_json import from_json @@ -188,6 +186,7 @@ class ApplicationState: @property def current_ssids(self) -> Set[str]: + return set() if not self.nmclient_initialized: # Only look at the active WiFi connections. for ac in self.networkmanager_client.get_active_connections():