Skip to content

Commit

Permalink
Fix lint.
Browse files Browse the repository at this point in the history
  • Loading branch information
horstle committed Aug 23, 2019
1 parent 9d6cfbc commit 2690f5a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
15 changes: 6 additions & 9 deletions lib/inputstreamhelper.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# -*- coding: utf-8 -*-
# -*- coding: utf-8 -*- # pylint: disable=too-many-lines
''' Implements the main InputStream Helper class '''
from __future__ import absolute_import, division, unicode_literals

Expand Down Expand Up @@ -240,12 +240,9 @@ def _cmd_exists(cmd):
def _update_temp_path(self, new_temp_path):
""""Updates temp_path and merges files."""
old_temp_path = self._temp_path()
progress_dialog = xbmcgui.DialogProgress()

progress_dialog.create("Updating temporary directory", "Merging files")
ADDON.setSetting('custom_temp_dir', new_temp_path)
shutil.move(old_temp_path, new_temp_path)
progress_dialog.close()

@staticmethod
def _helper_disabled():
Expand Down Expand Up @@ -623,7 +620,7 @@ def _install_widevine_x86(self):

return False

def _install_widevine_arm(self):
def _install_widevine_arm(self): # pylint: disable=too-many-statements
"""Installs Widevine CDM on ARM-based architectures."""
root_cmds = ['mount', 'umount', 'losetup', 'modprobe']
devices = self._chromeos_config()
Expand All @@ -640,12 +637,12 @@ def _install_widevine_arm(self):
return False

while required_diskspace >= self._diskspace():
if dialog.yesno(LANGUAGE(30004), LANGUAGE(30053)): # not enough space, alternative path?
self._update_temp_path(dialog.browseSingle(3, LANGUAGE(30909), 'files')) # temporary path
if xbmcgui.Dialog().yesno(LANGUAGE(30004), LANGUAGE(30053)): # not enough space, alternative path?
self._update_temp_path(xbmcgui.Dialog().browseSingle(3, LANGUAGE(30909), 'files')) # temporary path
continue
else:
dialog.ok(LANGUAGE(30004),
LANGUAGE(30018).format(self._sizeof_fmt(required_diskspace)))
xbmcgui.Dialog().ok(LANGUAGE(30004),
LANGUAGE(30018).format(self._sizeof_fmt(required_diskspace)))
return False

if not self._cmd_exists('fdisk') and not self._cmd_exists('parted'):
Expand Down
5 changes: 5 additions & 0 deletions test/xbmcgui.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ def yesno(heading, line1, line2=None, line3=None, nolabel=None, yeslabel=None, a
print('YESNO: [%s] %s' % (heading, line1))
return True

@staticmethod
def browseSingle(type, heading, shares, mask=None, useThumbs=None, treatAsFolder=None, default=None):
''' A stub implementation for the xbmcgui Dialog class browseSingle() method '''
print('BROWSESINGLE: [%s] %s' % (type, heading))
return '~/.kodi/userdata/addon_data/script.module.inputstreamhelper'

class DialogProgress:
''' A reimplementation of the xbmcgui DialogProgress '''
Expand Down

0 comments on commit 2690f5a

Please # to comment.