extracting strip_html

This commit is contained in:
Vinicius Moreira
2019-09-04 11:59:26 -03:00
parent a812355efa
commit 5d1905a988
3 changed files with 4 additions and 11 deletions

View File

@@ -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)