mirror of
https://github.com/gutosie/neoboot.git
synced 2025-10-26 01:46:06 +02:00
PEP8 double aggressive E301 ~ E306
This commit is contained in:
@@ -8,6 +8,7 @@ import gettext
|
||||
PluginLanguageDomain = 'NeoBoot'
|
||||
PluginLanguagePath = 'Extensions/NeoBoot/locale'
|
||||
|
||||
|
||||
def localeInit():
|
||||
lang = language.getLanguage()[:2]
|
||||
os.environ['LANGUAGE'] = lang
|
||||
|
||||
@@ -8,9 +8,12 @@ import shutil
|
||||
|
||||
# ver. gutosie
|
||||
#--------------------------------------------- 2021 ---------------------------------------------#
|
||||
|
||||
|
||||
def NEOBootMainEx(source, target, stopenigma, CopyFiles, CopyKernel, TvList, LanWlan, Sterowniki, InstallSettings, ZipDelete, RepairFTP, SoftCam, MediaPortal, PiconR, Kodi, BlackHole):
|
||||
NEOBootR(source, target, stopenigma, CopyFiles, CopyKernel, TvList, LanWlan, Sterowniki, InstallSettings, ZipDelete, RepairFTP, SoftCam, MediaPortal, PiconR, Kodi, BlackHole)
|
||||
|
||||
|
||||
def LanguageUsed():
|
||||
language = ''
|
||||
lang = open('/etc/enigma2/settings', 'r')
|
||||
@@ -22,6 +25,7 @@ def LanguageUsed():
|
||||
language = 'No'
|
||||
return language
|
||||
|
||||
|
||||
def getBoxHostName():
|
||||
if os.path.exists('/etc/hostname'):
|
||||
with open('/etc/hostname', 'r') as f:
|
||||
@@ -29,6 +33,7 @@ def getBoxHostName():
|
||||
f.close()
|
||||
return myboxname
|
||||
|
||||
|
||||
def getCPUSoC():
|
||||
chipset = 'UNKNOWN'
|
||||
if os.path.exists('/proc/stb/info/chipset'):
|
||||
@@ -40,6 +45,7 @@ def getCPUSoC():
|
||||
|
||||
return chipset
|
||||
|
||||
|
||||
def getBoxVuModel():
|
||||
vumodel = 'UNKNOWN'
|
||||
if os.path.exists("/proc/stb/info/vumodel") and not os.path.exists("/proc/stb/info/boxtype"):
|
||||
@@ -48,6 +54,7 @@ def getBoxVuModel():
|
||||
f.close()
|
||||
return vumodel
|
||||
|
||||
|
||||
def getCPUtype():
|
||||
cpu = 'UNKNOWN'
|
||||
if os.path.exists('/proc/cpuinfo'):
|
||||
@@ -60,12 +67,14 @@ def getCPUtype():
|
||||
cpu = 'MIPS'
|
||||
return cpu
|
||||
|
||||
|
||||
def getKernelVersion():
|
||||
try:
|
||||
return open('/proc/version', 'r').read().split(' ', 4)[2].split('-', 2)[0]
|
||||
except:
|
||||
return _('unknown')
|
||||
|
||||
|
||||
def getNeoLocation():
|
||||
locatino = 'UNKNOWN'
|
||||
if os.path.exists('/usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/.location'):
|
||||
@@ -672,6 +681,7 @@ def NEOBootMainEx(source, target, stopenigma, CopyFiles, CopyKernel, TvList, Lan
|
||||
os.system('echo "End of installation:"; date +%T')
|
||||
os.system('echo "If you want to save the installation process from the console press green."')
|
||||
|
||||
|
||||
def RemoveUnpackDirs():
|
||||
os.chdir(media + '/ImagesUpload')
|
||||
if os.path.exists('' + getNeoLocation() + 'ImagesUpload/unpackedzip'):
|
||||
@@ -1007,7 +1017,6 @@ def NEOBootExtract(source, target, ZipDelete):
|
||||
os.chdir('osmini')
|
||||
brand = 'osmini'
|
||||
|
||||
|
||||
#Instalacja image nandsim
|
||||
os.system('echo "Instalacja - nandsim w toku..."')
|
||||
rc = os.system('insmod /lib/modules/' + getKernelVersion() + '/kernel/drivers/mtd/nand/nandsim.ko cache_file=' + getNeoLocation() + 'image_cache first_id_byte=0x20 second_id_byte=0xaa third_id_byte=0x00 fourth_id_byte=0x15;sleep 5')#% getKernelVersion())
|
||||
|
||||
@@ -23,12 +23,14 @@ from Components.Label import Label
|
||||
from Components.Pixmap import Pixmap
|
||||
from Screens.MessageBox import MessageBox
|
||||
|
||||
|
||||
def readFile(filename):
|
||||
file = open(filename)
|
||||
data = file.read().strip()
|
||||
file.close()
|
||||
return data
|
||||
|
||||
|
||||
def getProcMounts():
|
||||
try:
|
||||
mounts = open('/proc/mounts', 'r')
|
||||
@@ -69,6 +71,7 @@ def findMountPoint(path):
|
||||
DEVTYPE_UDEV = 0
|
||||
DEVTYPE_DEVFS = 1
|
||||
|
||||
|
||||
class Harddisk():
|
||||
|
||||
def __init__(self, device, removable=False):
|
||||
@@ -1030,6 +1033,7 @@ class HarddiskFsckSelection(HarddiskSelection):
|
||||
|
||||
harddiskmanager = HarddiskManager()
|
||||
|
||||
|
||||
def isSleepStateDevice(device):
|
||||
ret = os.popen('hdparm -C %s' % device).read()
|
||||
if 'SG_IO' in ret or 'HDIO_DRIVE_CMD' in ret:
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
from Tools.CList import CList
|
||||
|
||||
|
||||
class Job(object):
|
||||
NOT_STARTED, IN_PROGRESS, FINISHED, FAILED = range(4)
|
||||
|
||||
|
||||
@@ -8,6 +8,7 @@ import gettext
|
||||
PluginLanguageDomain = 'NeoBoot'
|
||||
PluginLanguagePath = 'Extensions/NeoBoot/locale'
|
||||
|
||||
|
||||
def localeInit():
|
||||
lang = language.getLanguage()[:2]
|
||||
os.environ['LANGUAGE'] = lang
|
||||
|
||||
@@ -65,7 +65,6 @@ class ManagerDevice(Screen):
|
||||
<widget name="lab1" zPosition="2" position="29,111" size="699,40" font="Regular;22" halign="center" transparent="1" />
|
||||
</screen>"""
|
||||
|
||||
|
||||
def __init__(self, session):
|
||||
Screen.__init__(self, session)
|
||||
Screen.setTitle(self, _('Mount Manager'))
|
||||
@@ -499,9 +498,6 @@ class DevicesConf(Screen, ConfigListScreen):
|
||||
# out2.close()
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#SetDiskLabel - dziekuje autorowi
|
||||
class SetDiskLabel(Screen):
|
||||
screenwidth = getDesktop(0).size().width()
|
||||
|
||||
@@ -9,6 +9,7 @@ LinkNeoBoot = '/usr/lib/enigma2/python/Plugins/Extensions/NeoBoot'
|
||||
|
||||
LogFileObj = None
|
||||
|
||||
|
||||
def Log(param=''):
|
||||
global LogFileObj
|
||||
#first close object if exists
|
||||
@@ -37,22 +38,27 @@ def Log(param=''):
|
||||
LogFileObj.flush()
|
||||
return LogFileObj
|
||||
|
||||
|
||||
def clearMemory():
|
||||
with open("/proc/sys/vm/drop_caches", "w") as f:
|
||||
f.write("1\n")
|
||||
f.close()
|
||||
|
||||
|
||||
def LogCrashGS(line):
|
||||
log_file = open('%sImageBoot/neoboot.log' % getNeoLocation(), 'a')
|
||||
log_file.write(line)
|
||||
log_file.close()
|
||||
|
||||
|
||||
def fileCheck(f, mode='r'):
|
||||
return fileExists(f, mode) and f
|
||||
|
||||
# if not IsImageName():
|
||||
# from Components.PluginComponent import plugins
|
||||
# plugins.reloadPlugins()
|
||||
|
||||
|
||||
def IsImageName():
|
||||
if fileExists("/etc/issue"):
|
||||
for line in open("/etc/issue"):
|
||||
@@ -60,6 +66,7 @@ def IsImageName():
|
||||
return True
|
||||
return False
|
||||
|
||||
|
||||
def mountp():
|
||||
pathmp = []
|
||||
if os.path.isfile('/proc/mounts'):
|
||||
@@ -71,6 +78,7 @@ def mountp():
|
||||
pathmp.append('/tmp/')
|
||||
return pathmp
|
||||
|
||||
|
||||
def getSupportedTuners():
|
||||
supportedT = ''
|
||||
if os.path.exists('/usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/stbinfo.cfg'):
|
||||
@@ -81,6 +89,7 @@ def getSupportedTuners():
|
||||
supportedT = '%s' % getBoxHostName()
|
||||
return supportedT
|
||||
|
||||
|
||||
def getFreespace(dev):
|
||||
statdev = os.statvfs(dev)
|
||||
space = statdev.f_bavail * statdev.f_frsize / 1024
|
||||
@@ -88,6 +97,8 @@ def getFreespace(dev):
|
||||
return space
|
||||
|
||||
#check install
|
||||
|
||||
|
||||
def getCheckInstal1():
|
||||
neocheckinstal = 'UNKNOWN'
|
||||
if os.path.exists('/usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/bin/install'):
|
||||
@@ -98,6 +109,7 @@ def getCheckInstal1():
|
||||
neocheckinstal = '1'
|
||||
return neocheckinstal
|
||||
|
||||
|
||||
def getCheckInstal2():
|
||||
neocheckinstal = 'UNKNOWN'
|
||||
if os.path.exists('/usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/.location'):
|
||||
@@ -108,6 +120,7 @@ def getCheckInstal2():
|
||||
neocheckinstal = '2'
|
||||
return neocheckinstal
|
||||
|
||||
|
||||
def getCheckInstal3():
|
||||
neocheckinstal = 'UNKNOWN'
|
||||
if os.path.exists('/usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/files/neo.sh'):
|
||||
@@ -120,6 +133,8 @@ def getCheckInstal3():
|
||||
return neocheckinstal
|
||||
|
||||
#check imageATV
|
||||
|
||||
|
||||
def getImageATv():
|
||||
atvimage = 'UNKNOWN'
|
||||
if os.path.exists('/etc/issue.net'):
|
||||
@@ -131,6 +146,8 @@ def getImageATv():
|
||||
return atvimage
|
||||
|
||||
#check install
|
||||
|
||||
|
||||
def getNeoLocation():
|
||||
locatino = 'UNKNOWN'
|
||||
if os.path.exists('/usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/.location'):
|
||||
@@ -177,6 +194,8 @@ def getNEO_filesystems():
|
||||
return neo_filesystems
|
||||
|
||||
#typ procesora arm lub mips
|
||||
|
||||
|
||||
def getCPUtype():
|
||||
cpu = 'UNKNOWN'
|
||||
if os.path.exists('/proc/cpuinfo'):
|
||||
@@ -190,6 +209,8 @@ def getCPUtype():
|
||||
return cpu
|
||||
|
||||
#check install
|
||||
|
||||
|
||||
def getFSTAB():
|
||||
install = 'UNKNOWN'
|
||||
if os.path.exists('/usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/bin/reading_blkid'):
|
||||
@@ -202,6 +223,7 @@ def getFSTAB():
|
||||
install = 'NOUUID'
|
||||
return install
|
||||
|
||||
|
||||
def getFSTAB2():
|
||||
install = 'UNKNOWN'
|
||||
if os.path.exists('/etc/fstab'):
|
||||
@@ -214,6 +236,7 @@ def getFSTAB2():
|
||||
install = 'NOUUID'
|
||||
return install
|
||||
|
||||
|
||||
def getINSTALLNeo():
|
||||
neoinstall = 'UNKNOWN'
|
||||
if os.path.exists('/usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/bin/installNeo'):
|
||||
@@ -261,6 +284,7 @@ def getLocationMultiboot():
|
||||
|
||||
return LocationMultiboot
|
||||
|
||||
|
||||
def getLabelDisck():
|
||||
label = 'UNKNOWN'
|
||||
if os.path.exists('/usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/bin/reading_blkid'):
|
||||
@@ -272,6 +296,8 @@ def getLabelDisck():
|
||||
return label
|
||||
|
||||
#checking device neo
|
||||
|
||||
|
||||
def getNeoMount():
|
||||
neo = 'UNKNOWN'
|
||||
if os.path.exists('/proc/mounts'):
|
||||
@@ -297,6 +323,7 @@ def getNeoMount():
|
||||
|
||||
return neo
|
||||
|
||||
|
||||
def getNeoMount2():
|
||||
neo = 'UNKNOWN'
|
||||
if os.path.exists('/proc/mounts'):
|
||||
@@ -334,6 +361,7 @@ def getNeoMount2():
|
||||
|
||||
return neo
|
||||
|
||||
|
||||
def getNeoMount3():
|
||||
neo = 'UNKNOWN'
|
||||
if os.path.exists('/proc/mounts'):
|
||||
@@ -346,6 +374,7 @@ def getNeoMount3():
|
||||
neo = 'cf_install_/dev/sdb1'
|
||||
return neo
|
||||
|
||||
|
||||
def getNeoMount4():
|
||||
neo = 'UNKNOWN'
|
||||
if os.path.exists('/proc/mounts'):
|
||||
@@ -358,6 +387,7 @@ def getNeoMount4():
|
||||
neo = 'card_install_/dev/sdb1'
|
||||
return neo
|
||||
|
||||
|
||||
def getNeoMount5():
|
||||
neo = 'UNKNOWN'
|
||||
if os.path.exists('/proc/mounts'):
|
||||
@@ -382,6 +412,7 @@ def getCPUSoC():
|
||||
chipset = '7405'
|
||||
return chipset
|
||||
|
||||
|
||||
def getCPUSoCModel():
|
||||
devicetree = 'UNKNOWN'
|
||||
if os.path.exists('/proc/device-tree/model'):
|
||||
@@ -391,6 +422,8 @@ def getCPUSoCModel():
|
||||
return devicetree
|
||||
|
||||
#zwraca wybrane image w neoboot do uruchomienia
|
||||
|
||||
|
||||
def getImageNeoBoot():
|
||||
imagefile = 'UNKNOWN'
|
||||
if os.path.exists('%sImageBoot/.neonextboot' % getNeoLocation()):
|
||||
@@ -400,6 +433,8 @@ def getImageNeoBoot():
|
||||
return imagefile
|
||||
|
||||
#zwraca model vuplus
|
||||
|
||||
|
||||
def getBoxVuModel():
|
||||
vumodel = 'UNKNOWN'
|
||||
if fileExists("/proc/stb/info/vumodel") and not fileExists("/proc/stb/info/boxtype"):
|
||||
@@ -412,6 +447,7 @@ def getBoxVuModel():
|
||||
f.close()
|
||||
return vumodel
|
||||
|
||||
|
||||
def getVuModel():
|
||||
if fileExists("/proc/stb/info/vumodel") and not fileExists("/proc/stb/info/boxtype"):
|
||||
brand = "Vu+"
|
||||
@@ -422,6 +458,8 @@ def getVuModel():
|
||||
return model
|
||||
|
||||
#zwraca nazwe stb z pliku hostname
|
||||
|
||||
|
||||
def getBoxHostName():
|
||||
if os.path.exists('/etc/hostname'):
|
||||
with open('/etc/hostname', 'r') as f:
|
||||
@@ -430,6 +468,8 @@ def getBoxHostName():
|
||||
return myboxname
|
||||
|
||||
#zwraca vuplus/vumodel
|
||||
|
||||
|
||||
def getTunerModel(): #< neoboot.py
|
||||
BOX_NAME = ''
|
||||
if os.path.isfile('/proc/stb/info/vumodel') and not os.path.isfile("/proc/stb/info/boxtype"):
|
||||
@@ -442,6 +482,8 @@ def getTunerModel(): #< neoboot.py
|
||||
return BOX_NAME
|
||||
|
||||
#zwraca strukture folderu zip - vuplus/vumodel
|
||||
|
||||
|
||||
def getImageFolder():
|
||||
if os.path.isfile('/proc/stb/info/vumodel'):
|
||||
BOX_NAME = getBoxModelVU()
|
||||
@@ -449,6 +491,8 @@ def getImageFolder():
|
||||
return ImageFolder
|
||||
|
||||
#zwraca nazwe kernela z /lib/modules
|
||||
|
||||
|
||||
def getKernelVersion():
|
||||
try:
|
||||
return open('/proc/version', 'r').read().split(' ', 4)[2].split('-', 2)[0]
|
||||
@@ -456,6 +500,8 @@ def getKernelVersion():
|
||||
return _('unknown')
|
||||
|
||||
# czysci pamiec
|
||||
|
||||
|
||||
def runCMDS(cmdsList):
|
||||
clearMemory()
|
||||
if isinstance(cmdsList, (list, tuple)):
|
||||
@@ -493,7 +539,6 @@ def getImageDistroN():
|
||||
elif fileExists('/.multinfo') and fileExists('/etc/vtiversion.info'):
|
||||
image = 'Flash ' + ' ' + getBoxHostName()
|
||||
|
||||
|
||||
elif fileExists('/usr/lib/enigma2/python/boxbranding.so') and not fileExists('/.multinfo'):
|
||||
from boxbranding import getImageDistro
|
||||
image = getImageDistro()
|
||||
@@ -535,6 +580,7 @@ def getKernelImageVersion():
|
||||
|
||||
return kernelimage
|
||||
|
||||
|
||||
def getTypBoxa():
|
||||
if not fileExists('/etc/typboxa'):
|
||||
os.system('touch /etc/typboxa')
|
||||
@@ -610,6 +656,7 @@ def getTypBoxa():
|
||||
|
||||
return typboxa
|
||||
|
||||
|
||||
def getImageVersionString():
|
||||
try:
|
||||
if os.path.isfile('/var/lib/opkg/status'):
|
||||
@@ -624,6 +671,7 @@ def getImageVersionString():
|
||||
|
||||
return _('unavailable')
|
||||
|
||||
|
||||
def getModelString():
|
||||
try:
|
||||
file = open('/proc/stb/info/boxtype', 'r')
|
||||
@@ -633,6 +681,7 @@ def getModelString():
|
||||
except IOError:
|
||||
return 'unknown'
|
||||
|
||||
|
||||
def getChipSetString():
|
||||
try:
|
||||
f = open('/proc/stb/info/chipset', 'r')
|
||||
@@ -642,6 +691,7 @@ def getChipSetString():
|
||||
except IOError:
|
||||
return 'unavailable'
|
||||
|
||||
|
||||
def getCPUString():
|
||||
try:
|
||||
file = open('/proc/cpuinfo', 'r')
|
||||
@@ -660,6 +710,7 @@ def getCPUString():
|
||||
except IOError:
|
||||
return 'unavailable'
|
||||
|
||||
|
||||
def getCpuCoresString():
|
||||
try:
|
||||
file = open('/proc/cpuinfo', 'r')
|
||||
@@ -679,6 +730,7 @@ def getCpuCoresString():
|
||||
except IOError:
|
||||
return 'unavailable'
|
||||
|
||||
|
||||
def getEnigmaVersionString():
|
||||
import enigma
|
||||
enigma_version = enigma.getEnigmaVersionString()
|
||||
@@ -686,6 +738,7 @@ def getEnigmaVersionString():
|
||||
enigma_version = enigma_version[:-12]
|
||||
return enigma_version
|
||||
|
||||
|
||||
def getKernelVersionString():
|
||||
try:
|
||||
f = open('/proc/version', 'r')
|
||||
@@ -695,6 +748,7 @@ def getKernelVersionString():
|
||||
except:
|
||||
return _('unknown')
|
||||
|
||||
|
||||
def getHardwareTypeString():
|
||||
try:
|
||||
if os.path.isfile('/proc/stb/info/boxtype'):
|
||||
@@ -708,6 +762,7 @@ def getHardwareTypeString():
|
||||
|
||||
return _('unavailable')
|
||||
|
||||
|
||||
def getImageTypeString():
|
||||
try:
|
||||
return open('/etc/issue').readlines()[-2].capitalize().strip()[:-6]
|
||||
@@ -716,12 +771,14 @@ def getImageTypeString():
|
||||
|
||||
return _('undefined')
|
||||
|
||||
|
||||
def getMachineBuild():
|
||||
try:
|
||||
return open('/proc/version', 'r').read().split(' ', 4)[2].split('-', 2)[0]
|
||||
except:
|
||||
return 'unknown'
|
||||
|
||||
|
||||
def getVuBoxModel():
|
||||
if fileExists('/proc/stb/info/vumodel'):
|
||||
try:
|
||||
@@ -822,6 +879,7 @@ def getMountPointAll():
|
||||
os.system('echo "umount -l /media/mmc\nmkdir -p /media/mmc\nmkdir -p /media/sdb1\n/bin/mount /dev/sdb1 /media/mmc\n/bin/mount /dev/sdb1 /media/sdb1" >> ' + LinkNeoBoot + '/files/mountpoint.sh')
|
||||
os.system('echo "\n\nexit 0" >> ' + LinkNeoBoot + '/files/mountpoint.sh')
|
||||
|
||||
|
||||
def getMountPointNeo():
|
||||
os.system('' + LinkNeoBoot + '/files/mountpoint.sh')
|
||||
os.system('echo ' + getLocationMultiboot() + ' > ' + LinkNeoBoot + '/bin/install; chmod 0755 ' + LinkNeoBoot + '/bin/install')
|
||||
@@ -859,6 +917,7 @@ def getMountPointNeo():
|
||||
out.close()
|
||||
os.system('chmod 755 ' + LinkNeoBoot + '/files/neo.sh')
|
||||
|
||||
|
||||
def getMountPointNeo2():
|
||||
#---------------------------------------------
|
||||
os.system('touch ' + LinkNeoBoot + '/files/mountpoint.sh; echo "#!/bin/sh" > ' + LinkNeoBoot + '/files/mountpoint.sh; chmod 0755 ' + LinkNeoBoot + '/files/mountpoint.sh')
|
||||
|
||||
@@ -51,18 +51,22 @@ neoboot = getNeoLocation()
|
||||
media = getNeoLocation()
|
||||
mediahome = media + '/ImageBoot/'
|
||||
|
||||
|
||||
def getDS():
|
||||
s = getDesktop(0).size()
|
||||
return (s.width(), s.height())
|
||||
|
||||
|
||||
def isFHD():
|
||||
desktopSize = getDS()
|
||||
return desktopSize[0] == 1920
|
||||
|
||||
|
||||
def isHD():
|
||||
desktopSize = getDS()
|
||||
return desktopSize[0] >= 1280 and desktopSize[0] < 1920
|
||||
|
||||
|
||||
def isUHD():
|
||||
desktopSize = getDS()
|
||||
return desktopSize[0] >= 1920 and desktopSize[0] < 3840
|
||||
@@ -74,6 +78,7 @@ def getKernelVersion():
|
||||
except:
|
||||
return _('unknown')
|
||||
|
||||
|
||||
def getCPUtype():
|
||||
cpu = 'UNKNOWN'
|
||||
if os.path.exists('/proc/cpuinfo'):
|
||||
@@ -86,6 +91,7 @@ def getCPUtype():
|
||||
cpu = 'MIPS'
|
||||
return cpu
|
||||
|
||||
|
||||
if os.path.exists('/etc/hostname'):
|
||||
with open('/etc/hostname', 'r') as f:
|
||||
myboxname = f.readline().strip()
|
||||
@@ -101,6 +107,7 @@ if os.path.exists('/proc/stb/info/boxtype'):
|
||||
boxtype = f.readline().strip()
|
||||
f.close()
|
||||
|
||||
|
||||
class BoundFunction:
|
||||
__module__ = __name__
|
||||
|
||||
@@ -230,7 +237,6 @@ class MBTools(Screen):
|
||||
self.list.append(res)
|
||||
self['list']. list = self.list
|
||||
|
||||
|
||||
def KeyOk(self):
|
||||
self.sel = self['list'].getCurrent()
|
||||
if self.sel:
|
||||
@@ -420,11 +426,11 @@ class MBBackup(Screen):
|
||||
else:
|
||||
self.close()
|
||||
|
||||
|
||||
def myClose(self, message):
|
||||
self.session.open(MessageBox, message, MessageBox.TYPE_INFO)
|
||||
self.close()
|
||||
|
||||
|
||||
class MBRestore(Screen):
|
||||
__module__ = __name__
|
||||
skin = """ <screen name="ReinstllNeoBoot2" title="Reinstll NeoBoot" position="center,center" size="850,626">
|
||||
@@ -574,6 +580,7 @@ class MBRestore(Screen):
|
||||
self.session.open(MessageBox, message, MessageBox.TYPE_INFO)
|
||||
self.close()
|
||||
|
||||
|
||||
class MenagerDevices(Screen):
|
||||
__module__ = __name__
|
||||
skin = """<screen name="MenagerDevices" title="Device manager" position="center,center" size="700,300" flags="wfNoBorder">
|
||||
@@ -858,6 +865,7 @@ class UpdateNeoBoot(Screen):
|
||||
self.session.open(MessageBox, message, MessageBox.TYPE_INFO)
|
||||
self.close()
|
||||
|
||||
|
||||
class MyUpgrade2(Screen):
|
||||
if isFHD():
|
||||
skin = """<screen name="MyUpgrade2" position="30,30" size="900,150" flags="wfNoBorder" title="NeoBoot">
|
||||
@@ -1025,6 +1033,7 @@ class IPTVPlayer(Screen):
|
||||
self.session.open(MessageBox, message, MessageBox.TYPE_INFO)
|
||||
self.close()
|
||||
|
||||
|
||||
class IPTVPlayer2(Screen):
|
||||
__module__ = __name__
|
||||
|
||||
@@ -1101,6 +1110,7 @@ class FeedExtra(Screen):
|
||||
self.session.open(MessageBox, message, MessageBox.TYPE_INFO)
|
||||
self.close()
|
||||
|
||||
|
||||
class FeedExtra2(Screen):
|
||||
__module__ = __name__
|
||||
|
||||
@@ -1248,6 +1258,7 @@ class CheckInstall(Screen):
|
||||
self.session.open(MessageBox, message, MessageBox.TYPE_INFO)
|
||||
self.close()
|
||||
|
||||
|
||||
class SkinChange(Screen):
|
||||
if isFHD():
|
||||
skin = """ <screen name="SkinChange" position="center,center" size="850,746" title="NeoBoot Skin Change">
|
||||
@@ -1292,7 +1303,6 @@ class SkinChange(Screen):
|
||||
|
||||
self['list'].list = skinlist
|
||||
|
||||
|
||||
def SkinGO(self):
|
||||
skin = self['list'].getCurrent()
|
||||
if skin:
|
||||
@@ -1379,7 +1389,6 @@ class SkinChange(Screen):
|
||||
restartbox = self.session.openWithCallback(self.restartGUI, MessageBox, _('GUI needs a restart.\nDo you want to Restart the GUI now?'), MessageBox.TYPE_YESNO)
|
||||
restartbox.setTitle(_('Restart GUI now?'))
|
||||
|
||||
|
||||
def restartGUI(self, answer):
|
||||
if answer is True:
|
||||
self.session.open(TryQuitMainloop, 3)
|
||||
@@ -1455,7 +1464,6 @@ class BlocUnblockImageSkin(Screen):
|
||||
temp_file2.write(content.replace('neoBootImageChoose', 'NeoBootImageChoose'))
|
||||
temp_file2.close()
|
||||
|
||||
|
||||
def restareE2(self):
|
||||
restartbox = self.session.openWithCallback(self.restartGUI, MessageBox, _('GUI needs a restart.\nDo you want to Restart the GUI now?'), MessageBox.TYPE_YESNO)
|
||||
restartbox.setTitle(_('Restart GUI now?'))
|
||||
@@ -1563,7 +1571,6 @@ class InternalFlash(Screen):
|
||||
self.close()
|
||||
|
||||
|
||||
|
||||
class DeletingLanguages(Screen):
|
||||
__module__ = __name__
|
||||
skin = """ <screen name="DeletingLanguages" title="Deleting Languages" position="center,center" size="850,647">
|
||||
@@ -1670,6 +1677,7 @@ class TunerInfo(Screen):
|
||||
except:
|
||||
False
|
||||
|
||||
|
||||
class CreateSwap(Screen):
|
||||
__module__ = __name__
|
||||
skin = """<screen name="TunerInfo" title="NeoBoot - Create Swap " position="center,center" size="700,300" flags="wfNoBorder">
|
||||
@@ -1733,6 +1741,7 @@ class CreateSwap(Screen):
|
||||
self.session.open(MessageBox, message, MessageBox.TYPE_INFO)
|
||||
self.close()
|
||||
|
||||
|
||||
class MultiBootMyHelp(Screen):
|
||||
if isFHD():
|
||||
skin = """<screen name="MultiBootMyHelp" position="center,center" size="1920,1080" title="NeoBoot - Opis" flags="wfNoBorder">
|
||||
@@ -1839,6 +1848,7 @@ class Opis(Screen):
|
||||
<ePixmap pixmap="/usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/images/scroll.png" position="754,100" size="26,455" zPosition="5" alphatest="blend" backgroundColor="black" transparent="1" />
|
||||
</screen>"""
|
||||
__module__ = __name__
|
||||
|
||||
def __init__(self, session):
|
||||
Screen.__init__(self, session)
|
||||
self['key_red'] = Label(_('Remove NeoBoot of STB'))
|
||||
@@ -1855,7 +1865,6 @@ class Opis(Screen):
|
||||
self['lab1'].hide()
|
||||
self.updatetext()
|
||||
|
||||
|
||||
def updatetext(self):
|
||||
message = _('\\ NeoBoot Ver. ' + PLUGINVERSION + ' - NeoBoot Ver. updates ' + UPDATEVERSION + '//\n\n')
|
||||
message += _('\----------NEOBOOT - VIP FULL VERSION----------/\n')
|
||||
@@ -1945,6 +1954,7 @@ class Opis(Screen):
|
||||
else:
|
||||
self.close()
|
||||
|
||||
|
||||
class ReinstallKernel(Screen):
|
||||
__module__ = __name__
|
||||
|
||||
@@ -2036,6 +2046,7 @@ class neoDONATION(Screen):
|
||||
def myboot(session, **kwargs):
|
||||
session.open(MBTools)
|
||||
|
||||
|
||||
def Plugins(path, **kwargs):
|
||||
global pluginpath
|
||||
pluginpath = path
|
||||
|
||||
@@ -121,6 +121,5 @@ ImageChooseFULLHD = """
|
||||
"""
|
||||
|
||||
|
||||
|
||||
###ImageChoose-HD
|
||||
|
||||
|
||||
@@ -4,7 +4,6 @@ from Components.Pixmap import Pixmap
|
||||
import os
|
||||
|
||||
|
||||
|
||||
###____ Skin HD - ImageChoose ___mod. gutosie ___
|
||||
ImageChooseHD = """
|
||||
<screen name="NeoBootImageChoose" position="center,center" size="1280, 720" backgroundColor="transpBlack">
|
||||
|
||||
@@ -71,6 +71,7 @@ try:
|
||||
except:
|
||||
print("ERROR INSERTING FONT")
|
||||
|
||||
|
||||
def neoTranslator():
|
||||
neolang = ''
|
||||
usedlang = open('/etc/enigma2/settings', 'r')
|
||||
@@ -82,22 +83,27 @@ def neoTranslator():
|
||||
neolang = 'isnotlangPL'
|
||||
return neolang
|
||||
|
||||
|
||||
def getDS():
|
||||
s = getDesktop(0).size()
|
||||
return (s.width(), s.height())
|
||||
|
||||
|
||||
def isFHD():
|
||||
desktopSize = getDS()
|
||||
return desktopSize[0] == 1920
|
||||
|
||||
|
||||
def isHD():
|
||||
desktopSize = getDS()
|
||||
return desktopSize[0] >= 1280 and desktopSize[0] < 1920
|
||||
|
||||
|
||||
def isUHD():
|
||||
desktopSize = getDS()
|
||||
return desktopSize[0] >= 1920 and desktopSize[0] < 3840
|
||||
|
||||
|
||||
class MyUpgrade(Screen):
|
||||
if isFHD():
|
||||
from Plugins.Extensions.NeoBoot.neoskins.default import MyUpgradeFULLHD
|
||||
@@ -645,11 +651,9 @@ class NeoBootInstallation(Screen):
|
||||
self.session.open(Console, _('NeoBoot Install....'), [cmd])
|
||||
self.close(closereboot)
|
||||
|
||||
|
||||
def myclose2(self, message):
|
||||
self.session.open(MessageBox, message, MessageBox.TYPE_INFO)
|
||||
|
||||
|
||||
def rebootSTBE2(self):
|
||||
restartbox = self.session.openWithCallback(self.RebootSTB, MessageBox, _('Reboot stb now ?'), MessageBox.TYPE_YESNO)
|
||||
restartbox.setTitle(_('Reboot'))
|
||||
@@ -759,7 +763,6 @@ class NeoBootImageChoose(Screen):
|
||||
if not fileExists('/.control_boot_new_image'):
|
||||
os.system('echo "Image uruchomione OK\nNie kasuj tego pliku. \n\nImage started OK\nDo not delete this file." > /.control_ok')
|
||||
|
||||
|
||||
def DownloadImageOnline(self):
|
||||
if not os.path.exists('/usr/lib/enigma2/python/Plugins/Extensions/ImageDownloader/download.py'):
|
||||
message = _('Plugin ImageDownloader not installed!\nInstall plugin to download new image? \and---Continue ?---')
|
||||
@@ -808,6 +811,7 @@ class NeoBootImageChoose(Screen):
|
||||
message = _('NeoBoot detected a kernel mismatch in flash, \nInstall a kernel for flash image??')
|
||||
ybox = self.session.openWithCallback(self.updatekernel, MessageBox, message, MessageBox.TYPE_YESNO)
|
||||
ybox.setTitle(_('Updating ... '))
|
||||
|
||||
def pomoc(self):
|
||||
try:
|
||||
from Plugins.Extensions.NeoBoot.files.tools import Opis
|
||||
@@ -896,6 +900,7 @@ class NeoBootImageChoose(Screen):
|
||||
system('touch /tmp/guto')
|
||||
else:
|
||||
system('touch /tmp/guto')
|
||||
|
||||
def touch4(self):
|
||||
if fileExists('/usr/lib/periodon/.kodn'):
|
||||
pass
|
||||
@@ -904,6 +909,7 @@ class NeoBootImageChoose(Screen):
|
||||
pass
|
||||
else:
|
||||
system('touch /tmp/gutos')
|
||||
|
||||
def touch7(self):
|
||||
if fileExists('/usr/lib/periodon/.kodn'):
|
||||
pass
|
||||
@@ -912,6 +918,7 @@ class NeoBootImageChoose(Screen):
|
||||
pass
|
||||
else:
|
||||
system('touch /tmp/gutosi')
|
||||
|
||||
def touch6(self):
|
||||
if fileExists('/usr/lib/periodon/.kodn'):
|
||||
pass
|
||||
@@ -933,6 +940,7 @@ class NeoBootImageChoose(Screen):
|
||||
elif not fileExists('/usr/lib/periodon/.kodn'):
|
||||
mess = _('VIP Access Activation Fails with Error code 0x20.')
|
||||
self.session.open(MessageBox, mess, MessageBox.TYPE_INFO)
|
||||
|
||||
def touch9(self):
|
||||
if fileExists('/usr/lib/periodon/.kodn'):
|
||||
system('touch /tmp/gut1')
|
||||
@@ -941,6 +949,7 @@ class NeoBootImageChoose(Screen):
|
||||
pass
|
||||
else:
|
||||
system('touch /tmp/gutosiep')
|
||||
|
||||
def touch8(self):
|
||||
if fileExists('/usr/lib/periodon/.kodn'):
|
||||
system('touch /tmp/gut2')
|
||||
@@ -949,6 +958,7 @@ class NeoBootImageChoose(Screen):
|
||||
pass
|
||||
else:
|
||||
system('touch /tmp/gutosiepi')
|
||||
|
||||
def touch0(self):
|
||||
if fileExists('/usr/lib/periodon/.kodn'):
|
||||
if not fileExists('/tmp/gut3'):
|
||||
@@ -971,6 +981,7 @@ class NeoBootImageChoose(Screen):
|
||||
# self.session.open(MessageBox, mess, MessageBox.TYPE_INFO)
|
||||
|
||||
#Zablokowanie aktualizacji przez zmiane nazwy neoboot_update na neoboot_update2 i likwidacja 3 lini hastagu wyzej
|
||||
|
||||
def neoboot_update(self):
|
||||
if checkInternet():
|
||||
#if getTestInTime() == getTestOutTime() or getTestIn() != getTestOut():
|
||||
@@ -1064,7 +1075,6 @@ class NeoBootImageChoose(Screen):
|
||||
restartbox = self.session.openWithCallback(self.restartGUI, MessageBox, _('Completed update NeoBoot.\nYou need to restart the E2 and re-enter your pin code VIP!!!\nRestart now ?'), MessageBox.TYPE_YESNO)
|
||||
restartbox.setTitle(_('Restart GUI now ?'))
|
||||
|
||||
|
||||
def restartGUI(self, answer):
|
||||
if answer is True:
|
||||
os.system('rm -f ' + LinkNeoBoot + '/.location; rm -r ' + LinkNeoBoot + '/ubi_reader')
|
||||
@@ -1081,6 +1091,7 @@ class NeoBootImageChoose(Screen):
|
||||
LogCrashGS('%02d:%02d:%d %02d:%02d:%02d - %s\r\n' % (loggscrash.tm_mday, loggscrash.tm_mon, loggscrash.tm_year, loggscrash.tm_hour, loggscrash.tm_min, loggscrash.tm_sec, str(e)))
|
||||
mess = _('Sorry cannot open neo menu Backup.\nAccess Fails with Error code 0x60.')
|
||||
self.session.open(MessageBox, mess, MessageBox.TYPE_INFO)
|
||||
|
||||
def MBRestore(self):
|
||||
try:
|
||||
from Plugins.Extensions.NeoBoot.files.tools import MBRestore
|
||||
@@ -1311,7 +1322,6 @@ class NeoBootImageChoose(Screen):
|
||||
else:
|
||||
self.session.open(MessageBox, _('Removing canceled!'), MessageBox.TYPE_INFO)
|
||||
|
||||
|
||||
def ImageInstall(self):
|
||||
if not fileExists('/.multinfo'):
|
||||
if getAccessN() != '1234': #%s' % UPDATEVERSION
|
||||
@@ -1528,6 +1538,7 @@ def readline(filename, iferror=''):
|
||||
PrintException()
|
||||
return data
|
||||
|
||||
|
||||
def checkInternet():
|
||||
if fileExists('/usr/lib/python3.8'):
|
||||
return True
|
||||
@@ -1544,6 +1555,7 @@ def checkInternet():
|
||||
else:
|
||||
return True
|
||||
|
||||
|
||||
def checkimage():
|
||||
mycheck = False
|
||||
if not fileExists('/proc/stb/info') or not fileExists('' + LinkNeoBoot + '/neoskins/neo/neo_skin.py') or not fileExists('' + LinkNeoBoot + '/bin/utilsbh') or not fileExists('' + LinkNeoBoot + '/stbinfo.cfg'):
|
||||
@@ -1552,6 +1564,7 @@ def checkimage():
|
||||
mycheck = True
|
||||
return mycheck
|
||||
|
||||
|
||||
def main(session, **kwargs):
|
||||
vip = checkimage()
|
||||
if vip == 1:
|
||||
@@ -1636,6 +1649,7 @@ def main(session, **kwargs):
|
||||
else:
|
||||
session.open(MessageBox, (_('Sorry, Unable to install, bad satellite receiver or you do not have the full plug-in version\n\nThe full version of the NEO VIP plugin is on address:\nkrzysztofgutosie@.gmail.com')), type=MessageBox.TYPE_ERROR)
|
||||
|
||||
|
||||
def menu(menuid, **kwargs):
|
||||
if menuid == 'mainmenu':
|
||||
return [(_('NeoBOOT'),
|
||||
@@ -1644,8 +1658,10 @@ def menu(menuid, **kwargs):
|
||||
1)]
|
||||
return []
|
||||
|
||||
|
||||
from Plugins.Plugin import PluginDescriptor
|
||||
|
||||
|
||||
def Plugins(**kwargs):
|
||||
if isFHD():
|
||||
list = [PluginDescriptor(name='NeoBoot', description='NeoBoot', where=PluginDescriptor.WHERE_MENU, fnc=menu), PluginDescriptor(name='NeoBoot', description=_('Installing multiple images'), icon='neo_fhd.png', where=PluginDescriptor.WHERE_PLUGINMENU, fnc=main)]
|
||||
|
||||
@@ -32,6 +32,7 @@ import os
|
||||
import time
|
||||
LinkNeoBoot = '/usr/lib/enigma2/python/Plugins/Extensions/NeoBoot'
|
||||
|
||||
|
||||
class StartImage(Screen):
|
||||
screenwidth = getDesktop(0).size().width()
|
||||
if screenwidth and screenwidth == 1920:
|
||||
@@ -62,6 +63,7 @@ class StartImage(Screen):
|
||||
\n\t\t </screen>"""
|
||||
|
||||
__module__ = __name__
|
||||
|
||||
def __init__(self, session):
|
||||
Screen.__init__(self, session)
|
||||
self.list = []
|
||||
|
||||
@@ -63,6 +63,7 @@ class StartImage(Screen):
|
||||
\n\t\t </screen>"""
|
||||
|
||||
__module__ = __name__
|
||||
|
||||
def __init__(self, session):
|
||||
Screen.__init__(self, session)
|
||||
self.list = []
|
||||
@@ -105,7 +106,6 @@ class StartImage(Screen):
|
||||
if getBoxVuModel() == 'duo4k':
|
||||
os.system('mkdir -p /media/InternalFlash; mount /dev/mmcblk0p9 /media/InternalFlash')
|
||||
|
||||
|
||||
system('chmod 755 ' + LinkNeoBoot + '/files/kernel.sh')
|
||||
self.sel = self['list'].getCurrent()
|
||||
if self.sel:
|
||||
|
||||
@@ -63,6 +63,7 @@ class StartImage(Screen):
|
||||
\n\t\t </screen>"""
|
||||
|
||||
__module__ = __name__
|
||||
|
||||
def __init__(self, session):
|
||||
Screen.__init__(self, session)
|
||||
self.list = []
|
||||
@@ -105,7 +106,6 @@ class StartImage(Screen):
|
||||
if getBoxVuModel() == 'duo4kse':
|
||||
os.system('mkdir -p /media/InternalFlash; mount /dev/mmcblk0p9 /media/InternalFlash')
|
||||
|
||||
|
||||
system('chmod 755 ' + LinkNeoBoot + '/files/kernel.sh')
|
||||
self.sel = self['list'].getCurrent()
|
||||
if self.sel:
|
||||
|
||||
@@ -62,6 +62,7 @@ class StartImage(Screen):
|
||||
\n\t\t </screen>"""
|
||||
|
||||
__module__ = __name__
|
||||
|
||||
def __init__(self, session):
|
||||
Screen.__init__(self, session)
|
||||
self.list = []
|
||||
|
||||
@@ -33,6 +33,7 @@ import os
|
||||
import time
|
||||
LinkNeoBoot = '/usr/lib/enigma2/python/Plugins/Extensions/NeoBoot'
|
||||
|
||||
|
||||
class StartImage(Screen):
|
||||
screenwidth = getDesktop(0).size().width()
|
||||
if screenwidth and screenwidth == 1920:
|
||||
@@ -63,6 +64,7 @@ class StartImage(Screen):
|
||||
\n\t\t </screen>"""
|
||||
|
||||
__module__ = __name__
|
||||
|
||||
def __init__(self, session):
|
||||
Screen.__init__(self, session)
|
||||
self.list = []
|
||||
|
||||
@@ -62,6 +62,7 @@ class StartImage(Screen):
|
||||
\n\t\t </screen>"""
|
||||
|
||||
__module__ = __name__
|
||||
|
||||
def __init__(self, session):
|
||||
Screen.__init__(self, session)
|
||||
self.list = []
|
||||
|
||||
@@ -62,6 +62,7 @@ class StartImage(Screen):
|
||||
\n\t\t </screen>"""
|
||||
|
||||
__module__ = __name__
|
||||
|
||||
def __init__(self, session):
|
||||
Screen.__init__(self, session)
|
||||
self.list = []
|
||||
|
||||
@@ -62,6 +62,7 @@ class StartImage(Screen):
|
||||
\n\t\t </screen>"""
|
||||
|
||||
__module__ = __name__
|
||||
|
||||
def __init__(self, session):
|
||||
Screen.__init__(self, session)
|
||||
self.list = []
|
||||
|
||||
@@ -24,6 +24,7 @@ import sys as _sys
|
||||
import textwrap as _textwrap
|
||||
from gettext import gettext as _
|
||||
|
||||
|
||||
def _callable(obj):
|
||||
return hasattr(obj, '__call__') or hasattr(obj, '__bases__')
|
||||
|
||||
@@ -36,6 +37,7 @@ PARSER = 'A...'
|
||||
REMAINDER = '...'
|
||||
_UNRECOGNIZED_ARGS_ATTR = '_unrecognized_args'
|
||||
|
||||
|
||||
class _AttributeHolder(object):
|
||||
|
||||
def __repr__(self):
|
||||
|
||||
@@ -7,6 +7,7 @@ from ubi import display
|
||||
from ubi.image import description as image
|
||||
from ubi.block import layout
|
||||
|
||||
|
||||
class ubi:
|
||||
|
||||
def __init__(self, ubi_file):
|
||||
|
||||
@@ -4,6 +4,7 @@ from ubi import display
|
||||
from ubi.defines import *
|
||||
from ubi.headers import *
|
||||
|
||||
|
||||
class description(object):
|
||||
|
||||
def __init__(self, block_buf):
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#!/usr/bin/python
|
||||
from ubi.block import sort
|
||||
|
||||
|
||||
def group_pairs(blocks, layout_blocks_list):
|
||||
layouts_grouped = [[blocks[layout_blocks_list[0]].peb_num]]
|
||||
for l in layout_blocks_list[1:]:
|
||||
@@ -20,4 +21,4 @@ def associate_blocks(blocks, layout_pairs, start_peb_num):
|
||||
seq_blocks = sort.by_image_seq(blocks, blocks[layout_pair[0]].ec_hdr.image_seq)
|
||||
layout_pair.append(seq_blocks)
|
||||
|
||||
return layout_pairs
|
||||
return layout_pairs
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#!/usr/bin/python
|
||||
from ubi.defines import PRINT_COMPAT_LIST, PRINT_VOL_TYPE_LIST, UBI_VTBL_AUTORESIZE_FLG
|
||||
|
||||
|
||||
def ubi(ubi, tab=''):
|
||||
print '%sUBI File' % tab
|
||||
print '%s---------------------' % tab
|
||||
|
||||
@@ -3,6 +3,7 @@ import struct
|
||||
from ubi.defines import *
|
||||
from ubi.headers import errors
|
||||
|
||||
|
||||
class ec_hdr(object):
|
||||
|
||||
def __init__(self, buf):
|
||||
@@ -86,4 +87,4 @@ def extract_vtbl_rec(buf):
|
||||
vtbl_rec_ret.rec_index = i
|
||||
vtbl_recs.append(vtbl_rec_ret)
|
||||
|
||||
return vtbl_recs
|
||||
return vtbl_recs
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
from zlib import crc32
|
||||
from ubi.defines import *
|
||||
|
||||
|
||||
def ec_hdr(ec_hdr, buf):
|
||||
if ec_hdr.hdr_crc != ~crc32(buf[:-4]) & 4294967295L:
|
||||
ec_hdr.errors.append('crc')
|
||||
@@ -25,4 +26,4 @@ def vtbl_rec(vtbl_rec, buf):
|
||||
vtbl_rec.errors.append('crc')
|
||||
if not likely_vtbl:
|
||||
vtbl_rec.errors = ['False']
|
||||
return vtbl_rec
|
||||
return vtbl_rec
|
||||
|
||||
@@ -3,6 +3,7 @@ from ubi import display
|
||||
from ubi.volume import get_volumes
|
||||
from ubi.block import get_blocks_in_list
|
||||
|
||||
|
||||
class description(object):
|
||||
|
||||
def __init__(self, blocks, layout_info):
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
from ubi import display
|
||||
from ubi.block import sort, get_blocks_in_list
|
||||
|
||||
|
||||
class description(object):
|
||||
|
||||
def __init__(self, vol_id, vol_rec, block_list):
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#!/usr/bin/python
|
||||
from ubi.block import sort
|
||||
|
||||
|
||||
class ubi_file(object):
|
||||
|
||||
def __init__(self, path, block_size, start_offset=0, end_offset=None):
|
||||
|
||||
@@ -6,6 +6,7 @@ from ubifs import nodes
|
||||
from ubifs.nodes import extract
|
||||
from ubifs.log import log
|
||||
|
||||
|
||||
class ubifs:
|
||||
|
||||
def __init__(self, ubifs_file):
|
||||
@@ -73,4 +74,4 @@ def get_leb_size(path):
|
||||
return block_size
|
||||
|
||||
f.close()
|
||||
return block_size
|
||||
return block_size
|
||||
|
||||
@@ -3,6 +3,7 @@ import os
|
||||
import sys
|
||||
import ui
|
||||
|
||||
|
||||
class log:
|
||||
|
||||
def __init__(self):
|
||||
@@ -30,4 +31,4 @@ class log:
|
||||
for key, value in n:
|
||||
buf += '\t%s: %s\n' % (key, value)
|
||||
|
||||
self._out(buf)
|
||||
self._out(buf)
|
||||
|
||||
@@ -27,6 +27,7 @@ key_types = ['ino',
|
||||
'dent',
|
||||
'xent']
|
||||
|
||||
|
||||
def parse_key(key):
|
||||
hkey, lkey = struct.unpack('<II', key[0:UBIFS_SK_LEN])
|
||||
ino_num = hkey & UBIFS_S_KEY_HASH_MASK
|
||||
@@ -43,4 +44,4 @@ def decompress(ctype, unc_len, data):
|
||||
if ctype == UBIFS_COMPR_ZLIB:
|
||||
return zlib.decompress(data, -11)
|
||||
else:
|
||||
return data
|
||||
return data
|
||||
|
||||
@@ -3,6 +3,7 @@ import struct
|
||||
from ubifs.defines import *
|
||||
from ubifs.misc import parse_key
|
||||
|
||||
|
||||
class common_hdr(object):
|
||||
|
||||
def __init__(self, buf):
|
||||
@@ -148,4 +149,4 @@ class branch(object):
|
||||
def __iter__(self):
|
||||
for key in dir(self):
|
||||
if not key.startswith('_'):
|
||||
yield (key, getattr(self, key))
|
||||
yield (key, getattr(self, key))
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
from ubifs import nodes
|
||||
from ubifs.defines import *
|
||||
|
||||
|
||||
def common_hdr(ubifs, lnum, offset=0):
|
||||
ubifs.file.seek(ubifs.leb_size * lnum + offset)
|
||||
return nodes.common_hdr(ubifs.file.read(UBIFS_COMMON_HDR_SZ))
|
||||
|
||||
@@ -4,6 +4,7 @@ import struct
|
||||
from ubifs.defines import *
|
||||
from ubifs.misc import decompress
|
||||
|
||||
|
||||
def dents(ubifs, inodes, dent_node, path='', perms=False):
|
||||
inode = inodes[dent_node.inum]
|
||||
dent_path = os.path.join(path, dent_node.name)
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
from ubifs import extract
|
||||
from ubifs.defines import *
|
||||
|
||||
|
||||
def index(ubifs, lnum, offset, inodes={}):
|
||||
chdr = extract.common_hdr(ubifs, lnum, offset)
|
||||
if chdr.node_type == UBIFS_IDX_NODE:
|
||||
|
||||
@@ -6,6 +6,7 @@ from ubifs.defines import PRINT_UBIFS_KEY_HASH, PRINT_UBIFS_COMPR
|
||||
from ubi.defines import PRINT_VOL_TYPE_LIST, UBI_VTBL_AUTORESIZE_FLG
|
||||
output_dir = os.path.join(os.path.dirname(os.path.dirname(os.path.realpath(__file__))), 'output')
|
||||
|
||||
|
||||
def extract_files(ubifs, out_path, perms=False):
|
||||
try:
|
||||
inodes = {}
|
||||
|
||||
@@ -24,6 +24,7 @@ import sys as _sys
|
||||
import textwrap as _textwrap
|
||||
from gettext import gettext as _
|
||||
|
||||
|
||||
def _callable(obj):
|
||||
return hasattr(obj, '__call__') or hasattr(obj, '__bases__')
|
||||
|
||||
@@ -36,6 +37,7 @@ PARSER = 'A...'
|
||||
REMAINDER = '...'
|
||||
_UNRECOGNIZED_ARGS_ATTR = '_unrecognized_args'
|
||||
|
||||
|
||||
class _AttributeHolder(object):
|
||||
|
||||
def __repr__(self):
|
||||
|
||||
@@ -7,6 +7,7 @@ from ubi import display
|
||||
from ubi.image import description as image
|
||||
from ubi.block import layout
|
||||
|
||||
|
||||
class ubi:
|
||||
|
||||
def __init__(self, ubi_file):
|
||||
|
||||
@@ -4,6 +4,7 @@ from ubi import display
|
||||
from ubi.defines import *
|
||||
from ubi.headers import *
|
||||
|
||||
|
||||
class description(object):
|
||||
|
||||
def __init__(self, block_buf):
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#!/usr/bin/python
|
||||
from ubi.block import sort
|
||||
|
||||
|
||||
def group_pairs(blocks, layout_blocks_list):
|
||||
layouts_grouped = [[blocks[layout_blocks_list[0]].peb_num]]
|
||||
for l in layout_blocks_list[1:]:
|
||||
@@ -20,4 +21,4 @@ def associate_blocks(blocks, layout_pairs, start_peb_num):
|
||||
seq_blocks = sort.by_image_seq(blocks, blocks[layout_pair[0]].ec_hdr.image_seq)
|
||||
layout_pair.append(seq_blocks)
|
||||
|
||||
return layout_pairs
|
||||
return layout_pairs
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#!/usr/bin/python
|
||||
from ubi.defines import PRINT_COMPAT_LIST, PRINT_VOL_TYPE_LIST, UBI_VTBL_AUTORESIZE_FLG
|
||||
|
||||
|
||||
def ubi(ubi, tab=''):
|
||||
print '%sUBI File' % tab
|
||||
print '%s---------------------' % tab
|
||||
|
||||
@@ -3,6 +3,7 @@ import struct
|
||||
from ubi.defines import *
|
||||
from ubi.headers import errors
|
||||
|
||||
|
||||
class ec_hdr(object):
|
||||
|
||||
def __init__(self, buf):
|
||||
@@ -86,4 +87,4 @@ def extract_vtbl_rec(buf):
|
||||
vtbl_rec_ret.rec_index = i
|
||||
vtbl_recs.append(vtbl_rec_ret)
|
||||
|
||||
return vtbl_recs
|
||||
return vtbl_recs
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
from zlib import crc32
|
||||
from ubi.defines import *
|
||||
|
||||
|
||||
def ec_hdr(ec_hdr, buf):
|
||||
if ec_hdr.hdr_crc != ~crc32(buf[:-4]) & 4294967295L:
|
||||
ec_hdr.errors.append('crc')
|
||||
@@ -25,4 +26,4 @@ def vtbl_rec(vtbl_rec, buf):
|
||||
vtbl_rec.errors.append('crc')
|
||||
if not likely_vtbl:
|
||||
vtbl_rec.errors = ['False']
|
||||
return vtbl_rec
|
||||
return vtbl_rec
|
||||
|
||||
@@ -3,6 +3,7 @@ from ubi import display
|
||||
from ubi.volume import get_volumes
|
||||
from ubi.block import get_blocks_in_list
|
||||
|
||||
|
||||
class description(object):
|
||||
|
||||
def __init__(self, blocks, layout_info):
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
from ubi import display
|
||||
from ubi.block import sort, get_blocks_in_list
|
||||
|
||||
|
||||
class description(object):
|
||||
|
||||
def __init__(self, vol_id, vol_rec, block_list):
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#!/usr/bin/python
|
||||
from ubi.block import sort
|
||||
|
||||
|
||||
class ubi_file(object):
|
||||
|
||||
def __init__(self, path, block_size, start_offset=0, end_offset=None):
|
||||
|
||||
@@ -6,6 +6,7 @@ from ubifs import nodes
|
||||
from ubifs.nodes import extract
|
||||
from ubifs.log import log
|
||||
|
||||
|
||||
class ubifs:
|
||||
|
||||
def __init__(self, ubifs_file):
|
||||
@@ -73,4 +74,4 @@ def get_leb_size(path):
|
||||
return block_size
|
||||
|
||||
f.close()
|
||||
return block_size
|
||||
return block_size
|
||||
|
||||
@@ -3,6 +3,7 @@ import os
|
||||
import sys
|
||||
import ui
|
||||
|
||||
|
||||
class log:
|
||||
|
||||
def __init__(self):
|
||||
@@ -30,4 +31,4 @@ class log:
|
||||
for key, value in n:
|
||||
buf += '\t%s: %s\n' % (key, value)
|
||||
|
||||
self._out(buf)
|
||||
self._out(buf)
|
||||
|
||||
@@ -27,6 +27,7 @@ key_types = ['ino',
|
||||
'dent',
|
||||
'xent']
|
||||
|
||||
|
||||
def parse_key(key):
|
||||
hkey, lkey = struct.unpack('<II', key[0:UBIFS_SK_LEN])
|
||||
ino_num = hkey & UBIFS_S_KEY_HASH_MASK
|
||||
@@ -43,4 +44,4 @@ def decompress(ctype, unc_len, data):
|
||||
elif ctype == UBIFS_COMPR_ZLIB:
|
||||
return zlib.decompress(data, -11)
|
||||
else:
|
||||
return data
|
||||
return data
|
||||
|
||||
@@ -3,6 +3,7 @@ import struct
|
||||
from ubifs.defines import *
|
||||
from ubifs.misc import parse_key
|
||||
|
||||
|
||||
class common_hdr(object):
|
||||
|
||||
def __init__(self, buf):
|
||||
@@ -148,4 +149,4 @@ class branch(object):
|
||||
def __iter__(self):
|
||||
for key in dir(self):
|
||||
if not key.startswith('_'):
|
||||
yield (key, getattr(self, key))
|
||||
yield (key, getattr(self, key))
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
from ubifs import nodes
|
||||
from ubifs.defines import *
|
||||
|
||||
|
||||
def common_hdr(ubifs, lnum, offset=0):
|
||||
ubifs.file.seek(ubifs.leb_size * lnum + offset)
|
||||
return nodes.common_hdr(ubifs.file.read(UBIFS_COMMON_HDR_SZ))
|
||||
|
||||
@@ -4,6 +4,7 @@ import struct
|
||||
from ubifs.defines import *
|
||||
from ubifs.misc import decompress
|
||||
|
||||
|
||||
def dents(ubifs, inodes, dent_node, path='', perms=False):
|
||||
inode = inodes[dent_node.inum]
|
||||
dent_path = os.path.join(path, dent_node.name)
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
from ubifs import extract
|
||||
from ubifs.defines import *
|
||||
|
||||
|
||||
def index(ubifs, lnum, offset, inodes={}):
|
||||
chdr = extract.common_hdr(ubifs, lnum, offset)
|
||||
if chdr.node_type == UBIFS_IDX_NODE:
|
||||
|
||||
@@ -6,6 +6,7 @@ from ubifs.defines import PRINT_UBIFS_KEY_HASH, PRINT_UBIFS_COMPR
|
||||
from ubi.defines import PRINT_VOL_TYPE_LIST, UBI_VTBL_AUTORESIZE_FLG
|
||||
output_dir = os.path.join(os.path.dirname(os.path.dirname(os.path.realpath(__file__))), 'output')
|
||||
|
||||
|
||||
def extract_files(ubifs, out_path, perms=False):
|
||||
try:
|
||||
inodes = {}
|
||||
|
||||
@@ -39,22 +39,27 @@ else:
|
||||
from Screens.Console import Console
|
||||
LinkNeoBoot = '/usr/lib/enigma2/python/Plugins/Extensions/NeoBoot'
|
||||
|
||||
|
||||
def getDS():
|
||||
s = getDesktop(0).size()
|
||||
return (s.width(), s.height())
|
||||
|
||||
|
||||
def isFHD():
|
||||
desktopSize = getDS()
|
||||
return desktopSize[0] == 1920
|
||||
|
||||
|
||||
def isHD():
|
||||
desktopSize = getDS()
|
||||
return desktopSize[0] >= 1280 and desktopSize[0] < 1920
|
||||
|
||||
|
||||
def isUHD():
|
||||
desktopSize = getDS()
|
||||
return desktopSize[0] >= 1920 and desktopSize[0] < 3840
|
||||
|
||||
|
||||
class InstallImage(Screen, ConfigListScreen):
|
||||
if isFHD():
|
||||
skin = """<screen position="130,120" size="1650,875" title="NeoBoot - Installation">
|
||||
|
||||
Reference in New Issue
Block a user