cleanup: got rid of some TODOs and other linter errors

This commit is contained in:
Sumner Evans
2020-05-26 21:51:21 -06:00
parent ec676a7c81
commit 73efabf537
6 changed files with 18 additions and 22 deletions

View File

@@ -1,6 +1,5 @@
import abc
import hashlib
import json
from dataclasses import dataclass
from datetime import timedelta
from enum import Enum

View File

@@ -521,10 +521,6 @@ class AdapterManager:
cache_key, param_str
)
# TODO
# TODO (#122) If any of the following fails, do we want to return what the
# caching adapter has?
if (
not allow_download
and AdapterManager._instance.ground_truth_adapter.is_networked
@@ -535,13 +531,6 @@ class AdapterManager:
raise CacheMissError(partial_data=partial_data)
return Result(cache_miss_result)
# TODO
# raise CacheMissError(partial_data=partial_data)
# # TODO (#122) indicate that this is partial data. Probably just re-throw
# # here?
# logging.debug("partial_data exists, returning", partial_data)
# return Result(cast(AdapterManager.R, partial_data))
# raise Exception(f"No adapters can service {function_name} at the moment.")
result: Result[AdapterManager.R] = AdapterManager._create_ground_truth_result(
function_name,
@@ -735,7 +724,6 @@ class AdapterManager:
not AdapterManager._ground_truth_can_do("get_cover_art_uri")
or not cover_art_id
):
# TODO return the placeholder
return ""
return AdapterManager._instance.ground_truth_adapter.get_cover_art_uri(

View File

@@ -91,9 +91,6 @@ class AppConfiguration:
prefetch_amount: int = 3
concurrent_download_limit: int = 5
# TODO this should probably be moved to the cache adapter settings
max_cache_size_mb: int = -1 # -1 means unlimited
# Deprecated
always_stream: bool = False # always stream instead of downloading songs

View File

@@ -34,7 +34,7 @@ class EditServerDialog(EditFormDialog):
super().__init__(*args, **kwargs)
# TODO figure out how to do this
# TODO (#197) figure out how to do this
# def on_test_server_clicked(self, event: Any):
# # Instantiate the server.
# server_address = self.data["server_address"].get_text()

View File

@@ -396,7 +396,7 @@ class MainWindow(Gtk.ApplicationWindow):
vbox.add(offline_box)
edit_button = self._create_model_button(
"Edit Configuration...", lambda _: print("edit")
"Edit Configuration...", self._on_edit_configuration_click
)
vbox.add(edit_button)
@@ -404,15 +404,15 @@ class MainWindow(Gtk.ApplicationWindow):
music_provider_button = self._create_model_button(
"Switch Music Provider",
lambda _: print("switch"),
self._on_switch_provider_click,
menu_name="switch-provider",
)
# TODO
# TODO (#197)
music_provider_button.set_action_name("app.configure-servers")
vbox.add(music_provider_button)
add_new_music_provider_button = self._create_model_button(
"Add New Music Provider...", lambda _: print("add new")
"Add New Music Provider...", self._on_add_new_provider_click
)
vbox.add(add_new_music_provider_button)
@@ -640,6 +640,18 @@ class MainWindow(Gtk.ApplicationWindow):
{"replay_gain": ReplayGainType.from_string(combo.get_active_id())}
)
def _on_edit_configuration_click(self, _):
# TODO (#197): EDIT
pass
def _on_switch_provider_click(self, _):
# TODO (#197): switch
pass
def _on_add_new_provider_click(self, _):
# TODO (#197) add new
pass
def _on_search_entry_focus(self, *args):
self._show_search()

View File

@@ -5,7 +5,7 @@ from typing import Any, cast, Iterable, List, Tuple
from fuzzywuzzy import process
from gi.repository import Gdk, Gio, GLib, GObject, Gtk, Pango
from sublime.adapters import AdapterManager, api_objects as API, CacheMissError
from sublime.adapters import AdapterManager, api_objects as API
from sublime.config import AppConfiguration
from sublime.ui import util
from sublime.ui.common import (