исправлены недочёты

This commit is contained in:
roman committed 2022-03-14 21:38:43 +03:00
1 parent 5d2aff9bc5
commit ce96563230
6 files changed
+13 -8

No files matched your search

+2 -2
View File
@@ -42,7 +42,7 @@ utc_local_offset = math.ceil(calendar.timegm(time.localtime()) - time.time())
importlib.reload(sys)
# noinspection PyUnresolvedReferences
sys.setdefaultencoding('utf-8')
# sys.setdefaultencoding('utf-8')
TENSECS = 10 # type: int
MIN = 60 # type: int
@@ -166,7 +166,7 @@ def percent_to_secs(length, percent):
def format_secs(secs, id="time"):
# type: (int, str) -> str
if id == "time":
return "{:0>8}".format(datetime.timedelta(seconds=secs))
return "{:0>8}".format(str(datetime.timedelta(seconds=secs)))
if id == "skip":
prefix = "+"
if secs < 0:
+1 -1
View File
@@ -314,7 +314,7 @@ class Api(metaclass=abc.ABCMeta):
try:
log("request: %s" % request, xbmc.LOGDEBUG)
response = urllib.request.urlopen(request) # type: addinfourl
content_type = response.headers.getheader("content-type") # type: str
content_type = response.headers.get("content-type") # type: str
content = response.read()
if not content_type.startswith("application/json"):
return content
+3 -3
View File
@@ -2,9 +2,9 @@ import os
import shutil
from datetime import datetime
from ..skinutils import DocumentCache, get_current_skin_path, get_local_skin_path, is_invalid_local_skin, \
from skinutils import DocumentCache, get_current_skin_path, get_local_skin_path, is_invalid_local_skin, \
copy_skin_to_userdata, do_write_test, reload_skin, get_skin_name
from ..skinutils.fonts import FontManager as SkinUtilsFontManager
from skinutils.fonts import FontManager as SkinUtilsFontManager
class FontManagerException(Exception):
@@ -17,7 +17,7 @@ class FontManagerException(Exception):
super().__init__(*args)
class FontManager(object, SkinUtilsFontManager):
class FontManager(SkinUtilsFontManager):
FONTS = {
"script.module.iptvlib-font_MainMenu": "script.module.iptvlib-NotoSans-Bold.ttf",
"script.module.iptvlib-font30_title": "script.module.iptvlib-NotoSans-Bold.ttf",
+5
View File
@@ -53,6 +53,11 @@ class Model(object):
# value = value.decode('utf-8')
# except UnicodeError:
# value = value.encode('utf-8')
if not isinstance(value, str):
try:
value = str(value)
except:
value = value.decode('utf-8')
self._listitem.setProperty(key, value)
return self._listitem
+1 -1
View File
@@ -397,7 +397,7 @@ class TvDialog(xbmcgui.WindowXMLDialog, WindowMixin):
if action_id in [xbmcgui.ACTION_PREVIOUS_MENU, xbmcgui.ACTION_NAV_BACK]:
confirm = xbmcgui.Dialog()
yesno = bool(confirm.yesno(addon.getAddonInfo("name"), " ", get_string(TEXT_SURE_TO_EXIT_ID)))
yesno = bool(confirm.yesno(addon.getAddonInfo("name"), get_string(TEXT_SURE_TO_EXIT_ID)))
del confirm
if yesno is True:
self.main_window.close()