Closes #276: util.esc -> bleach.clean

Deprecates util.esc and replaces it with bleach.clean
which is way more featureful and stable
This commit is contained in:
Sumner Evans
2021-04-17 10:22:26 -06:00
parent 73990e5a1e
commit 08f4224014
7 changed files with 50 additions and 51 deletions

View File

@@ -8,6 +8,8 @@ from pathlib import Path
from time import sleep
from typing import Any, Callable, cast, Dict, Iterable, Optional, Tuple, Type, Union
import bleach
from gi.repository import GLib, GObject, Gtk, Pango
from . import ConfigurationStore
@@ -252,8 +254,6 @@ class ConfigureServerForm(Gtk.Box):
def _set_verification_status(
self, verifying: bool, is_valid: bool = False, error_text: str = None
):
from sublime_music.ui import util
if verifying:
if not self.verifying_in_progress:
for c in self.config_verification_box.get_children():
@@ -288,7 +288,7 @@ class ConfigureServerForm(Gtk.Box):
set_icon_and_label(
"config-ok-symbolic", "<b>Configuration is valid</b>"
)
elif escaped := util.esc(error_text):
elif escaped := bleach.clean(error_text or ""):
set_icon_and_label("config-error-symbolic", escaped)
self.config_verification_box.show_all()