PEP8 double aggressive E225 ~ E228 and E231

This commit is contained in:
persianpros
2021-04-14 00:13:49 +04:30
parent 8a0657cf33
commit 334f3e0ed9
13 changed files with 20 additions and 20 deletions

View File

@@ -557,7 +557,7 @@ class SetDiskLabel(Screen):
def __init__(self, session): def __init__(self, session):
global liczymy global liczymy
Screen.__init__(self, session) Screen.__init__(self, session)
self.labList = ['hdd', 'usb','card', 'cf'] self.labList = ['hdd', 'usb', 'card', 'cf']
self.list = [] self.list = []
self.sprDev() self.sprDev()
self.devlist = [] self.devlist = []

View File

@@ -12,13 +12,13 @@ LogFileObj = None
def Log(param=''): def Log(param=''):
global LogFileObj global LogFileObj
#first close object if exists #first close object if exists
if param.lower() in ['open','write','append','close']: if param.lower() in ['open', 'write', 'append', 'close']:
if LogFileObj is not None: if LogFileObj is not None:
LogFileObj.close() LogFileObj.close()
if LogFileObj.closed: if LogFileObj.closed:
LogFileObj = None LogFileObj = None
try: try:
with open('/tmp/NeoBoot.log','a') as f: with open('/tmp/NeoBoot.log', 'a') as f:
f.write('LogFile closed properly\n') f.write('LogFile closed properly\n')
f.close() f.close()
except Exception: except Exception:
@@ -27,7 +27,7 @@ def Log(param=''):
print("ERROR closing LogFile!!!") print("ERROR closing LogFile!!!")
#second create object if does not exist #second create object if does not exist
if LogFileObj is None: if LogFileObj is None:
if param.lower() in ['open','write']: if param.lower() in ['open', 'write']:
LogFileObj = open(LogFile, "w") LogFileObj = open(LogFile, "w")
elif param.lower() in ['append']: elif param.lower() in ['append']:
LogFileObj = open(LogFile, "a") LogFileObj = open(LogFile, "a")
@@ -415,7 +415,7 @@ def getBoxVuModel():
def getVuModel(): def getVuModel():
if fileExists("/proc/stb/info/vumodel") and not fileExists("/proc/stb/info/boxtype"): if fileExists("/proc/stb/info/vumodel") and not fileExists("/proc/stb/info/boxtype"):
brand = "Vu+" brand = "Vu+"
f = open("/proc/stb/info/vumodel",'r') f = open("/proc/stb/info/vumodel", 'r')
procmodel = f.readline().strip() procmodel = f.readline().strip()
f.close() f.close()
model = procmodel.title().replace("olose", "olo SE").replace("olo2se", "olo2 SE").replace("2", "²") model = procmodel.title().replace("olose", "olo SE").replace("olo2se", "olo2 SE").replace("2", "²")
@@ -473,13 +473,13 @@ def getImageDistroN():
f.close() f.close()
elif not fileExists('/.multinfo') and fileExists('/etc/vtiversion.info'): elif not fileExists('/.multinfo') and fileExists('/etc/vtiversion.info'):
f = open("/etc/vtiversion.info",'r') f = open("/etc/vtiversion.info", 'r')
imagever = f.readline().strip().replace("Release ", " ") imagever = f.readline().strip().replace("Release ", " ")
f.close() f.close()
image = imagever image = imagever
elif not fileExists('/.multinfo') and fileExists('/etc/bhversion'): elif not fileExists('/.multinfo') and fileExists('/etc/bhversion'):
f = open("/etc/bhversion",'r') f = open("/etc/bhversion", 'r')
imagever = f.readline().strip() imagever = f.readline().strip()
f.close() f.close()
image = imagever image = imagever

View File

@@ -463,7 +463,7 @@ class NeoBootInstallation(Screen):
os.system('rm -f /etc/neoimage; rm -f /etc/imageboot; rm -f %sImageBoot/.neonextboot; rm -f %sImageBoot/.version; rm -f %sImageBoot/.Flash; ' % (getNeoLocation(), getNeoLocation(), getNeoLocation())) os.system('rm -f /etc/neoimage; rm -f /etc/imageboot; rm -f %sImageBoot/.neonextboot; rm -f %sImageBoot/.version; rm -f %sImageBoot/.Flash; ' % (getNeoLocation(), getNeoLocation(), getNeoLocation()))
if os.path.isfile('%sImagesUpload/.kernel/zImage*.ipk or %sImagesUpload/.kernel/zImage*.bin' % (getNeoLocation(), getNeoLocation())): if os.path.isfile('%sImagesUpload/.kernel/zImage*.ipk or %sImagesUpload/.kernel/zImage*.bin' % (getNeoLocation(), getNeoLocation())):
os.system('rm -f %sImagesUpload/.kernel/zImage*.ipk; rm -f %sImagesUpload/.kernel/zImage*.bin' % (getNeoLocation(),getNeoLocation())) os.system('rm -f %sImagesUpload/.kernel/zImage*.ipk; rm -f %sImagesUpload/.kernel/zImage*.bin' % (getNeoLocation(), getNeoLocation()))
if fileExists('/etc/issue.net'): if fileExists('/etc/issue.net'):
try: try:
@@ -507,7 +507,7 @@ class NeoBootInstallation(Screen):
writefile.write(imagetype) writefile.write(imagetype)
writefile.close() writefile.close()
elif fileExists('/etc/vtiversion.info'): elif fileExists('/etc/vtiversion.info'):
f = open("/etc/vtiversion.info",'r') f = open("/etc/vtiversion.info", 'r')
imagever = f.readline().strip().replace("Release ", " ") imagever = f.readline().strip().replace("Release ", " ")
f.close() f.close()
image = imagever image = imagever
@@ -515,7 +515,7 @@ class NeoBootInstallation(Screen):
writefile.write(imagever) writefile.write(imagever)
writefile.close() writefile.close()
elif fileExists('/etc/bhversion'): elif fileExists('/etc/bhversion'):
f = open("/etc/bhversion",'r') f = open("/etc/bhversion", 'r')
imagever = f.readline().strip() imagever = f.readline().strip()
f.close() f.close()
image = imagever image = imagever

View File

@@ -2,7 +2,7 @@
#from __init__ import _ #from __init__ import _
from Plugins.Extensions.NeoBoot.__init__ import _ from Plugins.Extensions.NeoBoot.__init__ import _
from Plugins.Extensions.NeoBoot.files.stbbranding import getSupportedTuners, getCPUtype, getCPUSoC, getImageNeoBoot, getBoxHostName, getTunerModel, getNeoLocation, getNeoMount, getNeoMount2,getNeoMount3, getNeoMount4, getNeoMount5, getMountPointNeo2 from Plugins.Extensions.NeoBoot.files.stbbranding import getSupportedTuners, getCPUtype, getCPUSoC, getImageNeoBoot, getBoxHostName, getTunerModel, getNeoLocation, getNeoMount, getNeoMount2, getNeoMount3, getNeoMount4, getNeoMount5, getMountPointNeo2
from enigma import getDesktop from enigma import getDesktop
from enigma import eTimer from enigma import eTimer
from Screens.Screen import Screen from Screens.Screen import Screen

View File

@@ -2,7 +2,7 @@
#from __init__ import _ #from __init__ import _
from Plugins.Extensions.NeoBoot.__init__ import _ from Plugins.Extensions.NeoBoot.__init__ import _
from Plugins.Extensions.NeoBoot.files.stbbranding import getNeoLocation, getCPUtype, getCPUSoC, getImageNeoBoot, getBoxVuModel, getBoxHostName, getNeoMount, getNeoMount2,getNeoMount3, getNeoMount4, getNeoMount5, getMountPointNeo2 from Plugins.Extensions.NeoBoot.files.stbbranding import getNeoLocation, getCPUtype, getCPUSoC, getImageNeoBoot, getBoxVuModel, getBoxHostName, getNeoMount, getNeoMount2, getNeoMount3, getNeoMount4, getNeoMount5, getMountPointNeo2
from enigma import getDesktop from enigma import getDesktop
from enigma import eTimer from enigma import eTimer
from Screens.Screen import Screen from Screens.Screen import Screen

View File

@@ -2,7 +2,7 @@
#from __init__ import _ #from __init__ import _
from Plugins.Extensions.NeoBoot.__init__ import _ from Plugins.Extensions.NeoBoot.__init__ import _
from Plugins.Extensions.NeoBoot.files.stbbranding import getNeoLocation, getCPUtype, getCPUSoC, getImageNeoBoot, getBoxVuModel, getBoxHostName, getNeoMount, getNeoMount2,getNeoMount3, getNeoMount4, getNeoMount5, getMountPointNeo2 from Plugins.Extensions.NeoBoot.files.stbbranding import getNeoLocation, getCPUtype, getCPUSoC, getImageNeoBoot, getBoxVuModel, getBoxHostName, getNeoMount, getNeoMount2, getNeoMount3, getNeoMount4, getNeoMount5, getMountPointNeo2
from enigma import getDesktop from enigma import getDesktop
from enigma import eTimer from enigma import eTimer
from Screens.Screen import Screen from Screens.Screen import Screen

View File

@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
from Plugins.Extensions.NeoBoot.__init__ import _ from Plugins.Extensions.NeoBoot.__init__ import _
from Plugins.Extensions.NeoBoot.files.stbbranding import getSupportedTuners, getNeoLocation, getCPUtype, getCPUSoC, getImageNeoBoot, getBoxVuModel, getBoxHostName, getNeoMount, getNeoMount2,getNeoMount3, getNeoMount4, getNeoMount5, getMountPointNeo2 from Plugins.Extensions.NeoBoot.files.stbbranding import getSupportedTuners, getNeoLocation, getCPUtype, getCPUSoC, getImageNeoBoot, getBoxVuModel, getBoxHostName, getNeoMount, getNeoMount2, getNeoMount3, getNeoMount4, getNeoMount5, getMountPointNeo2
from enigma import getDesktop from enigma import getDesktop
from enigma import eTimer from enigma import eTimer
from Screens.Screen import Screen from Screens.Screen import Screen

View File

@@ -3,7 +3,7 @@
#from __init__ import _ #from __init__ import _
from Plugins.Extensions.NeoBoot.__init__ import _ from Plugins.Extensions.NeoBoot.__init__ import _
#from __future__ import print_function #from __future__ import print_function
from Plugins.Extensions.NeoBoot.files.stbbranding import getNeoLocation, getCPUtype, getCPUSoC, getImageNeoBoot, getBoxVuModel, getBoxHostName, getNeoMount, getNeoMount2,getNeoMount3, getNeoMount4, getNeoMount5, getMountPointNeo2 from Plugins.Extensions.NeoBoot.files.stbbranding import getNeoLocation, getCPUtype, getCPUSoC, getImageNeoBoot, getBoxVuModel, getBoxHostName, getNeoMount, getNeoMount2, getNeoMount3, getNeoMount4, getNeoMount5, getMountPointNeo2
from enigma import getDesktop from enigma import getDesktop
from enigma import eTimer from enigma import eTimer
from Screens.Screen import Screen from Screens.Screen import Screen

View File

@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
from Plugins.Extensions.NeoBoot.__init__ import _ from Plugins.Extensions.NeoBoot.__init__ import _
from Plugins.Extensions.NeoBoot.files.stbbranding import getNeoLocation, getCPUtype, getCPUSoC, getImageNeoBoot, getBoxVuModel, getBoxHostName, getNeoMount, getNeoMount2,getNeoMount3, getNeoMount4, getNeoMount5, getMountPointNeo2 from Plugins.Extensions.NeoBoot.files.stbbranding import getNeoLocation, getCPUtype, getCPUSoC, getImageNeoBoot, getBoxVuModel, getBoxHostName, getNeoMount, getNeoMount2, getNeoMount3, getNeoMount4, getNeoMount5, getMountPointNeo2
from enigma import getDesktop from enigma import getDesktop
from enigma import eTimer from enigma import eTimer
from Screens.Screen import Screen from Screens.Screen import Screen

View File

@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
from Plugins.Extensions.NeoBoot.__init__ import _ from Plugins.Extensions.NeoBoot.__init__ import _
from Plugins.Extensions.NeoBoot.files.stbbranding import getNeoLocation, getCPUtype, getCPUSoC, getImageNeoBoot, getBoxVuModel, getBoxHostName, getNeoMount, getNeoMount2,getNeoMount3, getNeoMount4, getNeoMount5, getMountPointNeo2 from Plugins.Extensions.NeoBoot.files.stbbranding import getNeoLocation, getCPUtype, getCPUSoC, getImageNeoBoot, getBoxVuModel, getBoxHostName, getNeoMount, getNeoMount2, getNeoMount3, getNeoMount4, getNeoMount5, getMountPointNeo2
from enigma import getDesktop from enigma import getDesktop
from enigma import eTimer from enigma import eTimer
from Screens.Screen import Screen from Screens.Screen import Screen

View File

@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
from Plugins.Extensions.NeoBoot.__init__ import _ from Plugins.Extensions.NeoBoot.__init__ import _
from Plugins.Extensions.NeoBoot.files.stbbranding import getNeoLocation, getCPUtype, getCPUSoC, getImageNeoBoot, getBoxVuModel, getBoxHostName, getNeoMount, getNeoMount2,getNeoMount3, getNeoMount4, getNeoMount5, getMountPointNeo2 from Plugins.Extensions.NeoBoot.files.stbbranding import getNeoLocation, getCPUtype, getCPUSoC, getImageNeoBoot, getBoxVuModel, getBoxHostName, getNeoMount, getNeoMount2, getNeoMount3, getNeoMount4, getNeoMount5, getMountPointNeo2
from enigma import getDesktop from enigma import getDesktop
from enigma import eTimer from enigma import eTimer
from Screens.Screen import Screen from Screens.Screen import Screen

View File

@@ -33,7 +33,7 @@ class description(object):
def get_blocks_in_list(blocks, idx_list): def get_blocks_in_list(blocks, idx_list):
return {i:blocks[i] for i in idx_list} return {i: blocks[i] for i in idx_list}
def extract_blocks(ubi): def extract_blocks(ubi):

View File

@@ -33,7 +33,7 @@ class description(object):
def get_blocks_in_list(blocks, idx_list): def get_blocks_in_list(blocks, idx_list):
return {i:blocks[i] for i in idx_list} return {i: blocks[i] for i in idx_list}
def extract_blocks(ubi): def extract_blocks(ubi):