diff --git a/bauh/util/util.py b/bauh/util/util.py index 4743e2e0..f6999540 100644 --- a/bauh/util/util.py +++ b/bauh/util/util.py @@ -1,6 +1,5 @@ import glob import locale -import re from bauh_api.util import system from bauh_api.util.resource import get_path @@ -8,8 +7,6 @@ from bauh_api.util.resource import get_path from bauh import ROOT_DIR, __app_name__ from bauh.core import resource -HTML_RE = re.compile(r'<[^>]+>') - def get_locale_keys(key: str = None, locale_dir: str = resource.get_path('locale')): @@ -45,9 +42,5 @@ def get_locale_keys(key: str = None, locale_dir: str = resource.get_path('locale return locale_obj -def strip_html(string: str): - return HTML_RE.sub('', string) - - def notify_user(msg: str, icon_path: str = get_path('img/logo.svg', ROOT_DIR)): system.notify_user(msg=msg, app_name=__app_name__, icon_path=icon_path) diff --git a/bauh/view/qt/apps_table.py b/bauh/view/qt/apps_table.py index f917027b..09c2489f 100644 --- a/bauh/view/qt/apps_table.py +++ b/bauh/view/qt/apps_table.py @@ -9,9 +9,9 @@ from PyQt5.QtWidgets import QTableWidget, QTableView, QMenu, QAction, QTableWidg QHeaderView, QLabel, QHBoxLayout, QPushButton, QToolBar from bauh_api.abstract.cache import MemoryCache from bauh_api.abstract.model import PackageStatus +from bauh_api.util.html import strip_html from bauh.core import resource -from bauh.util import util from bauh.view.qt import dialog from bauh.view.qt.view_model import PackageView, PackageViewStatus @@ -351,7 +351,7 @@ class AppsTable(QTableWidget): desc = '...' if desc and desc != '...': - desc = util.strip_html(desc[0:25]) + '...' + desc = strip_html(desc[0:25]) + '...' col.setText(desc) diff --git a/bauh/view/qt/info.py b/bauh/view/qt/info.py index 883d1d77..0cf7f824 100644 --- a/bauh/view/qt/info.py +++ b/bauh/view/qt/info.py @@ -4,7 +4,7 @@ from PyQt5.QtWidgets import QDialog, QVBoxLayout, QGroupBox, \ QLineEdit, QLabel, QGridLayout, QPushButton, QPlainTextEdit, QToolBar from bauh_api.abstract.cache import MemoryCache -from bauh.util import util +from bauh_api.util.html import strip_html IGNORED_ATTRS = {'name', '__app__'} @@ -63,7 +63,7 @@ class InfoDialog(QDialog): if len(val) > 80: full_val = val self.full_vals.append(full_val) - val = util.strip_html(val) + val = strip_html(val) val = val[0:80] + '...' text.setText(val)