diff --git a/NeoBoot/__init__.py b/NeoBoot/__init__.py
index 4c06ca1..9f8891e 100644
--- a/NeoBoot/__init__.py
+++ b/NeoBoot/__init__.py
@@ -3,21 +3,23 @@
from __future__ import print_function
from Components.Language import language
from Tools.Directories import resolveFilename, SCOPE_PLUGINS, SCOPE_LANGUAGE
-import os, gettext
+import os
+import gettext
PluginLanguageDomain = 'NeoBoot'
PluginLanguagePath = 'Extensions/NeoBoot/locale'
+
def localeInit():
lang = language.getLanguage()[:2]
os.environ['LANGUAGE'] = lang
- print ("[NeoBoot] set language to "), lang
+ print("[NeoBoot] set language to "), lang
gettext.bindtextdomain(PluginLanguageDomain, resolveFilename(SCOPE_PLUGINS, PluginLanguagePath))
def _(txt):
t = gettext.dgettext(PluginLanguageDomain, txt)
if t == txt:
- print ("[NeoBoot] fallback to default translation for"), txt
+ print("[NeoBoot] fallback to default translation for"), txt
t = gettext.dgettext('enigma2', txt)
return t
diff --git a/NeoBoot/ex_init.py b/NeoBoot/ex_init.py
index 47336d4..ce0b2f2 100644
--- a/NeoBoot/ex_init.py
+++ b/NeoBoot/ex_init.py
@@ -1,7 +1,8 @@
-#!/usr/bin/python
-
-import sys, extract
+#!/usr/bin/python
+
+import sys
+import extract
if len(sys.argv) < 16:
pass
else:
- extract.NEOBootMainEx(sys.argv[1], sys.argv[2], sys.argv[3], sys.argv[4], sys.argv[5], sys.argv[6], sys.argv[7], sys.argv[8], sys.argv[9], sys.argv[10], sys.argv[11], sys.argv[12], sys.argv[13], sys.argv[14], sys.argv[15], sys.argv[16])
\ No newline at end of file
+ extract.NEOBootMainEx(sys.argv[1], sys.argv[2], sys.argv[3], sys.argv[4], sys.argv[5], sys.argv[6], sys.argv[7], sys.argv[8], sys.argv[9], sys.argv[10], sys.argv[11], sys.argv[12], sys.argv[13], sys.argv[14], sys.argv[15], sys.argv[16])
diff --git a/NeoBoot/extract.py b/NeoBoot/extract.py
index aebb0de..6c9843f 100644
--- a/NeoBoot/extract.py
+++ b/NeoBoot/extract.py
@@ -1,13 +1,19 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
-import sys, os, struct, shutil
+import sys
+import os
+import struct
+import shutil
-# ver. gutosie
+# ver. gutosie
#--------------------------------------------- 2021 ---------------------------------------------#
-def NEOBootMainEx(source, target, stopenigma, CopyFiles, CopyKernel, TvList, LanWlan, Sterowniki, InstallSettings, ZipDelete, RepairFTP, SoftCam, MediaPortal, PiconR, Kodi, BlackHole):
+
+
+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')
@@ -19,65 +25,71 @@ def LanguageUsed():
language = 'No'
return language
+
def getBoxHostName():
if os.path.exists('/etc/hostname'):
with open('/etc/hostname', 'r') as f:
myboxname = f.readline().strip()
- f.close()
- return myboxname
+ f.close()
+ return myboxname
+
def getCPUSoC():
- chipset='UNKNOWN'
+ chipset = 'UNKNOWN'
if os.path.exists('/proc/stb/info/chipset'):
with open('/proc/stb/info/chipset', 'r') as f:
chipset = f.readline().strip()
- f.close()
+ f.close()
if chipset == '7405(with 3D)':
chipset == '7405'
-
+
return chipset
-
+
+
def getBoxVuModel():
- vumodel='UNKNOWN'
+ vumodel = 'UNKNOWN'
if os.path.exists("/proc/stb/info/vumodel") and not os.path.exists("/proc/stb/info/boxtype"):
with open('/proc/stb/info/vumodel', 'r') as f:
vumodel = f.readline().strip()
- f.close()
+ f.close()
return vumodel
-def getCPUtype() :
- cpu='UNKNOWN'
+
+def getCPUtype():
+ cpu = 'UNKNOWN'
if os.path.exists('/proc/cpuinfo'):
with open('/proc/cpuinfo', 'r') as f:
lines = f.read()
f.close()
if lines.find('ARMv7') != -1:
- cpu='ARMv7'
+ cpu = 'ARMv7'
elif lines.find('mips') != -1:
- cpu='MIPS'
+ 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'
+ locatino = 'UNKNOWN'
if os.path.exists('/usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/.location'):
with open('/usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/.location', 'r') as f:
locatino = f.readline().strip()
f.close()
return locatino
-
+
media = getNeoLocation()
mediahome = media + '/ImageBoot/'
extensions_path = '/usr/lib/enigma2/python/Plugins/Extensions/'
dev_null = ' > /dev/null 2>&1'
-supportedTuners='vuplus'
-
+supportedTuners = 'vuplus'
+
def NEOBootMainEx(source, target, stopenigma, CopyFiles, CopyKernel, TvList, LanWlan, Sterowniki, InstallSettings, ZipDelete, RepairFTP, SoftCam, MediaPortal, PiconR, Kodi, BlackHole):
media_target = mediahome + target
@@ -108,8 +120,8 @@ def NEOBootMainEx(source, target, stopenigma, CopyFiles, CopyKernel, TvList, Lan
'rmdir ' + media_target + media + dev_null,
'mkdir -p ' + media_target + media + dev_null,
#'cp /etc/passwd ' + media_target + '/etc/passwd' + dev_null,
-# 'cp ' + extensions_path + 'NeoBoot/bin/hdd' + media_target+'/etc/init.d/hddusb' + dev_null,
- 'cp /etc/hostname ' + media_target + '/etc/hostname' + dev_null,
+# 'cp ' + extensions_path + 'NeoBoot/bin/hdd' + media_target+'/etc/init.d/hddusb' + dev_null,
+ 'cp /etc/hostname ' + media_target + '/etc/hostname' + dev_null,
'cp -af ' + extensions_path + 'NeoBoot ' + media_target + extensions_path + 'NeoBoot' + dev_null,
'mkdir -p ' + media_target + extensions_path + 'NeoReboot' + dev_null,
'touch ' + media_target + extensions_path + 'NeoReboot/__init__.py' + dev_null,
@@ -121,9 +133,9 @@ def NEOBootMainEx(source, target, stopenigma, CopyFiles, CopyKernel, TvList, Lan
if CopyFiles == 'False':
os.system('echo "No copying of files..."')
- os.system('touch ' + getNeoLocation() + 'ImageBoot/.without_copying; sleep 5')
+ os.system('touch ' + getNeoLocation() + 'ImageBoot/.without_copying; sleep 5')
- if CopyKernel == 'True':
+ if CopyKernel == 'True':
#mips vuplus
if getBoxHostName() == 'vuultimo' or getCPUSoC() == '7405' and os.path.exists('%s/ImageBoot/%s/etc/vtiversion.info' % (media, target)):
if os.path.exists('%s/ImageBoot/%s/lib/modules' % (media, target)):
@@ -141,15 +153,15 @@ def NEOBootMainEx(source, target, stopenigma, CopyFiles, CopyKernel, TvList, Lan
cmd = 'cp -af /lib/firmware %s/ImageBoot/%s/lib > /dev/null 2>&1' % (media, target)
rc = os.system(cmd)
os.system('echo "Copied system drivers. Not recommended copied kernel.bin for Ultimo HD."')
- elif getCPUtype() == "MIPS" and getBoxHostName() == 'vuultimo' or getBoxHostName() == 'bm750' or getBoxHostName() == 'vuduo' or getBoxHostName() == 'vuuno' or getBoxHostName() == 'vusolo' or getBoxHostName() == 'vuduo' or getBoxHostName() == 'vusolo2' or getBoxHostName() == 'vusolose' or getBoxHostName() == 'vuduo2' or getBoxHostName() == 'vuzero' or getBoxHostName() == 'mbultra':
- os.system('mv ' + getNeoLocation() + 'ImagesUpload/vuplus/' + getBoxVuModel() + '/kernel_cfe_auto.bin ' + media_target + '/boot/' + getBoxHostName() + '.vmlinux.gz' + dev_null)
- os.system('echo "Copied kernel.bin STB-MIPS"')
+ elif getCPUtype() == "MIPS" and getBoxHostName() == 'vuultimo' or getBoxHostName() == 'bm750' or getBoxHostName() == 'vuduo' or getBoxHostName() == 'vuuno' or getBoxHostName() == 'vusolo' or getBoxHostName() == 'vuduo' or getBoxHostName() == 'vusolo2' or getBoxHostName() == 'vusolose' or getBoxHostName() == 'vuduo2' or getBoxHostName() == 'vuzero' or getBoxHostName() == 'mbultra':
+ os.system('mv ' + getNeoLocation() + 'ImagesUpload/vuplus/' + getBoxVuModel() + '/kernel_cfe_auto.bin ' + media_target + '/boot/' + getBoxHostName() + '.vmlinux.gz' + dev_null)
+ os.system('echo "Copied kernel.bin STB-MIPS"')
#arm vuplus arms
elif getCPUtype() == "ARMv7" and getBoxHostName() == "vuultimo4k" or getBoxHostName() == "vusolo4k" or getBoxHostName() == "vuuno4k" or getBoxHostName() == "vuuno4kse" or getBoxHostName() == "vuduo4k" or getBoxHostName() == "vuduo4kse" or getBoxHostName() == "vuzero4k":
os.system('mv ' + getNeoLocation() + 'ImagesUpload/vuplus/' + getBoxVuModel() + '/kernel_auto.bin ' + media_target + '/boot/zImage.' + getBoxHostName() + '' + dev_null)
- os.system('echo "Copied kernel.bin STB-ARM"')
-
- if not os.path.exists('' + getNeoLocation() + 'ImageBoot/.without_copying'):
+ os.system('echo "Copied kernel.bin STB-ARM"')
+
+ if not os.path.exists('' + getNeoLocation() + 'ImageBoot/.without_copying'):
if os.path.exists('/usr/sbin/nandwrite'):
cmd = 'cp -af /usr/sbin/nandwrite %s/ImageBoot/%s/usr/sbin/nandwrite > /dev/null 2>&1' % (media, target)
rc = os.system(cmd)
@@ -188,8 +200,8 @@ def NEOBootMainEx(source, target, stopenigma, CopyFiles, CopyKernel, TvList, Lan
if not os.path.exists('%s/ImageBoot/%s/usr/lib/enigma2/python/boxbranding.so' % (media, target)):
cmd = 'cp -af /usr/lib/enigma2/python/boxbranding.so %s/ImageBoot/%s/usr/lib/enigma2/python/boxbranding.so > /dev/null 2>&1' % (media, target)
rc = os.system(cmd)
- os.system('echo "Copied plugins..."')
-
+ os.system('echo "Copied plugins..."')
+
if TvList == 'True':
if not os.path.exists('%s/ImageBoot/%s/etc/enigma2' % (media, target)):
cmd = 'mkdir -p %s/ImageBoot/%s/etc/enigma2' % (media, target)
@@ -211,7 +223,7 @@ def NEOBootMainEx(source, target, stopenigma, CopyFiles, CopyKernel, TvList, Lan
os.system('echo "Not copied LAN-WLAN, not recommended for this image."')
elif os.path.exists('/etc/bhversion') and os.path.exists('%s/usr/lib/enigma2/python/Plugins/PLi' % (media, target)):
os.system('echo "Not copied LAN-WLAN, not recommended for this image."')
- else:
+ else:
if os.path.exists('/etc/wpa_supplicant.wlan0.conf'):
cmd = 'cp -af /etc/wpa_supplicant.wlan0.conf %s/ImageBoot/%s/etc/wpa_supplicant.wlan0.conf > /dev/null 2>&1' % (media, target)
rc = os.system(cmd)
@@ -282,23 +294,23 @@ def NEOBootMainEx(source, target, stopenigma, CopyFiles, CopyKernel, TvList, Lan
if SoftCam == 'True':
if os.path.exists('/etc/CCcam.cfg'):
- cmd = 'cp -af /etc/CCcam.cfg %s/ImageBoot/%s/etc > /dev/null 2>&1' % (media, target)
- rc = os.system(cmd)
+ cmd = 'cp -af /etc/CCcam.cfg %s/ImageBoot/%s/etc > /dev/null 2>&1' % (media, target)
+ rc = os.system(cmd)
if os.path.exists('/etc/tuxbox/config'):
cmd = 'cp -af /etc/tuxbox/config %s/ImageBoot/%s/etc/tuxbox > /dev/null 2>&1' % (media, target)
- rc = os.system(cmd)
+ rc = os.system(cmd)
os.system('echo "Copied softcam files to the installed image..."')
if MediaPortal == 'True':
if os.path.exists('' + extensions_path + 'MediaPortal'):
cmd = 'cp -af ' + extensions_path + 'MediaPortal %s/ImageBoot/%s/usr/lib/enigma2/python/Plugins/Extensions > /dev/null 2>&1' % (media, target)
- rc = os.system(cmd)
+ rc = os.system(cmd)
cmd = 'cp -af ' + extensions_path + 'mpgz %s/ImageBoot/%s/usr/lib/enigma2/python/Plugins/Extensions > /dev/null 2>&1' % (media, target)
- rc = os.system(cmd)
+ rc = os.system(cmd)
cmd = 'cp -af /usr/lib/python2.7/argparse.pyo %s/ImageBoot/%s/usr/lib/python2.7 > /dev/null 2>&1' % (media, target)
- rc = os.system(cmd)
+ rc = os.system(cmd)
cmd = 'cp -af /usr/lib/python2.7/robotparser.pyo %s/ImageBoot/%s/usr/lib/python2.7 > /dev/null 2>&1' % (media, target)
- rc = os.system(cmd)
+ rc = os.system(cmd)
cmd = 'cp -af /usr/lib/python2.7/site-packages/Crypto %s/ImageBoot/%s/usr/lib/python2.7/site-packages > /dev/null 2>&1' % (media, target)
rc = os.system(cmd)
cmd = 'cp -af /usr/lib/python2.7/site-packages/mechanize %s/ImageBoot/%s/usr/lib/python2.7/site-packages > /dev/null 2>&1' % (media, target)
@@ -306,7 +318,7 @@ def NEOBootMainEx(source, target, stopenigma, CopyFiles, CopyKernel, TvList, Lan
cmd = 'cp -af /usr/lib/python2.7/site-packages/requests %s/ImageBoot/%s/usr/lib/python2.7/site-packages > /dev/null 2>&1' % (media, target)
rc = os.system(cmd)
cmd = 'cp -af /usr/lib/python2.7/site-packages/requests-2.11.1-py2.7.egg-info %s/ImageBoot/%s/usr/lib/python2.7/site-packages > /dev/null 2>&1' % (media, target)
- rc = os.system(cmd)
+ rc = os.system(cmd)
if not os.path.exists('%s/ImageBoot/%s/etc/enigma2' % (media, target)):
cmd = 'mkdir -p %s/ImageBoot/%s/etc/enigma2' % (media, target)
@@ -319,36 +331,36 @@ def NEOBootMainEx(source, target, stopenigma, CopyFiles, CopyKernel, TvList, Lan
rc = os.system(cmd)
if os.path.exists('/etc/enigma2/mp_pluginliste'):
cmd = 'cp /etc/enigma2/mp_pluginliste %s/ImageBoot/%s/etc/enigma2' % (media, target)
- rc = os.system(cmd)
+ rc = os.system(cmd)
os.system('echo "Copied MediaPortal..."')
- elif not os.path.exists('' + extensions_path + 'MediaPortal'):
+ elif not os.path.exists('' + extensions_path + 'MediaPortal'):
os.system('echo "MediaPortal not found."')
if PiconR == 'True':
if os.path.exists('/usr/share/enigma2/picon'):
cmd = 'cp -af /usr/share/enigma2/picon %s/ImageBoot/%s/usr/share/enigma2' % (media, target)
- rc = os.system(cmd)
+ rc = os.system(cmd)
os.system('echo "Copied picon..."')
- elif not os.path.exists('/usr/share/enigma2/picon'):
- os.system('echo "Picon flash not found."')
-
+ elif not os.path.exists('/usr/share/enigma2/picon'):
+ os.system('echo "Picon flash not found."')
+
if Kodi == 'True':
cmd = 'mkdir -p %s/ImageBoot/%s/home/root/.kodi > /dev/null 2>&1' % (media, target)
rc = os.system(cmd)
if os.path.exists('/home/root/.kodi'):
os.system('echo "Kodi set ok."')
else:
- if not os.path.exists('/home/root/.kodi'):
+ if not os.path.exists('/home/root/.kodi'):
if not os.path.exists('/.multinfo'):
if os.path.exists('/media/hdd/.kodi'):
cmd = 'mv /media/hdd/.kodi /media/hdd/.kodi_flash; ln -sf "/media/hdd/.kodi_flash" "/home/root/.kodi"; ln -sf "/home/root/.kodi" "/media/hdd/.kodi" '
- rc = os.system(cmd)
+ rc = os.system(cmd)
os.system('echo "Kodi fix ok."')
else:
os.system('echo "Kodi not found.."')
- else:
+ else:
os.system('echo "Kodi path possible only from flash."')
- else:
+ else:
os.system('echo "Kodi not found."')
if BlackHole == 'True':
@@ -357,13 +369,13 @@ def NEOBootMainEx(source, target, stopenigma, CopyFiles, CopyKernel, TvList, Lan
try:
text = ver.split('-')[0]
except:
- text = ''
-
+ text = ''
+
cmd = 'mkdir ' + getNeoLocation() + 'ImageBoot/%s/boot/blackhole' % target
rc = os.system(cmd)
cmd = 'cp -f ' + extensions_path + 'NeoBoot/bin/version ' + getNeoLocation() + 'ImageBoot/%s/boot/blackhole' % target
rc = os.system(cmd)
- cmd = 'mv ' + getNeoLocation() + 'ImageBoot/' +target+ '/usr/lib/enigma2/python/Blackhole/BhUtils.pyo ' + getNeoLocation() + 'ImageBoot/%s/usr/lib/enigma2/python/Blackhole/BhUtils.pyo.org' % target
+ cmd = 'mv ' + getNeoLocation() + 'ImageBoot/' + target + '/usr/lib/enigma2/python/Blackhole/BhUtils.pyo ' + getNeoLocation() + 'ImageBoot/%s/usr/lib/enigma2/python/Blackhole/BhUtils.pyo.org' % target
rc = os.system(cmd)
cmd = 'cp -af ' + extensions_path + 'NeoBoot/bin/utilsbh ' + getNeoLocation() + 'ImageBoot/%s/usr/lib/enigma2/python/Blackhole/BhUtils.py' % target
rc = os.system(cmd)
@@ -371,7 +383,7 @@ def NEOBootMainEx(source, target, stopenigma, CopyFiles, CopyKernel, TvList, Lan
temp_file = open(localfile, 'w')
temp_file.write(text)
temp_file.close()
- cmd = 'mv ' + getNeoLocation() + 'ImageBoot/' +target+ '/usr/bin/enigma2 ' + getNeoLocation() + 'ImageBoot/%s/usr/bin/enigma2-or' % target
+ cmd = 'mv ' + getNeoLocation() + 'ImageBoot/' + target + '/usr/bin/enigma2 ' + getNeoLocation() + 'ImageBoot/%s/usr/bin/enigma2-or' % target
rc = os.system(cmd)
fail = '' + getNeoLocation() + 'ImageBoot/%s/usr/bin/enigma2-or' % target
f = open(fail, 'r')
@@ -404,7 +416,7 @@ def NEOBootMainEx(source, target, stopenigma, CopyFiles, CopyKernel, TvList, Lan
cmd = 'echo -n "\n\n/usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/files/userscript.sh \n\nexit 0" >> %s/ImageBoot/%s/etc/rc.local' % (media, target)
rc = os.system(cmd)
cmd = 'chmod 0755 %s/ImageBoot/%s/etc/rc.local' % (media, target)
- rc = os.system(cmd)
+ rc = os.system(cmd)
if os.path.exists('%s/ImageBoot/%s/etc/init.d/rc.local' % (media, target)):
filename = '%s/ImageBoot/%s/etc/init.d/rc.local' % (media, target)
@@ -426,10 +438,10 @@ def NEOBootMainEx(source, target, stopenigma, CopyFiles, CopyKernel, TvList, Lan
cmd = 'chmod 0755 %s/ImageBoot/%s/etc/init.d/rc.local' % (media, target)
rc = os.system(cmd)
- if not os.path.exists('%s/ImageBoot/%s/etc/init.d/rc.local' % (media, target)) and not os.path.exists('%s/ImageBoot/%s/etc/rc.local' % (media, target)) :
- if os.path.exists('%s/ImageBoot/%s/etc/init.d' % (media, target)):
+ if not os.path.exists('%s/ImageBoot/%s/etc/init.d/rc.local' % (media, target)) and not os.path.exists('%s/ImageBoot/%s/etc/rc.local' % (media, target)):
+ if os.path.exists('%s/ImageBoot/%s/etc/init.d' % (media, target)):
# cmd = 'ln -s %sImageBoot/%s/usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/files/userscript.sh %sImageBoot/%s/etc/rcS.d/S99neo.local' % (media,
-# target,
+# target,
# media,
# target)
cmd = 'cp -af /usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/files/userscript.sh %sImageBoot/%s/etc/rcS.d/S99neo.local' % (media, target)
@@ -440,16 +452,16 @@ def NEOBootMainEx(source, target, stopenigma, CopyFiles, CopyKernel, TvList, Lan
os.system('echo "/etc/init.d not found."')
os.system('echo "Copied file neo_userscript.sh"')
- if not os.path.exists('' + getNeoLocation() + 'ImageBoot/.without_copying'):
+ if not os.path.exists('' + getNeoLocation() + 'ImageBoot/.without_copying'):
if not os.path.exists('%s/ImageBoot/%s/etc/enigma2' % (media, target)):
cmd = 'mkdir -p %s/ImageBoot/%s/etc/enigma2' % (media, target)
rc = os.system(cmd)
cmd = 'touch %s/ImageBoot/%s/etc/enigma2/settings' % (media, target)
rc = os.system(cmd)
cmd = 'grep "config.Nims" /etc/enigma2/settings >> %s/ImageBoot/%s/etc/enigma2/settings' % (media, target)
- rc = os.system(cmd)
+ rc = os.system(cmd)
cmd1 = 'grep "av.videomode.DVI" /etc/enigma2/settings >> %s/ImageBoot/%s/etc/enigma2/settings' % (media, target)
- rc = os.system(cmd1)
+ rc = os.system(cmd1)
cmd2 = 'grep "config.OpenWebif" /etc/enigma2/settings >> %s/ImageBoot/%s/etc/enigma2/settings' % (media, target)
rc = os.system(cmd2)
cmd3 = 'grep "config.osd" /etc/enigma2/settings >> %s/ImageBoot/%s/etc/enigma2/settings' % (media, target)
@@ -457,7 +469,7 @@ def NEOBootMainEx(source, target, stopenigma, CopyFiles, CopyKernel, TvList, Lan
cmd4 = 'grep "config.timezone.val" /etc/enigma2/settings >> %s/ImageBoot/%s/etc/enigma2/settings' % (media, target)
rc = os.system(cmd4)
cmd5 = 'grep "config.servicelist.startuproot" /etc/enigma2/settings >> %s/ImageBoot/%s/etc/enigma2/settings' % (media, target)
- rc = os.system(cmd5)
+ rc = os.system(cmd5)
cmd6 = 'grep "UUID=" /etc/fstab >> %s/ImageBoot/%s/etc/fstab' % (media, target)
rc = os.system(cmd6)
@@ -478,17 +490,17 @@ def NEOBootMainEx(source, target, stopenigma, CopyFiles, CopyKernel, TvList, Lan
elif line.find('/dev/mmcblk0p4') != -1:
line = '#' + line
elif line.find('/dev/mmcblk0p5') != -1:
- line = '#' + line
+ line = '#' + line
elif line.find('/dev/mmcblk0p6') != -1:
- line = '#' + line
+ line = '#' + line
elif line.find('/dev/mmcblk0p7') != -1:
- line = '#' + line
+ line = '#' + line
elif line.find('/dev/mmcblk0p8') != -1:
- line = '#' + line
+ line = '#' + line
elif line.find('/dev/mmcblk0p9') != -1:
- line = '#' + line
+ line = '#' + line
elif line.find('/dev/root') != -1:
- line = '#' + line
+ line = '#' + line
elif line.find('/dev/mtdblock1') != -1:
line = '#' + line
elif line.find('/dev/mtdblock2') != -1:
@@ -498,15 +510,15 @@ def NEOBootMainEx(source, target, stopenigma, CopyFiles, CopyKernel, TvList, Lan
elif line.find('/dev/mtdblock4') != -1:
line = '#' + line
elif line.find('/dev/mtdblock5') != -1:
- line = '#' + line
+ line = '#' + line
elif line.find('/dev/mtdblock6') != -1:
- line = '#' + line
+ line = '#' + line
elif line.find('/dev/mtdblock7') != -1:
- line = '#' + line
+ line = '#' + line
elif line.find('/dev/mtdblock8') != -1:
- line = '#' + line
+ line = '#' + line
elif line.find('/dev/mtdblock9') != -1:
- line = '#' + line
+ line = '#' + line
elif line.find('/dev/root') != -1:
line = '#' + line
out.write(line)
@@ -514,7 +526,7 @@ def NEOBootMainEx(source, target, stopenigma, CopyFiles, CopyKernel, TvList, Lan
f.close()
out.close()
os.rename(namefile2, namefile)
-
+
tpmd = media + '/ImageBoot/' + target + '/etc/init.d/tpmd'
if os.path.exists(tpmd):
os.system('rm ' + tpmd)
@@ -627,7 +639,7 @@ def NEOBootMainEx(source, target, stopenigma, CopyFiles, CopyKernel, TvList, Lan
os.rename(filename2, filename)
cmd = 'chmod -R 0755 %s' % filename
rc = os.system(cmd)
-
+
# cmd = 'cp -f ' + extensions_path + 'NeoBoot/bin/hdd ' + getNeoLocation() + 'ImageBoot/%s/etc/init.d/hddusb' % target
# rc = os.system(cmd)
@@ -637,8 +649,8 @@ def NEOBootMainEx(source, target, stopenigma, CopyFiles, CopyKernel, TvList, Lan
cmd = 'cp -af /usr/lib/enigma2/python/Tools/Testinout.py ' + getNeoLocation() + 'ImageBoot/%s/usr/lib/enigma2/python/Tools/' % target
rc = os.system(cmd)
os.system('mkdir -p ' + media_target + '/media/hdd' + dev_null)
- os.system('mkdir -p ' + media_target + '/media/usb' + dev_null)
- os.system('mkdir -p ' + media_target + '/var/lib/opkg/info/' + dev_null)
+ os.system('mkdir -p ' + media_target + '/media/usb' + dev_null)
+ os.system('mkdir -p ' + media_target + '/var/lib/opkg/info/' + dev_null)
os.system('touch ' + getNeoLocation() + 'ImageBoot/.data; echo "Data instalacji image" > ' + getNeoLocation() + 'ImageBoot/.data; echo " "; date > ' + getNeoLocation() + 'ImageBoot/.data')
os.system('mv -f ' + getNeoLocation() + 'ImageBoot/.data ' + getNeoLocation() + 'ImageBoot/%s/.data' % target)
cmd = 'touch /tmp/.init_reboot'
@@ -649,64 +661,65 @@ def NEOBootMainEx(source, target, stopenigma, CopyFiles, CopyKernel, TvList, Lan
os.system('cp ' + getNeoLocation() + 'ImageBoot/.neonextboot ' + getNeoLocation() + 'ImageBoot/%s/.multinfo' % target)
out = open(mediahome + '.neonextboot', 'w')
out.write('Flash')
- out.close()
- if '.tar.xz' not in source and not os.path.exists('' + getNeoLocation() + '/ImageBoot/%s/etc/issue' % target):
+ out.close()
+ if '.tar.xz' not in source and not os.path.exists('' + getNeoLocation() + '/ImageBoot/%s/etc/issue' % target):
os.system('echo ""; echo "No system installed! The reason for the installation error may be badly packed image files or it is not a system for your model."')
os.system('echo "The installed system may not start. Check the correctness of the installed image directory!!!"')
- os.system('rm -r ' + getNeoLocation() + '/ImageBoot/%s' % target )
+ os.system('rm -r ' + getNeoLocation() + '/ImageBoot/%s' % target)
if os.path.exists('' + getNeoLocation() + 'ubi'):
- os.system('rm -r ' + getNeoLocation() + 'ubi')
+ os.system('rm -r ' + getNeoLocation() + 'ubi')
if os.path.exists('' + getNeoLocation() + 'image_cache/'):
os.system('rm -r ' + getNeoLocation() + 'image_cache')
if os.path.exists('' + getNeoLocation() + 'ImageBoot/.without_copying'):
- os.system('rm -f ' + getNeoLocation() + 'ImageBoot/.without_copying')
+ os.system('rm -f ' + getNeoLocation() + 'ImageBoot/.without_copying')
rc = RemoveUnpackDirs()
if os.path.exists('/tmp/init4'):
os.system('rm -f /tmp/init4; init 3')
os.system('echo "End of installation:"; date +%T')
- os.system('echo "If you want to save the installation process from the console press green."')
+ 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'):
- rc = os.system('rm -r ' + getNeoLocation() + 'ImagesUpload/unpackedzip')
- elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/*.bin'):
- rc = os.system('rm -r ' + getNeoLocation() + 'ImagesUpload/*.bin')
- elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/*.txt'):
- rc = os.system('rm -r ' + getNeoLocation() + 'ImagesUpload/*.txt')
+ if os.path.exists('' + getNeoLocation() + 'ImagesUpload/unpackedzip'):
+ rc = os.system('rm -r ' + getNeoLocation() + 'ImagesUpload/unpackedzip')
+ elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/*.bin'):
+ rc = os.system('rm -r ' + getNeoLocation() + 'ImagesUpload/*.bin')
+ elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/*.txt'):
+ rc = os.system('rm -r ' + getNeoLocation() + 'ImagesUpload/*.txt')
elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/vuplus'):
rc = os.system('rm -r ' + getNeoLocation() + 'ImagesUpload/vuplus')
elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/sf4008'):
rc = os.system('rm -r ' + getNeoLocation() + 'ImagesUpload/sf4008')
elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/osmio4k'):
- rc = os.system('rm -r ' + getNeoLocation() + 'ImagesUpload/osmio4k')
+ rc = os.system('rm -r ' + getNeoLocation() + 'ImagesUpload/osmio4k')
elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/osmio4kplus'):
- rc = os.system('rm -r ' + getNeoLocation() + 'ImagesUpload/osmio4kplus')
+ rc = os.system('rm -r ' + getNeoLocation() + 'ImagesUpload/osmio4kplus')
elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/dm900'):
- rc = os.system('rm -r ' + getNeoLocation() + 'ImagesUpload/dm900')
- elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/hd60'):
- rc = os.system('rm -r ' + getNeoLocation() + 'ImagesUpload/hd60')
- elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/hd61'):
- rc = os.system('rm -r ' + getNeoLocation() + 'ImagesUpload/hd61')
+ rc = os.system('rm -r ' + getNeoLocation() + 'ImagesUpload/dm900')
+ elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/hd60'):
+ rc = os.system('rm -r ' + getNeoLocation() + 'ImagesUpload/hd60')
+ elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/hd61'):
+ rc = os.system('rm -r ' + getNeoLocation() + 'ImagesUpload/hd61')
elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/hd51'):
rc = os.system('rm -r ' + getNeoLocation() + 'ImagesUpload/hd51')
elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/bre2ze4k'):
- rc = os.system('rm -r ' + getNeoLocation() + 'ImagesUpload/bre2ze4k')
+ rc = os.system('rm -r ' + getNeoLocation() + 'ImagesUpload/bre2ze4k')
elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/multibox'):
rc = os.system('rm -r ' + getNeoLocation() + 'ImagesUpload/multibox')
elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/multiboxse'):
- rc = os.system('rm -r ' + getNeoLocation() + 'ImagesUpload/multiboxse')
+ rc = os.system('rm -r ' + getNeoLocation() + 'ImagesUpload/multiboxse')
elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/unforce_multibox.txt'):
- rc = os.system('rm -r ' + getNeoLocation() + 'ImagesUpload/unforce_multibox.txt')
+ rc = os.system('rm -r ' + getNeoLocation() + 'ImagesUpload/unforce_multibox.txt')
elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/axas'):
- rc = os.system('rm -r ' + getNeoLocation() + 'ImagesUpload/axas')
+ rc = os.system('rm -r ' + getNeoLocation() + 'ImagesUpload/axas')
elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/miraclebox'):
rc = os.system('rm -r ' + getNeoLocation() + 'ImagesUpload/miraclebox')
elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/e4hd'):
- rc = os.system('rm -r ' + getNeoLocation() + 'ImagesUpload/e4hd')
+ rc = os.system('rm -r ' + getNeoLocation() + 'ImagesUpload/e4hd')
elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/update'):
rc = os.system('rm -r ' + getNeoLocation() + 'ImagesUpload/update')
elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/rootfs.tar.xz'):
@@ -714,92 +727,92 @@ def RemoveUnpackDirs():
elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/*.nfi'):
rc = os.system('rm -r ' + getNeoLocation() + 'ImagesUpload/*.nfi')
elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/zgemma'):
- rc = os.system('rm -r ' + getNeoLocation() + 'ImagesUpload/zgemma')
+ rc = os.system('rm -r ' + getNeoLocation() + 'ImagesUpload/zgemma')
elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/formuler1'):
rc = os.system('rm -r ' + getNeoLocation() + 'ImagesUpload/formuler1')
elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/formuler3'):
rc = os.system('rm -r ' + getNeoLocation() + 'ImagesUpload/formuler3')
elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/formuler4turbo'):
- rc = os.system('rm -r ' + getNeoLocation() + 'ImagesUpload/formuler4turbo')
+ rc = os.system('rm -r ' + getNeoLocation() + 'ImagesUpload/formuler4turbo')
elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/et*'):
- rc = os.system('rm -r ' + getNeoLocation() + 'ImagesUpload/et*')
+ rc = os.system('rm -r ' + getNeoLocation() + 'ImagesUpload/et*')
elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/xpeedl*'):
rc = os.system('rm -r ' + getNeoLocation() + 'ImagesUpload/xpeedl*')
elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/osmini'):
- rc = os.system('rm -r ' + getNeoLocation() + 'ImagesUpload/osmini')
+ rc = os.system('rm -r ' + getNeoLocation() + 'ImagesUpload/osmini')
elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/xp1000 '):
- rc = os.system('rm -r ' + getNeoLocation() + 'ImagesUpload/xp1000 ')
+ rc = os.system('rm -r ' + getNeoLocation() + 'ImagesUpload/xp1000 ')
elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/dinobot '):
- rc = os.system('rm -r ' + getNeoLocation() + 'ImagesUpload/dinobot ')
+ rc = os.system('rm -r ' + getNeoLocation() + 'ImagesUpload/dinobot ')
elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/e2/update'):
- rc = os.system('rm -r ' + getNeoLocation() + 'ImagesUpload/e2')
+ rc = os.system('rm -r ' + getNeoLocation() + 'ImagesUpload/e2')
elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/et1x000'):
- rc = os.system('rm -r ' + getNeoLocation() + 'ImagesUpload/et1x000')
+ rc = os.system('rm -r ' + getNeoLocation() + 'ImagesUpload/et1x000')
elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/protek4k'):
- rc = os.system('rm -r ' + getNeoLocation() + 'ImagesUpload/protek4k')
+ rc = os.system('rm -r ' + getNeoLocation() + 'ImagesUpload/protek4k')
elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/dm920 '):
- rc = os.system('rm -r ' + getNeoLocation() + 'ImagesUpload/dm920 ')
+ rc = os.system('rm -r ' + getNeoLocation() + 'ImagesUpload/dm920 ')
elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/dreamtwo '):
- rc = os.system('rm -r ' + getNeoLocation() + 'ImagesUpload/dreamtwo ')
- elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/multibox') or os.path.exists('' + getNeoLocation() + 'ImagesUpload/multiboxse') :
- rc = os.system('mv ' + getNeoLocation() + 'ImagesUpload/multibox ' + getNeoLocation() + 'ImagesUpload/multibox; rm -r ' + getNeoLocation() + 'ImagesUpload/multibox')
- elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/octagon/sf8008'):
- rc = os.system('mv ' + getNeoLocation() + 'ImagesUpload/usb_update.bin ' + getNeoLocation() + 'ImagesUpload/octagon; rm -r ' + getNeoLocation() + 'ImagesUpload/octagon')
+ rc = os.system('rm -r ' + getNeoLocation() + 'ImagesUpload/dreamtwo ')
+ elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/multibox') or os.path.exists('' + getNeoLocation() + 'ImagesUpload/multiboxse'):
+ rc = os.system('mv ' + getNeoLocation() + 'ImagesUpload/multibox ' + getNeoLocation() + 'ImagesUpload/multibox; rm -r ' + getNeoLocation() + 'ImagesUpload/multibox')
+ elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/octagon/sf8008'):
+ rc = os.system('mv ' + getNeoLocation() + 'ImagesUpload/usb_update.bin ' + getNeoLocation() + 'ImagesUpload/octagon; rm -r ' + getNeoLocation() + 'ImagesUpload/octagon')
elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/h7'):
- rc = os.system('mv ' + getNeoLocation() + 'ImagesUpload/bootargs.bin ' + getNeoLocation() + 'ImagesUpload/h7; mv ' + getNeoLocation() + 'ImagesUpload/fastboot.bin ' + getNeoLocation() + 'ImagesUpload/h7')
- rc = os.system('rm -r ' + getNeoLocation() + 'ImagesUpload/h7')
+ rc = os.system('mv ' + getNeoLocation() + 'ImagesUpload/bootargs.bin ' + getNeoLocation() + 'ImagesUpload/h7; mv ' + getNeoLocation() + 'ImagesUpload/fastboot.bin ' + getNeoLocation() + 'ImagesUpload/h7')
+ rc = os.system('rm -r ' + getNeoLocation() + 'ImagesUpload/h7')
elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/h9'):
- rc = os.system('mv ' + getNeoLocation() + 'ImagesUpload/bootargs.bin ' + getNeoLocation() + 'ImagesUpload/h9; mv ' + getNeoLocation() + 'ImagesUpload/fastboot.bin ' + getNeoLocation() + 'ImagesUpload/h9')
- rc = os.system('rm -r ' + getNeoLocation() + 'ImagesUpload/h9')
+ rc = os.system('mv ' + getNeoLocation() + 'ImagesUpload/bootargs.bin ' + getNeoLocation() + 'ImagesUpload/h9; mv ' + getNeoLocation() + 'ImagesUpload/fastboot.bin ' + getNeoLocation() + 'ImagesUpload/h9')
+ rc = os.system('rm -r ' + getNeoLocation() + 'ImagesUpload/h9')
elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/h9se'):
- rc = os.system('mv ' + getNeoLocation() + 'ImagesUpload/bootargs.bin ' + getNeoLocation() + 'ImagesUpload/h9se; mv ' + getNeoLocation() + 'ImagesUpload/fastboot.bin ' + getNeoLocation() + 'ImagesUpload/h9se')
- rc = os.system('rm -r ' + getNeoLocation() + 'ImagesUpload/h9se')
+ rc = os.system('mv ' + getNeoLocation() + 'ImagesUpload/bootargs.bin ' + getNeoLocation() + 'ImagesUpload/h9se; mv ' + getNeoLocation() + 'ImagesUpload/fastboot.bin ' + getNeoLocation() + 'ImagesUpload/h9se')
+ rc = os.system('rm -r ' + getNeoLocation() + 'ImagesUpload/h9se')
elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/i55plus'):
- rc = os.system('mv ' + getNeoLocation() + 'ImagesUpload/bootargs.bin ' + getNeoLocation() + 'ImagesUpload/i55plus; mv ' + getNeoLocation() + 'ImagesUpload/fastboot.bin ' + getNeoLocation() + 'ImagesUpload/i55plus')
- rc = os.system('rm -r ' + getNeoLocation() + 'ImagesUpload/i55plus')
+ rc = os.system('mv ' + getNeoLocation() + 'ImagesUpload/bootargs.bin ' + getNeoLocation() + 'ImagesUpload/i55plus; mv ' + getNeoLocation() + 'ImagesUpload/fastboot.bin ' + getNeoLocation() + 'ImagesUpload/i55plus')
+ rc = os.system('rm -r ' + getNeoLocation() + 'ImagesUpload/i55plus')
elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/h9combo'):
- rc = os.system('mv ' + getNeoLocation() + 'ImagesUpload/force_h9combo_READ.ME ' + getNeoLocation() + 'ImagesUpload/h9combo; mv ' + getNeoLocation() + 'ImagesUpload/unforce_h9combo.txt ' + getNeoLocation() + 'ImagesUpload/h9combo')
- rc = os.system('rm -r ' + getNeoLocation() + 'ImagesUpload/h9combo')
+ rc = os.system('mv ' + getNeoLocation() + 'ImagesUpload/force_h9combo_READ.ME ' + getNeoLocation() + 'ImagesUpload/h9combo; mv ' + getNeoLocation() + 'ImagesUpload/unforce_h9combo.txt ' + getNeoLocation() + 'ImagesUpload/h9combo')
+ rc = os.system('rm -r ' + getNeoLocation() + 'ImagesUpload/h9combo')
elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/h9combose'):
- rc = os.system('mv ' + getNeoLocation() + 'ImagesUpload/force_h9combose_READ.ME ' + getNeoLocation() + 'ImagesUpload/h9combo; mv ' + getNeoLocation() + 'ImagesUpload/unforce_h9combose.txt ' + getNeoLocation() + 'ImagesUpload/h9combose')
+ rc = os.system('mv ' + getNeoLocation() + 'ImagesUpload/force_h9combose_READ.ME ' + getNeoLocation() + 'ImagesUpload/h9combo; mv ' + getNeoLocation() + 'ImagesUpload/unforce_h9combose.txt ' + getNeoLocation() + 'ImagesUpload/h9combose')
rc = os.system('rm -r ' + getNeoLocation() + 'ImagesUpload/h9combose')
elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/h10'):
- rc = os.system('mv ' + getNeoLocation() + 'ImagesUpload/force_h10_READ.ME ' + getNeoLocation() + 'ImagesUpload/h10; mv ' + getNeoLocation() + 'ImagesUpload/unforce_h10.txt ' + getNeoLocation() + 'ImagesUpload/h10')
- rc = os.system('rm -r ' + getNeoLocation() + 'ImagesUpload/h10')
+ rc = os.system('mv ' + getNeoLocation() + 'ImagesUpload/force_h10_READ.ME ' + getNeoLocation() + 'ImagesUpload/h10; mv ' + getNeoLocation() + 'ImagesUpload/unforce_h10.txt ' + getNeoLocation() + 'ImagesUpload/h10')
+ rc = os.system('rm -r ' + getNeoLocation() + 'ImagesUpload/h10')
elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/uclan'):
- if os.path.exists('' + getNeoLocation() + 'ImagesUpload/usb_update.bin'):
- rc = os.system('mv ' + getNeoLocation() + 'ImagesUpload/usb_update.bin ' + getNeoLocation() + 'ImagesUpload/uclan')
- rc = os.system('rm -r ' + getNeoLocation() + 'ImagesUpload/uclan')
+ if os.path.exists('' + getNeoLocation() + 'ImagesUpload/usb_update.bin'):
+ rc = os.system('mv ' + getNeoLocation() + 'ImagesUpload/usb_update.bin ' + getNeoLocation() + 'ImagesUpload/uclan')
+ rc = os.system('rm -r ' + getNeoLocation() + 'ImagesUpload/uclan')
elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/beyonwiz'):
- rc = os.system('mv ' + getNeoLocation() + 'ImagesUpload/apploader.bin ' + getNeoLocation() + 'ImagesUpload/beyonwiz')
- rc = os.system('mv ' + getNeoLocation() + 'ImagesUpload/bootargs.bin ' + getNeoLocation() + 'ImagesUpload/beyonwiz')
- rc = os.system('mv ' + getNeoLocation() + 'ImagesUpload/fastboot.bin ' + getNeoLocation() + 'ImagesUpload/beyonwiz')
- rc = os.system('rm -r ' + getNeoLocation() + 'ImagesUpload/beyonwiz')
+ rc = os.system('mv ' + getNeoLocation() + 'ImagesUpload/apploader.bin ' + getNeoLocation() + 'ImagesUpload/beyonwiz')
+ rc = os.system('mv ' + getNeoLocation() + 'ImagesUpload/bootargs.bin ' + getNeoLocation() + 'ImagesUpload/beyonwiz')
+ rc = os.system('mv ' + getNeoLocation() + 'ImagesUpload/fastboot.bin ' + getNeoLocation() + 'ImagesUpload/beyonwiz')
+ rc = os.system('rm -r ' + getNeoLocation() + 'ImagesUpload/beyonwiz')
elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/amiko'):
- rc = os.system('mv ' + getNeoLocation() + 'ImagesUpload/usb_update.bin ' + getNeoLocation() + 'ImagesUpload/amiko')
- rc = os.system('mv ' + getNeoLocation() + 'ImagesUpload/apploader.bin ' + getNeoLocation() + 'ImagesUpload/amiko')
- rc = os.system('mv ' + getNeoLocation() + 'ImagesUpload/bootargs.bin ' + getNeoLocation() + 'ImagesUpload/amiko')
- rc = os.system('mv ' + getNeoLocation() + 'ImagesUpload/fastboot.bin ' + getNeoLocation() + 'ImagesUpload/amiko')
+ rc = os.system('mv ' + getNeoLocation() + 'ImagesUpload/usb_update.bin ' + getNeoLocation() + 'ImagesUpload/amiko')
+ rc = os.system('mv ' + getNeoLocation() + 'ImagesUpload/apploader.bin ' + getNeoLocation() + 'ImagesUpload/amiko')
+ rc = os.system('mv ' + getNeoLocation() + 'ImagesUpload/bootargs.bin ' + getNeoLocation() + 'ImagesUpload/amiko')
+ rc = os.system('mv ' + getNeoLocation() + 'ImagesUpload/fastboot.bin ' + getNeoLocation() + 'ImagesUpload/amiko')
rc = os.system('rm -r ' + getNeoLocation() + 'ImagesUpload/amiko')
elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/gigablue'):
- rc = os.system('mv ' + getNeoLocation() + 'ImagesUpload/usb_update.bin ' + getNeoLocation() + 'ImagesUpload/gigablue')
- rc = os.system('mv ' + getNeoLocation() + 'ImagesUpload/apploader.bin ' + getNeoLocation() + 'ImagesUpload/gigablue')
- rc = os.system('mv ' + getNeoLocation() + 'ImagesUpload/bootargs.bin ' + getNeoLocation() + 'ImagesUpload/gigablue')
- rc = os.system('mv ' + getNeoLocation() + 'ImagesUpload/fastboot.bin ' + getNeoLocation() + 'ImagesUpload/gigablue')
- rc = os.system('rm -r ' + getNeoLocation() + 'ImagesUpload/gigablue')
+ rc = os.system('mv ' + getNeoLocation() + 'ImagesUpload/usb_update.bin ' + getNeoLocation() + 'ImagesUpload/gigablue')
+ rc = os.system('mv ' + getNeoLocation() + 'ImagesUpload/apploader.bin ' + getNeoLocation() + 'ImagesUpload/gigablue')
+ rc = os.system('mv ' + getNeoLocation() + 'ImagesUpload/bootargs.bin ' + getNeoLocation() + 'ImagesUpload/gigablue')
+ rc = os.system('mv ' + getNeoLocation() + 'ImagesUpload/fastboot.bin ' + getNeoLocation() + 'ImagesUpload/gigablue')
+ rc = os.system('rm -r ' + getNeoLocation() + 'ImagesUpload/gigablue')
elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/gigablue'):
- rc = os.system('mv ' + getNeoLocation() + 'ImagesUpload/usb_update.bin ' + getNeoLocation() + 'ImagesUpload/gigablue')
- rc = os.system('mv ' + getNeoLocation() + 'ImagesUpload/apploader.bin ' + getNeoLocation() + 'ImagesUpload/gigablue')
- rc = os.system('mv ' + getNeoLocation() + 'ImagesUpload/bootargs.bin ' + getNeoLocation() + 'ImagesUpload/gigablue')
- rc = os.system('mv ' + getNeoLocation() + 'ImagesUpload/fastboot.bin ' + getNeoLocation() + 'ImagesUpload/gigablue')
- rc = os.system('rm -r ' + getNeoLocation() + 'ImagesUpload/gigablue')
+ rc = os.system('mv ' + getNeoLocation() + 'ImagesUpload/usb_update.bin ' + getNeoLocation() + 'ImagesUpload/gigablue')
+ rc = os.system('mv ' + getNeoLocation() + 'ImagesUpload/apploader.bin ' + getNeoLocation() + 'ImagesUpload/gigablue')
+ rc = os.system('mv ' + getNeoLocation() + 'ImagesUpload/bootargs.bin ' + getNeoLocation() + 'ImagesUpload/gigablue')
+ rc = os.system('mv ' + getNeoLocation() + 'ImagesUpload/fastboot.bin ' + getNeoLocation() + 'ImagesUpload/gigablue')
+ rc = os.system('rm -r ' + getNeoLocation() + 'ImagesUpload/gigablue')
elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/rootfs.tar.gz'):
rc = os.system('rm -r ' + getNeoLocation() + 'ImagesUpload/rootfs.tar.gz')
- elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/rootfs.tar.xz') :
- rc = os.system('rm -r ' + getNeoLocation() + 'ImagesUpload/rootfs.tar.xz')
- elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/rootfs.tar.bz2') :
+ elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/rootfs.tar.xz'):
+ rc = os.system('rm -r ' + getNeoLocation() + 'ImagesUpload/rootfs.tar.xz')
+ elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/rootfs.tar.bz2'):
rc = os.system('rm -r ' + getNeoLocation() + 'ImagesUpload/rootfs.tar.bz2')
- elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/et10000') :
+ elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/et10000'):
rc = os.system('rm -r ' + getNeoLocation() + 'ImagesUpload/et10000')
@@ -808,7 +821,7 @@ def NEOBootExtract(source, target, ZipDelete):
os.system('echo "Press green to hide Console or red to abort the installation\nInstallation started:"; date +%T;echo "Extracting the installation file..."')
if os.path.exists('' + getNeoLocation() + 'ImageBoot/.without_copying'):
- os.system('rm -f ' + getNeoLocation() + 'ImageBoot/.without_copying')
+ os.system('rm -f ' + getNeoLocation() + 'ImageBoot/.without_copying')
if os.path.exists('' + getNeoLocation() + 'image_cache'):
os.system('rm -rf ' + getNeoLocation() + 'image_cache')
@@ -816,7 +829,7 @@ def NEOBootExtract(source, target, ZipDelete):
sourcefile2 = media + '/ImagesUpload/%s.nfi' % source
sourcefile3 = media + '/ImagesUpload/%s.rar' % source
sourcefile4 = media + '/ImagesUpload/%s.gz' % source
-
+
#Instalacja *.nfi
if os.path.exists(sourcefile2) is True:
if sourcefile2.endswith('.nfi'):
@@ -837,13 +850,13 @@ def NEOBootExtract(source, target, ZipDelete):
if os.path.exists(sourcefile3) is True:
if sourcefile3.endswith('.rar'):
os.system('echo "Installing iamge x.rar..."')
- cmd = 'unrar e ' + sourcefile3+ ' ' + getNeoLocation() + 'ImagesUpload/ > /dev/null 2>&1'
+ cmd = 'unrar e ' + sourcefile3 + ' ' + getNeoLocation() + 'ImagesUpload/ > /dev/null 2>&1'
rc = os.system(cmd)
if ZipDelete == 'True':
rc = os.system('rm -rf ' + sourcefile3)
else:
os.system('echo "NeoBoot keep the file: %s for reinstallation."' % sourcefile3)
-
+
#Instalacja *.zip
elif os.path.exists(sourcefile) is True:
os.system('unzip ' + sourcefile)
@@ -851,7 +864,7 @@ def NEOBootExtract(source, target, ZipDelete):
os.system('rm -rf ' + sourcefile)
#Instalacja MIPS
- if getCPUtype() == 'MIPS':
+ if getCPUtype() == 'MIPS':
if os.path.exists('' + getNeoLocation() + 'ubi') is False:
rc = os.system('mkdir ' + getNeoLocation() + 'ubi')
to = '' + getNeoLocation() + 'ImageBoot/' + target
@@ -868,7 +881,7 @@ def NEOBootExtract(source, target, ZipDelete):
mtdfile = '/dev/mtd' + str(i)
if os.path.exists(mtdfile) is False:
break
-
+
mtd = str(i)
os.chdir(media + '/ImagesUpload')
#zgemma
@@ -998,16 +1011,15 @@ def NEOBootExtract(source, target, ZipDelete):
if os.path.exists('' + getNeoLocation() + 'ImagesUpload/vuplus/zero'):
os.chdir('zero')
rootfname = 'root_cfe_auto.bin'
-
+
#osmini
if os.path.exists('' + getNeoLocation() + 'ImagesUpload/osmini'):
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())
+ #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())
cmd = 'dd if=%s of=/dev/mtdblock%s bs=2048' % (rootfname, mtd)
rc = os.system(cmd)
cmd = 'ubiattach /dev/ubi_ctrl -m %s -O 2048' % mtd
@@ -1018,7 +1030,7 @@ def NEOBootExtract(source, target, ZipDelete):
rc = os.system(cmd)
rc = os.system('umount ' + getNeoLocation() + 'ubi')
cmd = 'ubidetach -m %s' % mtd
- rc = os.system(cmd)
+ rc = os.system(cmd)
rc = os.system('rmmod nandsim')
rc = os.system('rm ' + getNeoLocation() + 'image_cache')
@@ -1030,7 +1042,7 @@ def NEOBootExtract(source, target, ZipDelete):
os.system('echo "RESTART ZA 15 sekund..."')
rc = os.system('rm -rf /lib/modules/%s/kernel/drivers/mtd/nand/nandsim.ko ' % getKernelVersion())
-
+
os.system('rm -r %s/ImageBoot/%s' % (media, target))
os.system('sleep 5; init 4; sleep 5; init 3 ')
@@ -1108,7 +1120,7 @@ def NEOBootExtract(source, target, ZipDelete):
os.system('mv -f root_cfe_auto.bin rootfs.bin')
elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/vuplus/solose/root_cfe_auto.jffs2'):
os.chdir('solose')
- os.system('mv -f root_cfe_auto.jffs2 rootfs.bin')
+ os.system('mv -f root_cfe_auto.jffs2 rootfs.bin')
if os.path.exists('' + getNeoLocation() + 'ImagesUpload/vuplus/ultimo'):
os.chdir('ultimo')
os.system('mv -f root_cfe_auto.jffs2 rootfs.bin')
@@ -1131,7 +1143,7 @@ def NEOBootExtract(source, target, ZipDelete):
if os.path.exists('' + getNeoLocation() + 'ImagesUpload/vuplus/ultimo4k'):
os.chdir('ultimo4k')
if os.path.exists('' + getNeoLocation() + 'ImagesUpload/vuplus/duo4k'):
- os.chdir('duo4k')
+ os.chdir('duo4k')
if os.path.exists('' + getNeoLocation() + 'ImagesUpload/vuplus/duo4kse'):
os.chdir('duo4kse')
if os.path.exists('' + getNeoLocation() + 'ImagesUpload/vuplus/zero4k'):
@@ -1173,7 +1185,7 @@ def NEOBootExtract(source, target, ZipDelete):
if os.path.exists('' + getNeoLocation() + 'ImagesUpload/sf4008'):
os.chdir('sf4008')
if os.path.exists('' + getNeoLocation() + 'ImagesUpload/octagon/sf8008'):
- os.chdir('sf8008')
+ os.chdir('sf8008')
if os.path.exists('' + getNeoLocation() + 'ImagesUpload/gigablue'):
os.chdir('gigablue')
if os.path.exists('' + getNeoLocation() + 'ImagesUpload/gigablue/quad'):
@@ -1208,30 +1220,30 @@ def NEOBootExtract(source, target, ZipDelete):
if os.path.exists('' + getNeoLocation() + 'ImagesUpload/formuler4turbo'):
os.chdir('formuler4turbo')
- #Instalacja image ubi_reader
- os.system('echo "Instalacja - ubi_reader w toku..."')
+ #Instalacja image ubi_reader
+ os.system('echo "Instalacja - ubi_reader w toku..."')
if os.path.exists('' + getNeoLocation() + 'ImagesUpload/vuplus/root_cfe_auto.*'):
- os.system('mv -f root_cfe_auto.* rootfs.bin')
+ os.system('mv -f root_cfe_auto.* rootfs.bin')
cmd = 'chmod 777 ' + extensions_path + 'NeoBoot/ubi_reader/ubi_extract_files.py'
rc = os.system(cmd)
cmd = 'python ' + extensions_path + 'NeoBoot/ubi_reader/ubi_extract_files.py rootfs.bin -o' + getNeoLocation() + 'ubi'
rc = os.system(cmd)
os.chdir('/home/root')
- os.system('mv ' + getNeoLocation() + 'ubi/rootfs/* ' + getNeoLocation() + 'ImageBoot/%s/' % target)
+ os.system('mv ' + getNeoLocation() + 'ubi/rootfs/* ' + getNeoLocation() + 'ImageBoot/%s/' % target)
cmd = 'chmod -R +x ' + getNeoLocation() + 'ImageBoot/' + target
rc = os.system(cmd)
else:
os.system('echo "NeoBoot wykrył błąd !!! Prawdopodobnie brak ubi_reader lub nandsim."')
-
+
#ARM
elif getCPUtype() == 'ARMv7':
os.chdir('' + getNeoLocation() + 'ImagesUpload')
if os.path.exists('' + getNeoLocation() + 'ImagesUpload/h9/rootfs.ubi'):
os.chdir('h9')
- os.system('mv -f rootfs.ubi rootfs.bin')
- os.system('echo "Instalacja - ubi_reader w toku..."')
- print ("[NeoBoot] Extracting UBIFS image and moving extracted image to our target")
+ os.system('mv -f rootfs.ubi rootfs.bin')
+ os.system('echo "Instalacja - ubi_reader w toku..."')
+ print("[NeoBoot] Extracting UBIFS image and moving extracted image to our target")
cmd = 'chmod 777 ' + extensions_path + 'NeoBoot/ubi_reader/ubi_extract_files.py'
rc = os.system(cmd)
cmd = 'python ' + extensions_path + 'NeoBoot/ubi_reader/ubi_extract_files.py rootfs.bin -o ' + getNeoLocation() + 'ubi'
@@ -1243,13 +1255,13 @@ def NEOBootExtract(source, target, ZipDelete):
rc = os.system(cmd)
cmd = 'rm -rf ' + getNeoLocation() + 'ubi'
rc = os.system(cmd)
-
+
elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/axas'):
os.chdir('axas')
if os.path.exists('' + getNeoLocation() + 'ImagesUpload/axas/axashistwin'):
- os.chdir('axashistwin')
- os.system('echo "Instalacja - ubi_reader w toku..."')
- print ("[NeoBoot] Extracting UBIFS image and moving extracted image to our target")
+ os.chdir('axashistwin')
+ os.system('echo "Instalacja - ubi_reader w toku..."')
+ print("[NeoBoot] Extracting UBIFS image and moving extracted image to our target")
cmd = 'chmod 777 ' + extensions_path + 'NeoBoot/ubi_reader/ubi_extract_files.py'
rc = os.system(cmd)
cmd = 'python ' + extensions_path + 'NeoBoot/ubi_reader/ubi_extract_files.py rootfs.bin -o ' + getNeoLocation() + 'ubi'
@@ -1264,9 +1276,9 @@ def NEOBootExtract(source, target, ZipDelete):
elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/et10000/rootfs.bin'):
os.chdir('et10000')
- os.system('mv -f rootfs.bin rootfs.bin')
- os.system('echo "Instalacja - ubi_reader w toku..."')
- print ("[NeoBoot] Extracting UBIFS image and moving extracted image to our target")
+ os.system('mv -f rootfs.bin rootfs.bin')
+ os.system('echo "Instalacja - ubi_reader w toku..."')
+ print("[NeoBoot] Extracting UBIFS image and moving extracted image to our target")
cmd = 'chmod 777 ' + extensions_path + 'NeoBoot/ubi_reader/ubi_extract_files.py'
rc = os.system(cmd)
cmd = 'python ' + extensions_path + 'NeoBoot/ubi_reader/ubi_extract_files.py rootfs.bin -o ' + getNeoLocation() + 'ubi'
@@ -1277,7 +1289,7 @@ def NEOBootExtract(source, target, ZipDelete):
cmd = 'chmod -R +x ' + getNeoLocation() + 'ImageBoot/' + target
rc = os.system(cmd)
cmd = 'rm -rf ' + getNeoLocation() + 'ubi'
- rc = os.system(cmd)
+ rc = os.system(cmd)
#vuplus________________________
elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/vuplus/solo4k'):
os.system('echo "Please wait. System installation VuPlus Solo4K."')
@@ -1327,11 +1339,11 @@ def NEOBootExtract(source, target, ZipDelete):
elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/dm900'):
os.system('echo "Please wait. System installation Dreambox DM900."')
cmd = 'chmod 777 ' + getNeoLocation() + 'ImagesUpload/dm900/rootfs.tar.bz2; tar -jxf ' + getNeoLocation() + 'ImagesUpload/dm900/rootfs.tar.bz2 -C ' + getNeoLocation() + 'ImageBoot/' + target + ' > /dev/null 2>&1'
- rc = os.system(cmd)
+ rc = os.system(cmd)
elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/dm920'):
os.system('echo "Please wait. System installation Dreambox DM920."')
cmd = 'chmod 777 ' + getNeoLocation() + 'ImagesUpload/dm920; tar -jxf ' + getNeoLocation() + 'ImagesUpload/dm920/rootfs.tar.bz2 -C ' + getNeoLocation() + 'ImageBoot/' + target + ' > /dev/null 2>&1'
- rc = os.system(cmd)
+ rc = os.system(cmd)
elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/dreamtwo'):
os.system('echo "Please wait. System installation Dreambox dreamtwo."')
cmd = 'chmod 777 ' + getNeoLocation() + 'ImagesUpload/dreamtwo; tar -jxf ' + getNeoLocation() + 'ImagesUpload/dreamtwo/rootfs.tar.bz2 -C ' + getNeoLocation() + 'ImageBoot/' + target + ' > /dev/null 2>&1'
@@ -1339,7 +1351,7 @@ def NEOBootExtract(source, target, ZipDelete):
elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/hd51/rootfs.tar.bz2'):
os.system('echo "Please wait. System installation AX 4K Box HD51 "')
cmd = 'chmod 777 ' + getNeoLocation() + 'ImagesUpload/hd51/rootfs.tar.bz2; tar -jxf ' + getNeoLocation() + 'ImagesUpload/hd51/rootfs.tar.bz2 -C ' + getNeoLocation() + 'ImageBoot/' + target + ' > /dev/null 2>&1'
- rc = os.system(cmd)
+ rc = os.system(cmd)
elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/hd60'):
os.system('echo "Please wait. System installation AX HD60 4K"')
cmd = 'chmod 777 ' + getNeoLocation() + 'ImagesUpload/hd60/rootfs.tar.bz2; tar -jxf ' + getNeoLocation() + 'ImagesUpload/hd60/rootfs.tar.bz2 -C ' + getNeoLocation() + 'ImageBoot/' + target + ' > /dev/null 2>&1'
@@ -1355,11 +1367,11 @@ def NEOBootExtract(source, target, ZipDelete):
elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/multibox'):
os.system('echo "Please wait. System installation AX multi twin or combo"')
cmd = 'chmod 777 ' + getNeoLocation() + 'ImagesUpload/multibox/rootfs.tar.bz2; tar -jxf ' + getNeoLocation() + 'ImagesUpload/multibox/rootfs.tar.bz2 -C ' + getNeoLocation() + 'ImageBoot/' + target + ' > /dev/null 2>&1'
- rc = os.system(cmd)
+ rc = os.system(cmd)
elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/multiboxse'):
os.system('echo "Please wait. System installation maxytec"')
cmd = 'chmod 777 ' + getNeoLocation() + 'ImagesUpload/multiboxse/rootfs.tar.bz2; tar -jxf ' + getNeoLocation() + 'ImagesUpload/multiboxse/rootfs.tar.bz2 -C ' + getNeoLocation() + 'ImageBoot/' + target + ' > /dev/null 2>&1'
- rc = os.system(cmd)
+ rc = os.system(cmd)
elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/axas/axasc4k'):
os.system('echo "Please wait. System installation Axas his c4k"')
cmd = 'chmod 777 ' + getNeoLocation() + 'ImagesUpload/axas/axasc4k/rootfs.tar.bz2; tar -jxf ' + getNeoLocation() + 'ImagesUpload/axas/axasc4k/rootfs.tar.bz2 -C ' + getNeoLocation() + 'ImageBoot/' + target + ' > /dev/null 2>&1'
@@ -1369,7 +1381,7 @@ def NEOBootExtract(source, target, ZipDelete):
cmd = 'chmod 777 ' + getNeoLocation() + 'ImagesUpload/e4hd/rootfs.tar.bz2; tar -jxf ' + getNeoLocation() + 'ImagesUpload/e4hd/rootfs.tar.bz2 -C ' + getNeoLocation() + 'ImageBoot/' + target + ' > /dev/null 2>&1'
rc = os.system(cmd)
elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/gigablue/quad4k'):
- os.system('echo "Please wait. System installation GigaBlue quad4k"')
+ os.system('echo "Please wait. System installation GigaBlue quad4k"')
cmd = 'chmod 777 ' + getNeoLocation() + 'ImagesUpload/gigablue/quad4k/rootfs.tar.bz2; tar -jxf ' + getNeoLocation() + 'ImagesUpload/gigablue/quad4k/rootfs.tar.bz2 -C ' + getNeoLocation() + 'ImageBoot/' + target + ' > /dev/null 2>&1'
rc = os.system(cmd)
elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/gigablue/ue4k'):
@@ -1383,7 +1395,7 @@ def NEOBootExtract(source, target, ZipDelete):
elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/update/force3uhd'):
os.system('echo "Please wait. System installation force3uhd."')
cmd = 'chmod 777 ' + getNeoLocation() + 'ImagesUpload/update/force3uhd/rootfs.tar.bz2; tar -jxf ' + getNeoLocation() + 'ImagesUpload/update/force3uhd/rootfs.tar.bz2 -C ' + getNeoLocation() + 'ImageBoot/' + target + ' > /dev/null 2>&1'
- rc = os.system(cmd)
+ rc = os.system(cmd)
elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/update/galaxy4k'):
os.system('echo "Please wait. System installation Galaxy4k."')
cmd = 'chmod 777 ' + getNeoLocation() + 'ImagesUpload/update/galaxy4k/rootfs.tar.bz2; tar -jxf ' + getNeoLocation() + 'ImagesUpload/update/galaxy4k/rootfs.tar.bz2 -C ' + getNeoLocation() + 'ImageBoot/' + target + ' > /dev/null 2>&1'
@@ -1391,15 +1403,15 @@ def NEOBootExtract(source, target, ZipDelete):
elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/zgemma/h7/rootfs.tar.bz2'):
os.system('echo "Please wait. System installation Zgemma H7."')
cmd = 'chmod 777 ' + getNeoLocation() + 'ImagesUpload/zgemma/h7/rootfs.tar.bz2; tar -jxf ' + getNeoLocation() + 'ImagesUpload/zgemma/h7/rootfs.tar.bz2 -C ' + getNeoLocation() + 'ImageBoot/' + target + ' > /dev/null 2>&1'
- rc = os.system(cmd)
+ rc = os.system(cmd)
elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/zgemma/h9/rootfs.tar.bz2'):
os.system('echo "Please wait. System installation Zgemma H9S ."')
cmd = 'chmod 777 ' + getNeoLocation() + 'ImagesUpload/zgemma/h9/rootfs.tar.bz2; tar -jxf ' + getNeoLocation() + 'ImagesUpload/zgemma/h9/rootfs.tar.bz2 -C ' + getNeoLocation() + 'ImageBoot/' + target + ' > /dev/null 2>&1'
- rc = os.system(cmd)
+ rc = os.system(cmd)
elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/zgemma/h9se/rootfs.tar.bz2'):
os.system('echo "Please wait. System installation Zgemma H9SE ."')
cmd = 'chmod 777 ' + getNeoLocation() + 'ImagesUpload/zgemma/h9se/rootfs.tar.bz2; tar -jxf ' + getNeoLocation() + 'ImagesUpload/zgemma/h9se/rootfs.tar.bz2 -C ' + getNeoLocation() + 'ImageBoot/' + target + ' > /dev/null 2>&1'
- rc = os.system(cmd)
+ rc = os.system(cmd)
elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/zgemma/i55plus/rootfs.tar.bz2'):
os.system('echo "Please wait. System installation Zgemma i55plus ."')
cmd = 'chmod 777 ' + getNeoLocation() + 'ImagesUpload/zgemma/i55plus/rootfs.tar.bz2; tar -jxf ' + getNeoLocation() + 'ImagesUpload/zgemma/i55plus/rootfs.tar.bz2 -C ' + getNeoLocation() + 'ImageBoot/' + target + ' > /dev/null 2>&1'
@@ -1407,7 +1419,7 @@ def NEOBootExtract(source, target, ZipDelete):
elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/h9combo/rootfs.tar.bz2'):
os.system('echo "Please wait. System installation Zgemma h9combo ."')
cmd = 'chmod 777 ' + getNeoLocation() + 'ImagesUpload/h9combo/rootfs.tar.bz2; tar -jxf ' + getNeoLocation() + 'ImagesUpload/h9combo/rootfs.tar.bz2 -C ' + getNeoLocation() + 'ImageBoot/' + target + ' > /dev/null 2>&1'
- rc = os.system(cmd)
+ rc = os.system(cmd)
elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/h9combose/rootfs.tar.bz2'):
os.system('echo "Please wait. System installation Zgemma h9combose ."')
cmd = 'chmod 777 ' + getNeoLocation() + 'ImagesUpload/h9combose/rootfs.tar.bz2; tar -jxf ' + getNeoLocation() + 'ImagesUpload/h9combose/rootfs.tar.bz2 -C ' + getNeoLocation() + 'ImageBoot/' + target + ' > /dev/null 2>&1'
@@ -1415,7 +1427,7 @@ def NEOBootExtract(source, target, ZipDelete):
elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/h10/rootfs.tar.bz2'):
os.system('echo "Please wait. System installation Zgemma h10 ."')
cmd = 'chmod 777 ' + getNeoLocation() + 'ImagesUpload/h10/rootfs.tar.bz2; tar -jxf ' + getNeoLocation() + 'ImagesUpload/h10/rootfs.tar.bz2 -C ' + getNeoLocation() + 'ImageBoot/' + target + ' > /dev/null 2>&1'
- rc = os.system(cmd)
+ rc = os.system(cmd)
elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/miraclebox/mini4k'):
os.system('echo "Please wait. System installation Miraclebox mini4k."')
cmd = 'chmod 777 ' + getNeoLocation() + 'ImagesUpload/miraclebox/mini4k/rootfs.tar.bz2; tar -jxf ' + getNeoLocation() + 'ImagesUpload/miraclebox/mini4k/rootfs.tar.bz2 -C ' + getNeoLocation() + 'ImageBoot/' + target + ' > /dev/null 2>&1'
@@ -1447,27 +1459,27 @@ def NEOBootExtract(source, target, ZipDelete):
elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/beyonwiz/v2'):
os.system('echo "Please wait. System installation beyonwiz v2 4K w toku..."')
cmd = 'chmod 777 ' + getNeoLocation() + 'ImagesUpload/beyonwiz/v2; tar -jxf ' + getNeoLocation() + 'ImagesUpload/beyonwiz/v2/rootfs.tar.bz2 -C ' + getNeoLocation() + 'ImageBoot/' + target + ' > /dev/null 2>&1'
- rc = os.system(cmd)
+ rc = os.system(cmd)
elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/amiko/viper4k'):
os.system('echo "Please wait. System installation Amiko viper4k 4K w toku..."')
cmd = 'chmod 777 ' + getNeoLocation() + 'ImagesUpload/amiko/viper4k; tar -jxf ' + getNeoLocation() + 'ImagesUpload/amiko/viper4k/rootfs.tar.bz2 -C ' + getNeoLocation() + 'ImageBoot/' + target + ' > /dev/null 2>&1'
- rc = os.system(cmd)
+ rc = os.system(cmd)
elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/update/tmtwin4k'):
os.system('echo "Please wait. System installation tmtwin4k."')
cmd = 'chmod 777 ' + getNeoLocation() + 'ImagesUpload/update/tmtwin4k/rootfs.tar.bz2; tar -jxf ' + getNeoLocation() + 'ImagesUpload/update/tmtwin4k/rootfs.tar.bz2 -C ' + getNeoLocation() + 'ImageBoot/' + target + ' > /dev/null 2>&1'
- rc = os.system(cmd)
+ rc = os.system(cmd)
elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/gigablue/trio4k'):
os.system('echo "Please wait. System installation trio4k 4K Combo..."')
cmd = 'chmod 777 ' + getNeoLocation() + 'ImagesUpload/gigablue/trio4k; tar -jxf ' + getNeoLocation() + 'ImagesUpload/gigablue/trio4k/rootfs.tar.bz2 -C ' + getNeoLocation() + 'ImageBoot/' + target + ' > /dev/null 2>&1'
- rc = os.system(cmd)
+ rc = os.system(cmd)
elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/gigablue/ip4k'):
os.system('echo "Please wait. System installation gbip4k 4K..."')
cmd = 'chmod 777 ' + getNeoLocation() + 'ImagesUpload/gigablue/ip4k; tar -jxf ' + getNeoLocation() + 'ImagesUpload/gigablue/ip4k/rootfs.tar.bz2 -C ' + getNeoLocation() + 'ImageBoot/' + target + ' > /dev/null 2>&1'
- rc = os.system(cmd)
+ rc = os.system(cmd)
elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/protek4k'):
os.system('echo "Please wait. System installation protek4k..."')
cmd = 'chmod 777 ' + getNeoLocation() + 'ImagesUpload/protek4k; tar -jxf ' + getNeoLocation() + 'ImagesUpload/protek4k/rootfs.tar.bz2 -C ' + getNeoLocation() + 'ImageBoot/' + target + ' > /dev/null 2>&1'
- rc = os.system(cmd)
+ rc = os.system(cmd)
elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/bre2ze4k'):
os.system('echo "Please wait. System installation WWIO BRE2ZE 4K."')
cmd = 'chmod 777 ' + getNeoLocation() + 'ImagesUpload/bre2ze4k; tar -jxf ' + getNeoLocation() + 'ImagesUpload/bre2ze4k/rootfs.tar.bz2 -C ' + getNeoLocation() + 'ImageBoot/' + target + ' > /dev/null 2>&1'
@@ -1476,36 +1488,36 @@ def NEOBootExtract(source, target, ZipDelete):
os.system('echo "Please wait. System installation spakowanego w plik tar.xz w toku..."')
os.system('cp -af ' + getNeoLocation() + 'ImagesUpload/' + source + '.tar.xz ' + getNeoLocation() + 'ImagesUpload/rootfs.tar.xz')
cmd = 'chmod 777 ' + getNeoLocation() + 'ImagesUpload/rootfs.tar.xz; tar -jjxf ' + getNeoLocation() + 'ImagesUpload/rootfs.tar.xz -C ' + getNeoLocation() + 'ImageBoot/' + target + ' > /dev/null 2>&1'
- rc = os.system(cmd)
+ rc = os.system(cmd)
elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/' + source + '.tar.gz'):
- os.system('echo "Please wait. System installation spakowanego w plik tar.gz w toku..."')
+ os.system('echo "Please wait. System installation spakowanego w plik tar.gz w toku..."')
os.system('cp -af ' + getNeoLocation() + 'ImagesUpload/' + source + '.tar.gz ' + getNeoLocation() + 'ImagesUpload/rootfs.tar.gz')
cmd = 'chmod 777 ' + getNeoLocation() + 'ImagesUpload/rootfs.tar.gz; /bin/tar -xzvf ' + getNeoLocation() + 'ImagesUpload/rootfs.tar.gz -C ' + getNeoLocation() + 'ImageBoot/' + target + ' > /dev/null 2>&1'
rc = os.system(cmd)
elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/' + source + '.tar.bz2'):
- os.system('echo "Please wait. System installation spakowanego w plik tar.bz2 w toku..."')
+ os.system('echo "Please wait. System installation spakowanego w plik tar.bz2 w toku..."')
os.system('cp -af ' + getNeoLocation() + 'ImagesUpload/' + source + '.tar.bz2 ' + getNeoLocation() + 'ImagesUpload/rootfs.tar.bz2')
cmd = 'chmod 777 ' + getNeoLocation() + 'ImagesUpload/rootfs.tar.bz2; tar -jxf ' + getNeoLocation() + 'ImagesUpload/rootfs.tar.bz2 -C ' + getNeoLocation() + 'ImageBoot/' + target + ' > /dev/null 2>&1'
rc = os.system(cmd)
elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/' + source + '.mb'):
- os.system('echo "Please wait. System installation spakowanego w plik .mb w toku..."')
+ os.system('echo "Please wait. System installation spakowanego w plik .mb w toku..."')
os.system('cp -af ' + getNeoLocation() + 'ImagesUpload/' + source + '.mb ' + getNeoLocation() + 'ImagesUpload/rootfs.tar.gz')
cmd = 'chmod 777 ' + getNeoLocation() + 'ImagesUpload/*.tar.gz; tar -xzvf ' + getNeoLocation() + 'ImagesUpload/*.tar.gz -C ' + getNeoLocation() + 'ImageBoot/' + target + ' > /dev/null 2>&1'
rc = os.system(cmd)
- elif '.gz' in sourcefile4 :
+ elif '.gz' in sourcefile4:
os.system('cp -af ' + getNeoLocation() + 'ImagesUpload/*.tar.gz ' + getNeoLocation() + 'ImagesUpload/rootfs.tar.gz')
cmd = '/bin/tar -xzvf ' + getNeoLocation() + 'ImagesUpload/rootfs.tar.gz -C ' + getNeoLocation() + 'ImageBoot/' + target + ' > /dev/null 2>&1'
- rc = os.system(cmd)
- if '.gz' in sourcefile4 :
+ rc = os.system(cmd)
+ if '.gz' in sourcefile4:
cmd = 'rm -rf ' + getNeoLocation() + 'ImagesUpload/*.gz ' ' > /dev/null 2>&1'
- rc = os.system(cmd)
+ rc = os.system(cmd)
cmd = 'rm -f ' + getNeoLocation() + 'ImagesUpload/*.jpg ' ' > /dev/null 2>&1'
- rc = os.system(cmd)
+ rc = os.system(cmd)
elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/rootfs.bin'):
os.chdir('ImagesUpload')
- os.system('mv -f rootfs.bin rootfs.bin')
- os.system('echo "Instalacja - ubi_reader w toku..."')
- print ("[NeoBoot] Extracting UBIFS image and moving extracted image to our target")
+ os.system('mv -f rootfs.bin rootfs.bin')
+ os.system('echo "Instalacja - ubi_reader w toku..."')
+ print("[NeoBoot] Extracting UBIFS image and moving extracted image to our target")
cmd = 'chmod 777 ' + extensions_path + 'NeoBoot/ubi_reader/ubi_extract_files.py'
rc = os.system(cmd)
cmd = 'python ' + extensions_path + 'NeoBoot/ubi_reader/ubi_extract_files.py rootfs.bin -o ' + getNeoLocation() + 'ubi'
@@ -1521,5 +1533,5 @@ def NEOBootExtract(source, target, ZipDelete):
else:
os.system('echo "NeoBoot wykrył dłąd!!! Prawdopodobnie brak pliku instalacyjnego."')
- return
-#END
+ return
+#END
diff --git a/NeoBoot/files/Harddisk.py b/NeoBoot/files/Harddisk.py
index 71bf4c7..57ba9d5 100644
--- a/NeoBoot/files/Harddisk.py
+++ b/NeoBoot/files/Harddisk.py
@@ -1,21 +1,21 @@
# -*- coding: utf-8 -*-
-from Plugins.Extensions.NeoBoot.__init__ import _
+from Plugins.Extensions.NeoBoot.__init__ import _
import os
import time
from Tools.Directories import fileExists, pathExists
from Tools.CList import CList
from Components.SystemInfo import SystemInfo
from Components.Console import Console
-from Plugins.Extensions.NeoBoot.files import Task
+from Plugins.Extensions.NeoBoot.files import Task
if fileExists('/usr/lib/python3.8'):
- from Components import Task
+ from Components import Task
else:
- import Task
+ import Task
try:
from Task import LoggingTask
-except:
- from Components.Task import LoggingTask
+except:
+ from Components.Task import LoggingTask
from Screens.Screen import Screen
from Components.ActionMap import ActionMap
from Components.MenuList import MenuList
@@ -23,20 +23,22 @@ 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')
except IOError as ex:
- print (("[Harddisk] Failed to open /proc/mounts"), ex )
+ print(("[Harddisk] Failed to open /proc/mounts"), ex)
return []
- result = [ line.strip().split(' ') for line in mounts ]
+ result = [line.strip().split(' ') for line in mounts]
for item in result:
item[1] = item[1].replace('\\040', ' ')
@@ -44,7 +46,7 @@ def getProcMounts():
def getNonNetworkMediaMounts():
- return [ x[1] for x in getProcMounts() if x[1].startswith('/media/') and not x[0].startswith('//') ]
+ return [x[1] for x in getProcMounts() if x[1].startswith('/media/') and not x[0].startswith('//')]
def isFileSystemSupported(filesystem):
@@ -55,7 +57,7 @@ def isFileSystemSupported(filesystem):
return False
except Exception as ex:
- print (("[Harddisk] Failed to read /proc/filesystems:'"), ex )
+ print(("[Harddisk] Failed to read /proc/filesystems:'"), ex)
def findMountPoint(path):
@@ -69,16 +71,17 @@ def findMountPoint(path):
DEVTYPE_UDEV = 0
DEVTYPE_DEVFS = 1
+
class Harddisk():
- def __init__(self, device, removable = False):
+ def __init__(self, device, removable=False):
self.device = device
if os.access('/dev/.udev', 0):
self.type = DEVTYPE_UDEV
elif os.access('/dev/.devfsd', 0):
self.type = DEVTYPE_DEVFS
else:
- print ("[Harddisk] Unable to determine structure of /dev")
+ print("[Harddisk] Unable to determine structure of /dev")
self.type = -1
self.card = False
self.max_idle_time = 0
@@ -122,7 +125,7 @@ class Harddisk():
break
self.card = self.device[:2] == 'hd' and 'host0' not in self.dev_path
- print ("[Harddisk] new device"), self.device, '->', self.dev_path, '->', self.disk_path
+ print("[Harddisk] new device"), self.device, '->', self.dev_path, '->', self.disk_path
if not removable and not self.card:
self.startIdle()
return
@@ -200,7 +203,7 @@ class Harddisk():
return readFile(self.sysfsPath('device/name'))
raise (Exception, ("[Harddisk] no hdX or sdX or mmcX"))
except Exception as e:
- print ("[Harddisk] Failed to get model:"), e
+ print("[Harddisk] Failed to get model:"), e
return '-?-'
def free(self):
@@ -266,12 +269,12 @@ class Harddisk():
return 0
else:
cmd = 'umount ' + dev
- print ("[Harddisk]"), cmd
+ print("[Harddisk]"), cmd
res = os.system(cmd)
return res >> 8
def createPartition(self):
- cmd = 'printf "8,\n;0,0\n;0,0\n;0,0\ny\n" | sfdisk -f -uS ' + self.disk_path
+ cmd = 'printf "8,\n;0,0\n;0,0\n;0,0\ny\n" | sfdisk -f -uS ' + self.disk_path
res = os.system(cmd)
return res >> 8
@@ -294,7 +297,7 @@ class Harddisk():
parts = line.strip().split(' ')
fspath = os.path.realpath(parts[0])
if fspath == dev:
- print ("[Harddisk] mounting:"), fspath
+ print("[Harddisk] mounting:"), fspath
cmd = 'mount -t auto ' + fspath
res = os.system(cmd)
return res >> 8
@@ -329,7 +332,7 @@ class Harddisk():
def createInitializeJob(self):
job = Task.Job(_('Initializing storage device...'))
size = self.diskSize()
- print ("[HD] size: %s MB") % size
+ print("[HD] size: %s MB") % size
task = UnmountTask(job, self)
task = Task.PythonTask(job, _('Removing partition table'))
task.work = self.killPartitionTable
@@ -340,7 +343,7 @@ class Harddisk():
task.args.append('-z')
task.args.append(self.disk_path)
task = Task.ConditionTask(job, _('Waiting for partition'), timeoutCount=20)
- task.check = lambda : not os.path.exists(self.partitionPath('1'))
+ task.check = lambda: not os.path.exists(self.partitionPath('1'))
task.weighting = 1
if os.path.exists('/usr/sbin/parted'):
use_parted = True
@@ -377,12 +380,12 @@ class Harddisk():
task.args.append('-uS')
task.args.append(self.disk_path)
if size > 128000:
- print ("[HD] Detected >128GB disk, using 4k alignment")
+ print("[HD] Detected >128GB disk, using 4k alignment")
task.initial_input = '8,,L\n;0,0\n;0,0\n;0,0\ny\n'
else:
task.initial_input = ',,L\n;\n;\n;\ny\n'
task = Task.ConditionTask(job, _('Waiting for partition'))
- task.check = lambda : os.path.exists(self.partitionPath('1'))
+ task.check = lambda: os.path.exists(self.partitionPath('1'))
task.weighting = 1
task = MkfsTask(job, _('Creating filesystem'))
big_o_options = ['dir_index']
@@ -526,7 +529,7 @@ class Harddisk():
class Partition():
- def __init__(self, mountpoint, device = None, description = '', force_mounted = False):
+ def __init__(self, mountpoint, device=None, description='', force_mounted=False):
self.mountpoint = mountpoint
self.description = description
self.force_mounted = mountpoint and force_mounted
@@ -539,7 +542,7 @@ class Partition():
def stat(self):
if self.mountpoint:
return os.statvfs(self.mountpoint)
- raise (OSError, "Device %s is not mounted") % self.device
+ raise (OSError, "Device %s is not mounted") % self.device
def free(self):
try:
@@ -564,7 +567,7 @@ class Partition():
return self.description
return self.description + '\t' + self.mountpoint
- def mounted(self, mounts = None):
+ def mounted(self, mounts=None):
if self.force_mounted:
return True
else:
@@ -577,7 +580,7 @@ class Partition():
return False
- def filesystem(self, mounts = None):
+ def filesystem(self, mounts=None):
if self.mountpoint:
if mounts is None:
mounts = getProcMounts()
@@ -621,9 +624,9 @@ class HarddiskManager():
('/media/ram', _('Ram disk')),
('/media/usb', _('USB stick')),
('/media/usb1', _('USB1 stick')),
- ('/media/usb2', _('USB2 stick')),
+ ('/media/usb2', _('USB2 stick')),
('/', _('Internal flash')))
- known = set([ os.path.normpath(a.mountpoint) for a in self.partitions if a.mountpoint ])
+ known = set([os.path.normpath(a.mountpoint) for a in self.partitions if a.mountpoint])
for m, d in p:
if m not in known and os.path.ismount(m):
self.partitions.append(Partition(mountpoint=m, description=d))
@@ -684,7 +687,7 @@ class HarddiskManager():
medium_found)
def enumerateBlockDevices(self):
- print ("[Harddisk] enumerating block devices...")
+ print("[Harddisk] enumerating block devices...")
for blockdev in os.listdir('/sys/block'):
error, blacklisted, removable, is_cdrom, partitions, medium_found = self.addHotplugPartition(blockdev)
if not error and not blacklisted and medium_found:
@@ -711,14 +714,14 @@ class HarddiskManager():
return None
- def addHotplugPartition(self, device, physdev = None):
+ def addHotplugPartition(self, device, physdev=None):
if not physdev:
dev, part = self.splitDeviceName(device)
try:
physdev = os.path.realpath('/sys/block/' + dev + '/device')[4:]
except OSError:
physdev = dev
- print (("couldn't determine blockdev physdev for device"), device)
+ print(("couldn't determine blockdev physdev for device"), device)
error, blacklisted, removable, is_cdrom, partitions, medium_found = self.getBlockDevInfo(device)
if not blacklisted and medium_found:
@@ -739,14 +742,14 @@ class HarddiskManager():
partitions,
medium_found)
- def addHotplugAudiocd(self, device, physdev = None):
+ def addHotplugAudiocd(self, device, physdev=None):
if not physdev:
dev, part = self.splitDeviceName(device)
try:
physdev = os.path.realpath('/sys/block/' + dev + '/device')[4:]
except OSError:
physdev = dev
- print (("couldn't determine blockdev physdev for device"), device )
+ print(("couldn't determine blockdev physdev for device"), device)
error, blacklisted, removable, is_cdrom, partitions, medium_found = self.getBlockDevInfo(device)
if not blacklisted and medium_found:
@@ -796,11 +799,11 @@ class HarddiskManager():
def getCD(self):
return self.cd
- def getMountedPartitions(self, onlyhotplug = False, mounts = None):
+ def getMountedPartitions(self, onlyhotplug=False, mounts=None):
if mounts is None:
mounts = getProcMounts()
- parts = [ x for x in self.partitions if (x.is_hotplug or not onlyhotplug) and x.mounted(mounts) ]
- devs = set([ x.device for x in parts ])
+ parts = [x for x in self.partitions if (x.is_hotplug or not onlyhotplug) and x.mounted(mounts)]
+ devs = set([x.device for x in parts])
for devname in devs.copy():
if not devname:
continue
@@ -808,7 +811,7 @@ class HarddiskManager():
if part and dev in devs:
devs.remove(dev)
- return [ x for x in parts if not x.device or x.device in devs ]
+ return [x for x in parts if not x.device or x.device in devs]
def splitDeviceName(self, devname):
dev = devname[:3]
@@ -825,7 +828,7 @@ class HarddiskManager():
try:
description = readFile('/sys' + phys + '/model')
except IOError as s:
- print (("couldn't read model: "), s)
+ print(("couldn't read model: "), s)
if part and part != 1:
description += _(' (Partition %d)') % part
@@ -844,7 +847,7 @@ class HarddiskManager():
self.partitions.remove(x)
self.on_partition_list_change('remove', x)
- def setDVDSpeed(self, device, speed = 0):
+ def setDVDSpeed(self, device, speed=0):
ioctl_flag = int(21282)
if not device.startswith('/'):
device = '/dev/' + device
@@ -854,7 +857,7 @@ class HarddiskManager():
ioctl(cd.fileno(), ioctl_flag, speed)
cd.close()
except Exception as ex:
- print ("[Harddisk] Failed to set %s speed to %s") % (device, speed), ex
+ print("[Harddisk] Failed to set %s speed to %s") % (device, speed), ex
class UnmountTask(Task.LoggingTask):
@@ -869,7 +872,7 @@ class UnmountTask(Task.LoggingTask):
dev = self.hdd.disk_path.split('/')[-1]
open('/dev/nomount.%s' % dev, 'wb').close()
except Exception as e:
- print ("ERROR: Failed to create /dev/nomount file:"), e
+ print("ERROR: Failed to create /dev/nomount file:"), e
self.setTool('umount')
self.args.append('-f')
@@ -879,7 +882,7 @@ class UnmountTask(Task.LoggingTask):
self.mountpoints.append(dev)
if not self.mountpoints:
- print ("UnmountTask: No mountpoints found?")
+ print("UnmountTask: No mountpoints found?")
self.cmd = 'true'
self.args = [self.cmd]
@@ -888,7 +891,7 @@ class UnmountTask(Task.LoggingTask):
try:
os.rmdir(path)
except Exception as ex:
- print ("Failed to remove path '%s':") % path, ex
+ print("Failed to remove path '%s':") % path, ex
class MountTask(Task.LoggingTask):
@@ -902,7 +905,7 @@ class MountTask(Task.LoggingTask):
dev = self.hdd.disk_path.split('/')[-1]
os.unlink('/dev/nomount.%s' % dev)
except Exception as e:
- print ("ERROR: Failed to remove /dev/nomount file:"), e
+ print("ERROR: Failed to remove /dev/nomount file:"), e
if self.hdd.mount_device is None:
dev = self.hdd.partitionPath('1')
@@ -932,7 +935,7 @@ class MkfsTask(Task.LoggingTask):
return
def processOutput(self, data):
- print ("[Mkfs]"), data
+ print("[Mkfs]"), data
if 'Writing inode tables:' in data:
self.fsck_state = 'inode'
elif 'Creating journal' in data:
@@ -948,7 +951,7 @@ class MkfsTask(Task.LoggingTask):
d[1] = d[1].split('\x08', 1)[0]
self.setProgress(80 * int(d[0]) / int(d[1]))
except Exception as e:
- print ("[Mkfs] E:"), e
+ print("[Mkfs] E:"), e
return
self.log.append(data)
@@ -981,7 +984,7 @@ class HarddiskSetup(Screen):
return
try:
from Task import job_manager
- except:
+ except:
from Components.Task import job_manager
try:
job = self.action()
@@ -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:
@@ -1042,7 +1046,7 @@ def isSleepStateDevice(device):
return None
-def internalHDDNotSleeping(external = False):
+def internalHDDNotSleeping(external=False):
state = False
if harddiskmanager.HDDCount():
for hdd in harddiskmanager.HDDList():
diff --git a/NeoBoot/files/Task.py b/NeoBoot/files/Task.py
index 4396306..8bc5642 100644
--- a/NeoBoot/files/Task.py
+++ b/NeoBoot/files/Task.py
@@ -2,6 +2,7 @@
from Tools.CList import CList
+
class Job(object):
NOT_STARTED, IN_PROGRESS, FINISHED, FAILED = range(4)
@@ -32,7 +33,7 @@ class Job(object):
if self.current_task == len(self.tasks):
return self.end
t = self.tasks[self.current_task]
- jobprogress = t.weighting * t.progress / float(t.end) + sum([ task.weighting for task in self.tasks[:self.current_task] ])
+ jobprogress = t.weighting * t.progress / float(t.end) + sum([task.weighting for task in self.tasks[:self.current_task]])
return int(jobprogress * self.weightScale)
progress = property(getProgress)
@@ -59,7 +60,7 @@ class Job(object):
self.status = self.IN_PROGRESS
self.state_changed()
self.runNext()
- sumTaskWeightings = sum([ t.weighting for t in self.tasks ]) or 1
+ sumTaskWeightings = sum([t.weighting for t in self.tasks]) or 1
self.weightScale = self.end / float(sumTaskWeightings)
def runNext(self):
@@ -70,29 +71,29 @@ class Job(object):
self.callback(self, None, [])
self.callback = None
else:
- print ("still waiting for %d resident task(s) %s to finish") % (len(self.resident_tasks), str(self.resident_tasks))
+ print("still waiting for %d resident task(s) %s to finish") % (len(self.resident_tasks), str(self.resident_tasks))
else:
self.tasks[self.current_task].run(self.taskCallback)
self.state_changed()
return
- def taskCallback(self, task, res, stay_resident = False):
+ def taskCallback(self, task, res, stay_resident=False):
cb_idx = self.tasks.index(task)
if stay_resident:
if cb_idx not in self.resident_tasks:
self.resident_tasks.append(self.current_task)
- print ("task going resident:"), task
+ print("task going resident:"), task
else:
- print ("task keeps staying resident:"), task
+ print("task keeps staying resident:"), task
return
if len(res):
- print (">>> Error:"), res
+ print(">>> Error:"), res
self.status = self.FAILED
self.state_changed()
self.callback(self, task, res)
if cb_idx != self.current_task:
if cb_idx in self.resident_tasks:
- print ("resident task finished:"), task
+ print("resident task finished:"), task
self.resident_tasks.remove(cb_idx)
if res == []:
self.state_changed()
@@ -151,7 +152,7 @@ class Task(object):
def setCmdline(self, cmdline):
self.cmdline = cmdline
- def checkPreconditions(self, immediate = False):
+ def checkPreconditions(self, immediate=False):
not_met = []
if immediate:
preconditions = self.immediate_preconditions
@@ -176,9 +177,9 @@ class Task(object):
if self.cwd is not None:
self.container.setCWD(self.cwd)
if not self.cmd and self.cmdline:
- print ("execute:"), self.container.execute(self.cmdline), self.cmdline
+ print("execute:"), self.container.execute(self.cmdline), self.cmdline
else:
- print ("execute:"), self.container.execute(self.cmd, *self.args), ' '.join(self.args)
+ print("execute:"), self.container.execute(self.cmd, *self.args), ' '.join(self.args)
if self.initial_input:
self.writeInput(self.initial_input)
return
@@ -187,7 +188,7 @@ class Task(object):
def run(self, callback):
failed_preconditions = self.checkPreconditions(True) + self.checkPreconditions(False)
if failed_preconditions:
- print ("[Task] preconditions failed")
+ print("[Task] preconditions failed")
callback(self, failed_preconditions)
return
self.callback = callback
@@ -195,7 +196,7 @@ class Task(object):
self.prepare()
self._run()
except Exception as ex:
- print ("[Task] exception:"), ex
+ print("[Task] exception:"), ex
self.postconditions = [FailedPostcondition(ex)]
self.finish()
@@ -221,7 +222,7 @@ class Task(object):
self.output_line = self.output_line[i + 1:]
def processOutputLine(self, line):
- print ("[Task %s]") % self.name, line[:-1]
+ print("[Task %s]") % self.name, line[:-1]
def processFinished(self, returncode):
self.returncode = returncode
@@ -232,7 +233,7 @@ class Task(object):
self.container.kill()
self.finish(aborted=True)
- def finish(self, aborted = False):
+ def finish(self, aborted=False):
self.afterRun()
not_met = []
if aborted:
@@ -276,7 +277,7 @@ class LoggingTask(Task):
self.log = []
def processOutput(self, data):
- print ("[%s]") % self.name, data,
+ print("[%s]") % self.name, data,
self.log.append(data)
@@ -313,7 +314,7 @@ class PythonTask(Task):
class ConditionTask(Task):
- def __init__(self, job, name, timeoutCount = None):
+ def __init__(self, job, name, timeoutCount=None):
Task.__init__(self, job, name)
self.timeoutCount = timeoutCount
@@ -360,7 +361,7 @@ class JobManager:
self.active_job = None
return
- def AddJob(self, job, onSuccess = None, onFail = None):
+ def AddJob(self, job, onSuccess=None, onFail=None):
job.onSuccess = onSuccess
if onFail is None:
job.onFail = self.notifyFailed
@@ -388,7 +389,7 @@ class JobManager:
return False
def jobDone(self, job, task, problems):
- print ("job"), job, ("completed with"), problems, ("in"), task
+ print("job"), job, ("completed with"), problems, ("in"), task
if problems:
if not job.onFail(job, task, problems):
self.errorCB(False)
@@ -408,10 +409,10 @@ class JobManager:
def errorCB(self, answer):
if answer:
- print ("retrying job")
+ print("retrying job")
self.active_job.retry()
else:
- print ("not retrying job.")
+ print("not retrying job.")
self.failed_jobs.append(self.active_job)
self.active_job = None
self.kick()
@@ -463,12 +464,12 @@ class ToolExistsPrecondition(Condition):
import os
if task.cmd[0] == '/':
self.realpath = task.cmd
- print ("[Task.py][ToolExistsPrecondition] WARNING: usage of absolute paths for tasks should be avoided!")
+ print("[Task.py][ToolExistsPrecondition] WARNING: usage of absolute paths for tasks should be avoided!")
return os.access(self.realpath, os.X_OK)
self.realpath = task.cmd
path = os.environ.get('PATH', '').split(os.pathsep)
path.append(task.cwd + '/')
- absolutes = filter(lambda file: os.access(file, os.X_OK), map(lambda directory, file = task.cmd: os.path.join(directory, file), path))
+ absolutes = filter(lambda file: os.access(file, os.X_OK), map(lambda directory, file=task.cmd: os.path.join(directory, file), path))
if absolutes:
self.realpath = absolutes[0]
return True
@@ -519,4 +520,4 @@ class FailedPostcondition(Condition):
return self.exception is None or self.exception == 0
-job_manager = JobManager()
\ No newline at end of file
+job_manager = JobManager()
diff --git a/NeoBoot/files/__init__.py b/NeoBoot/files/__init__.py
index 4c06ca1..9f8891e 100644
--- a/NeoBoot/files/__init__.py
+++ b/NeoBoot/files/__init__.py
@@ -3,21 +3,23 @@
from __future__ import print_function
from Components.Language import language
from Tools.Directories import resolveFilename, SCOPE_PLUGINS, SCOPE_LANGUAGE
-import os, gettext
+import os
+import gettext
PluginLanguageDomain = 'NeoBoot'
PluginLanguagePath = 'Extensions/NeoBoot/locale'
+
def localeInit():
lang = language.getLanguage()[:2]
os.environ['LANGUAGE'] = lang
- print ("[NeoBoot] set language to "), lang
+ print("[NeoBoot] set language to "), lang
gettext.bindtextdomain(PluginLanguageDomain, resolveFilename(SCOPE_PLUGINS, PluginLanguagePath))
def _(txt):
t = gettext.dgettext(PluginLanguageDomain, txt)
if t == txt:
- print ("[NeoBoot] fallback to default translation for"), txt
+ print("[NeoBoot] fallback to default translation for"), txt
t = gettext.dgettext('enigma2', txt)
return t
diff --git a/NeoBoot/files/devices.py b/NeoBoot/files/devices.py
index bfeccb6..9d3206b 100644
--- a/NeoBoot/files/devices.py
+++ b/NeoBoot/files/devices.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
-
-from Plugins.Extensions.NeoBoot.__init__ import _
+
+from Plugins.Extensions.NeoBoot.__init__ import _
from enigma import getDesktop
from Plugins.Plugin import PluginDescriptor
from Screens.ChoiceBox import ChoiceBox
@@ -29,11 +29,12 @@ import fileinput
import re
import os
from Screens.VirtualKeyBoard import VirtualKeyBoard
-import gettext, os
-from Plugins.Extensions.NeoBoot.files.stbbranding import getTunerModel
+import gettext
+import os
+from Plugins.Extensions.NeoBoot.files.stbbranding import getTunerModel
LinkNeoBoot = '/usr/lib/enigma2/python/Plugins/Extensions/NeoBoot'
-
+
class ManagerDevice(Screen):
screenwidth = getDesktop(0).size().width()
if screenwidth and screenwidth == 1920:
@@ -42,7 +43,7 @@ class ManagerDevice(Screen):
-
+
@@ -53,10 +54,10 @@ class ManagerDevice(Screen):
"""
else:
skin = """
-
+
-
+
\n\t\t\t\t{"template": [\n\t\t\t\t MultiContentEntryText(pos = (90, 0), size = (600, 30), font=0, text = 0),\n\t\t\t\t MultiContentEntryText(pos = (110, 30), size = (600, 50), font=1, flags = RT_VALIGN_TOP, text = 1),\n\t\t\t\t MultiContentEntryPixmapAlphaBlend(pos = (0, 0), size = (80, 80)),\n\t\t\t\t],\n\t\t\t\t"fonts": [gFont("Regular", 24),gFont("Regular", 20)],\n\t\t\t\t"itemHeight": 85\n\t\t\t\t}\n\t\t\t
@@ -64,7 +65,6 @@ class ManagerDevice(Screen):
"""
-
def __init__(self, session):
Screen.__init__(self, session)
Screen.setTitle(self, _('Mount Manager'))
@@ -90,7 +90,7 @@ class ManagerDevice(Screen):
def Format_ext3(self):
try:
- if fileExists('/etc/vtiversion.info') or fileExists('/etc/bhversion'):
+ if fileExists('/etc/vtiversion.info') or fileExists('/etc/bhversion'):
self.session.open(MessageBox, _("This option is available only from openpli or derivatives."), MessageBox.TYPE_INFO, timeout=10)
else:
from Harddisk import HarddiskSelection
@@ -103,7 +103,7 @@ class ManagerDevice(Screen):
self.session.openWithCallback(self.updateList, HarddiskSelection)
def ExitBack(self):
- self.close()
+ self.close()
def setWindowTitle(self):
self.setTitle(_('Mount Manager'))
@@ -129,7 +129,7 @@ class ManagerDevice(Screen):
for cb in self.onChangedEntry:
cb(name, desc)
- def updateList(self, result = None, retval = None, extra_args = None):
+ def updateList(self, result=None, retval=None, extra_args=None):
scanning = _('Wait please while scanning for devices...')
self['lab1'].setText(scanning)
self.activityTimer.start(10)
@@ -160,7 +160,7 @@ class ManagerDevice(Screen):
device2 = re.sub('[0-9]', '', device)
devicetype = path.realpath('/sys/block/' + device2 + '/device')
d2 = device
- name = _('HARD DISK: ')
+ name = _('HARD DISK: ')
mypixmap = '' + LinkNeoBoot + '/images/dev_hdd.png'
model = file('/sys/block/' + device2 + '/device/model').read()
model = str(model).replace('\n', '')
@@ -170,13 +170,13 @@ class ManagerDevice(Screen):
mypixmap = '' + LinkNeoBoot + '/images/dev_usb.png'
if devicetype.find('usb1') != -1:
name = _('USB1: ')
- mypixmap = '' + LinkNeoBoot + '/images/dev_usb.png'
+ mypixmap = '' + LinkNeoBoot + '/images/dev_usb.png'
if devicetype.find('usb2') != -1:
name = _('USB2: ')
- mypixmap = '' + LinkNeoBoot + '/images/dev_usb.png'
+ mypixmap = '' + LinkNeoBoot + '/images/dev_usb.png'
if devicetype.find('card') != -1:
name = _('CARD: ')
- mypixmap = '' + LinkNeoBoot + '/images/dev_sd.png'
+ mypixmap = '' + LinkNeoBoot + '/images/dev_sd.png'
name = name + model
self.Console = Console()
@@ -275,17 +275,17 @@ class ManagerDevice(Screen):
else:
self.session.open(MessageBox, _('This Device is already mounted as HDD.'), MessageBox.TYPE_INFO, timeout=10, close_on_any_key=True)
- def add_fstab(self, result = None, retval = None, extra_args = None):
+ def add_fstab(self, result=None, retval=None, extra_args=None):
self.device = extra_args[0]
self.mountp = extra_args[1]
self.device_uuid = 'UUID=' + result.split('UUID=')[1].split(' ')[0].replace('"', '')
if not path.exists(self.mountp):
mkdir(self.mountp, 493)
- file('/etc/fstab.tmp', 'w').writelines([ l for l in file('/etc/fstab').readlines() if '/media/hdd' not in l ])
+ file('/etc/fstab.tmp', 'w').writelines([l for l in file('/etc/fstab').readlines() if '/media/hdd' not in l])
rename('/etc/fstab.tmp', '/etc/fstab')
- file('/etc/fstab.tmp', 'w').writelines([ l for l in file('/etc/fstab').readlines() if self.device not in l ])
+ file('/etc/fstab.tmp', 'w').writelines([l for l in file('/etc/fstab').readlines() if self.device not in l])
rename('/etc/fstab.tmp', '/etc/fstab')
- file('/etc/fstab.tmp', 'w').writelines([ l for l in file('/etc/fstab').readlines() if self.device_uuid not in l ])
+ file('/etc/fstab.tmp', 'w').writelines([l for l in file('/etc/fstab').readlines() if self.device_uuid not in l])
rename('/etc/fstab.tmp', '/etc/fstab')
out = open('/etc/fstab', 'a')
line = self.device_uuid + '\t/media/hdd\tauto\tdefaults\t0 0\n'
@@ -304,8 +304,8 @@ class ManagerDevice(Screen):
class DevicesConf(Screen, ConfigListScreen):
screenwidth = getDesktop(0).size().width()
if screenwidth and screenwidth == 1920:
- skin = """
-
+ skin = """
+
@@ -330,7 +330,7 @@ class DevicesConf(Screen, ConfigListScreen):
'red': self.close,
'back': self.close})
self.updateList()
-
+
def updateList(self):
self.list = []
list2 = []
@@ -382,11 +382,11 @@ class DevicesConf(Screen, ConfigListScreen):
mypixmap = '' + LinkNeoBoot + '/images/dev_usb.png'
if devicetype.find('usb2') != -1:
name = _('USB2: ')
- mypixmap = '' + LinkNeoBoot + '/images/dev_usb.png'
+ mypixmap = '' + LinkNeoBoot + '/images/dev_usb.png'
if devicetype.find('card') != -1:
name = _('CARD: ')
mypixmap = '' + LinkNeoBoot + '/images/dev_sd.png'
-
+
name = name + model
f = open('/proc/mounts', 'r')
for line in f.readlines():
@@ -423,7 +423,7 @@ class DevicesConf(Screen, ConfigListScreen):
('/media/cf', '/media/cf'),
('/media/card', '/media/card')]))
if dtype == 'Linux':
- dtype = 'ext2', 'ext3', 'ext4'
+ dtype = 'ext2', 'ext3', 'ext4'
else:
dtype = 'auto'
item.value = d1.strip()
@@ -432,7 +432,7 @@ class DevicesConf(Screen, ConfigListScreen):
if des != '' and self.list.append(res):
pass
- def saveMypoints(self):
+ def saveMypoints(self):
self.Console = Console()
mycheck = False
for x in self['config'].list:
@@ -461,8 +461,8 @@ class DevicesConf(Screen, ConfigListScreen):
self.messagebox = self.session.open(MessageBox, _('Return to installation...'), MessageBox.TYPE_INFO)
self.close()
- def add_fstab(self, result = None, retval = None, extra_args = None):
- print ("[MountManager] RESULT:"), result
+ def add_fstab(self, result=None, retval=None, extra_args=None):
+ print("[MountManager] RESULT:"), result
if result:
self.device = extra_args[0]
self.mountp = extra_args[1]
@@ -476,9 +476,9 @@ class DevicesConf(Screen, ConfigListScreen):
self.device_type = 'ntfs'
if not path.exists(self.mountp):
mkdir(self.mountp, 493)
- file('/etc/fstab.tmp', 'w').writelines([ l for l in file('/etc/fstab').readlines() if self.device not in l ])
+ file('/etc/fstab.tmp', 'w').writelines([l for l in file('/etc/fstab').readlines() if self.device not in l])
rename('/etc/fstab.tmp', '/etc/fstab')
- file('/etc/fstab.tmp', 'w').writelines([ l for l in file('/etc/fstab').readlines() if self.device_uuid not in l ])
+ file('/etc/fstab.tmp', 'w').writelines([l for l in file('/etc/fstab').readlines() if self.device_uuid not in l])
rename('/etc/fstab.tmp', '/etc/fstab')
out = open('/etc/fstab', 'a')
line = self.device_uuid + '\t' + self.mountp + '\t' + self.device_type + '\tdefaults\t0 0\n'
@@ -496,20 +496,17 @@ class DevicesConf(Screen, ConfigListScreen):
# line2 = '"' + self.device_uuid2 + '"' + ':' + self.mountp + '\n'
# out2.write(line2)
# out2.close()
-
-
-
#SetDiskLabel - dziekuje autorowi
class SetDiskLabel(Screen):
screenwidth = getDesktop(0).size().width()
- if screenwidth and screenwidth == 1920:
- skin ="""
+ if screenwidth and screenwidth == 1920:
+ skin = """
-
+
@@ -524,7 +521,7 @@ class SetDiskLabel(Screen):
-
+
@@ -556,7 +553,7 @@ class SetDiskLabel(Screen):
def __init__(self, session):
global liczymy
Screen.__init__(self, session)
- self.labList = ['hdd', 'usb','card', 'cf']
+ self.labList = ['hdd', 'usb', 'card', 'cf']
self.list = []
self.sprDev()
self.devlist = []
diff --git a/NeoBoot/files/neoconsole.py b/NeoBoot/files/neoconsole.py
index 30b239d..7c201dc 100644
--- a/NeoBoot/files/neoconsole.py
+++ b/NeoBoot/files/neoconsole.py
@@ -1,6 +1,6 @@
-# -*- coding: utf-8 -*-
-
-from Plugins.Extensions.NeoBoot.__init__ import _
+# -*- coding: utf-8 -*-
+
+from Plugins.Extensions.NeoBoot.__init__ import _
#from __future__ import print_function
from enigma import eConsoleAppContainer
from Screens.Screen import Screen
@@ -19,19 +19,19 @@ class Console(Screen):
# def __init__(self, session, title = 'Console', cmdlist = None, finishedCallback = None, closeOnSuccess = False):
# Screen.__init__(self, session)
- def __init__(self, session, title = _('Console'), cmdlist = None, finishedCallback = None, closeOnSuccess = False):
+ def __init__(self, session, title=_('Console'), cmdlist=None, finishedCallback=None, closeOnSuccess=False):
Screen.__init__(self, session)
self.finishedCallback = finishedCallback
self.closeOnSuccess = closeOnSuccess
self.errorOcurred = False
self['key_red'] = Label(_('Stop action'))
- self['key_green'] = Label(_('Hide Console'))
+ self['key_green'] = Label(_('Hide Console'))
self['text'] = ScrollLabel('')
self['summary_description'] = StaticText('')
self['actions'] = ActionMap(['WizardActions', 'DirectionActions', 'ColorActions'], {'ok': self.cancel,
'back': self.cancel,
'up': self.key_up,
- 'down': self.key_down,
+ 'down': self.key_down,
'green': self.key_green,
'red': self.key_red}, -1)
self.cmdlist = cmdlist
@@ -59,7 +59,7 @@ class Console(Screen):
def startRun(self):
self['text'].setText(_('Execution progress:') + '\n\n')
self['summary_description'].setText(_('Execution progress:'))
- print ("[Console] executing in run"), self.run, (" the command:"), self.cmdlist[self.run]
+ print("[Console] executing in run"), self.run, (" the command:"), self.cmdlist[self.run]
if self.doExec(self.cmdlist[self.run]):
self.runFinished(-1)
@@ -77,7 +77,7 @@ class Console(Screen):
self.toggleScreenHide(True)
if self.cancel_msg:
self.cancel_msg.close()
- from Tools.Directories import fileExists
+ from Tools.Directories import fileExists
if not fileExists('/etc/vtiversion.info'):
lastpage = self['text'].isAtLastPage()
self['text'].appendText('\n' + _('Execution finished!!'))
@@ -126,7 +126,7 @@ class Console(Screen):
else:
self.cancel_msg = self.session.openWithCallback(self.cancelCB, MessageBox, _('Cancel execution?'), type=MessageBox.TYPE_YESNO, default=False)
- def cancelCB(self, ret = None):
+ def cancelCB(self, ret=None):
self.cancel_msg = None
if ret:
self.cancel(True)
@@ -147,7 +147,7 @@ class Console(Screen):
else:
yield source
- def saveOutputTextCB(self, ret = None):
+ def saveOutputTextCB(self, ret=None):
if ret:
from os import path
failtext = _("Path to save not exist: '/tmp/'")
@@ -186,7 +186,7 @@ class Console(Screen):
else:
self.output_file = ''
- def toggleScreenHide(self, setshow = False):
+ def toggleScreenHide(self, setshow=False):
if self.screen_hide or setshow:
self.show()
else:
@@ -206,7 +206,7 @@ class Console(Screen):
return rd
- def cancel(self, force = False):
+ def cancel(self, force=False):
if self.screen_hide:
self.toggleScreenHide()
return
@@ -218,4 +218,4 @@ class Console(Screen):
self.container.kill()
def dataAvail(self, str):
- self['text'].appendText(str)
\ No newline at end of file
+ self['text'].appendText(str)
diff --git a/NeoBoot/files/stbbranding.py b/NeoBoot/files/stbbranding.py
index 2a6d15e..141e221 100644
--- a/NeoBoot/files/stbbranding.py
+++ b/NeoBoot/files/stbbranding.py
@@ -1,24 +1,25 @@
# -*- coding: utf-8 -*-
-#from Plugins.Extensions.NeoBoot.__init__ import _
+#from Plugins.Extensions.NeoBoot.__init__ import _
import sys
import os
-import time
+import time
from Tools.Directories import fileExists, SCOPE_PLUGINS
LinkNeoBoot = '/usr/lib/enigma2/python/Plugins/Extensions/NeoBoot'
LogFileObj = None
-def Log(param = ''):
+
+def Log(param=''):
global LogFileObj
#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:
LogFileObj.close()
if LogFileObj.closed:
LogFileObj = None
try:
- with open('/tmp/NeoBoot.log','a') as f:
+ with open('/tmp/NeoBoot.log', 'a') as f:
f.write('LogFile closed properly\n')
f.close()
except Exception:
@@ -27,7 +28,7 @@ def Log(param = ''):
print("ERROR closing LogFile!!!")
#second create object if does not exist
if LogFileObj is None:
- if param.lower() in ['open','write']:
+ if param.lower() in ['open', 'write']:
LogFileObj = open(LogFile, "w")
elif param.lower() in ['append']:
LogFileObj = open(LogFile, "a")
@@ -36,30 +37,36 @@ def Log(param = ''):
elif param.lower() in ['flush']:
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 = open('%sImageBoot/neoboot.log' % getNeoLocation(), 'a')
log_file.write(line)
log_file.close()
-
-def fileCheck(f, mode = 'r'):
- return fileExists(f, mode) and f
+
+
+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"):
if "BlackHole" in line or "vuplus" in line:
return True
- return False
-
+ return False
+
+
def mountp():
pathmp = []
if os.path.isfile('/proc/mounts'):
@@ -71,365 +78,398 @@ def mountp():
pathmp.append('/tmp/')
return pathmp
+
def getSupportedTuners():
- supportedT=''
+ supportedT = ''
if os.path.exists('/usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/stbinfo.cfg'):
with open('/usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/stbinfo.cfg', 'r') as f:
lines = f.read()
f.close()
- if lines.find("%s" % getBoxHostName()) != -1:
- supportedT='%s' % getBoxHostName()
+ if lines.find("%s" % getBoxHostName()) != -1:
+ supportedT = '%s' % getBoxHostName()
return supportedT
-
+
+
def getFreespace(dev):
statdev = os.statvfs(dev)
space = statdev.f_bavail * statdev.f_frsize / 1024
- print ("[NeoBoot] Free space on %s = %i kilobytes") % (dev, space)
- return space
+ print("[NeoBoot] Free space on %s = %i kilobytes") % (dev, space)
+ return space
#check install
+
+
def getCheckInstal1():
- neocheckinstal='UNKNOWN'
+ neocheckinstal = 'UNKNOWN'
if os.path.exists('/usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/bin/install'):
with open('/usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/bin/install', 'r') as f:
lines1 = f.read()
f.close()
if not lines1.find('/dev/') != -1:
- neocheckinstal='1'
+ neocheckinstal = '1'
return neocheckinstal
-
+
+
def getCheckInstal2():
- neocheckinstal='UNKNOWN'
+ neocheckinstal = 'UNKNOWN'
if os.path.exists('/usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/.location'):
with open('/usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/.location', 'r') as f:
lines2 = f.read()
f.close()
if not lines2.find('/media/') != -1:
- neocheckinstal='2'
+ neocheckinstal = '2'
return neocheckinstal
-
+
+
def getCheckInstal3():
- neocheckinstal='UNKNOWN'
+ neocheckinstal = 'UNKNOWN'
if os.path.exists('/usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/files/neo.sh'):
with open('/usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/files/neo.sh', 'r') as f:
lines3 = f.read()
f.close()
if not lines3.find('/bin/mount') != -1:
- neocheckinstal='3'
+ neocheckinstal = '3'
return neocheckinstal
#check imageATV
+
+
def getImageATv():
- atvimage='UNKNOWN'
+ atvimage = 'UNKNOWN'
if os.path.exists('/etc/issue.net'):
with open('/etc/issue.net', 'r') as f:
lines = f.read()
f.close()
if lines.find('openatv') != -1:
- atvimage='okfeedCAMatv'
+ atvimage = 'okfeedCAMatv'
return atvimage
#check install
+
+
def getNeoLocation():
- locatino='UNKNOWN'
+ locatino = 'UNKNOWN'
if os.path.exists('/usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/.location'):
with open('/usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/.location', 'r') as f:
locatino = f.readline().strip()
- f.close()
+ f.close()
return locatino
#check ext
def getFormat():
- neoformat='UNKNOWN'
+ neoformat = 'UNKNOWN'
if os.path.exists('/proc/mounts'):
with open('/proc/mounts', 'r') as f:
lines = f.read()
f.close()
if lines.find('ext2') != -1:
- neoformat='ext2'
+ neoformat = 'ext2'
elif lines.find('ext3') != -1:
- neoformat='ext3'
+ neoformat = 'ext3'
elif lines.find('ext4') != -1:
- neoformat='ext4'
+ neoformat = 'ext4'
elif lines.find('nfs') != -1:
- neoformat='nfs'
+ neoformat = 'nfs'
- return neoformat
+ return neoformat
def getNEO_filesystems():
- neo_filesystems='UNKNOWN'
+ neo_filesystems = 'UNKNOWN'
if os.path.exists('/tmp/.neo_format'):
with open('/tmp/.neo_format', 'r') as f:
lines = f.read()
f.close()
if lines.find('ext2') != -1:
- neo_filesystems='1'
+ neo_filesystems = '1'
elif lines.find('ext3') != -1:
- neo_filesystems='1'
+ neo_filesystems = '1'
elif lines.find('ext4') != -1:
- neo_filesystems='1'
+ neo_filesystems = '1'
elif lines.find('nfs') != -1:
- neo_filesystems='1'
+ neo_filesystems = '1'
return neo_filesystems
#typ procesora arm lub mips
+
+
def getCPUtype():
- cpu='UNKNOWN'
+ cpu = 'UNKNOWN'
if os.path.exists('/proc/cpuinfo'):
with open('/proc/cpuinfo', 'r') as f:
lines = f.read()
f.close()
if lines.find('ARMv7') != -1:
- cpu='ARMv7'
+ cpu = 'ARMv7'
elif lines.find('mips') != -1:
- cpu='MIPS'
- return cpu
+ cpu = 'MIPS'
+ return cpu
#check install
+
+
def getFSTAB():
- install='UNKNOWN'
+ install = 'UNKNOWN'
if os.path.exists('/usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/bin/reading_blkid'):
with open('/usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/bin/reading_blkid', 'r') as f:
lines = f.read()
f.close()
if lines.find('UUID') != -1:
- install='UUID'
+ install = 'UUID'
elif not lines.find('UUID') != -1:
- install='NOUUID'
- return install
-
+ install = 'NOUUID'
+ return install
+
+
def getFSTAB2():
- install='UNKNOWN'
+ install = 'UNKNOWN'
if os.path.exists('/etc/fstab'):
with open('/etc/fstab', 'r') as f:
lines = f.read()
f.close()
if lines.find('UUID') != -1:
- install='OKinstall'
+ install = 'OKinstall'
elif not lines.find('UUID') != -1:
- install='NOUUID'
- return install
+ install = 'NOUUID'
+ return install
+
def getINSTALLNeo():
- neoinstall='UNKNOWN'
+ neoinstall = 'UNKNOWN'
if os.path.exists('/usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/bin/installNeo'):
with open('/usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/bin/installNeo', 'r') as f:
lines = f.read()
f.close()
if lines.find('/dev/sda1') != -1:
- neoinstall='/dev/sda1'
+ neoinstall = '/dev/sda1'
elif lines.find('/dev/sda2') != -1:
- neoinstall='/dev/sda2'
+ neoinstall = '/dev/sda2'
elif lines.find('/dev/sdb1') != -1:
- neoinstall='/dev/sdb1'
+ neoinstall = '/dev/sdb1'
elif lines.find('/dev/sdb2') != -1:
- neoinstall='/dev/sdb2'
+ neoinstall = '/dev/sdb2'
elif lines.find('/dev/sdc1') != -1:
- neoinstall='/dev/sdc1'
+ neoinstall = '/dev/sdc1'
elif lines.find('/dev/sdd1') != -1:
- neoinstall='/dev/sdd1'
+ neoinstall = '/dev/sdd1'
elif lines.find('/dev/sde1') != -1:
- neoinstall='/dev/sde1'
+ neoinstall = '/dev/sde1'
elif lines.find('/dev/sdf1') != -1:
- neoinstall='/dev/sdf1'
+ neoinstall = '/dev/sdf1'
return neoinstall
-
-def getLocationMultiboot():
- LocationMultiboot='UNKNOWN'
+
+def getLocationMultiboot():
+ LocationMultiboot = 'UNKNOWN'
if os.path.exists('/media/sda1/ImageBoot'):
- LocationMultiboot='/dev/sda1'
+ LocationMultiboot = '/dev/sda1'
if os.path.exists('/media/sda2/ImageBoot'):
- LocationMultiboot='/dev/sda2'
+ LocationMultiboot = '/dev/sda2'
if os.path.exists('/media/sdb1/ImageBoot'):
- LocationMultiboot='/dev/sdb1'
+ LocationMultiboot = '/dev/sdb1'
if os.path.exists('/media/sdb2/ImageBoot'):
- LocationMultiboot='/dev/sdb2'
+ LocationMultiboot = '/dev/sdb2'
if os.path.exists('/media/sdc1/ImageBoot'):
- LocationMultiboot='/dev/sdc1'
+ LocationMultiboot = '/dev/sdc1'
if os.path.exists('/media/sdd1/ImageBoot'):
- LocationMultiboot='/dev/sdd1'
+ LocationMultiboot = '/dev/sdd1'
if os.path.exists('/media/sde1/ImageBoot'):
- LocationMultiboot='/dev/sde1'
+ LocationMultiboot = '/dev/sde1'
if os.path.exists('/media/sdf1/ImageBoot'):
- LocationMultiboot='/dev/sdf1'
+ LocationMultiboot = '/dev/sdf1'
return LocationMultiboot
+
def getLabelDisck():
- label='UNKNOWN'
+ label = 'UNKNOWN'
if os.path.exists('/usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/bin/reading_blkid'):
with open('/usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/bin/reading_blkid', 'r') as f:
lines = f.read()
f.close()
if lines.find('LABEL=') != -1:
- label='LABEL='
- return label
+ label = 'LABEL='
+ return label
+
+#checking device neo
+
-#checking device neo
def getNeoMount():
- neo='UNKNOWN'
+ neo = 'UNKNOWN'
if os.path.exists('/proc/mounts'):
with open('/proc/mounts', 'r') as f:
lines = f.read()
f.close()
if lines.find('/dev/sda1 /media/hdd') != -1:
- neo='hdd_install_/dev/sda1'
+ neo = 'hdd_install_/dev/sda1'
elif lines.find('/dev/sdb1 /media/hdd') != -1:
- neo='hdd_install_/dev/sdb1'
+ neo = 'hdd_install_/dev/sdb1'
elif lines.find('/dev/sda2 /media/hdd') != -1:
- neo='hdd_install_/dev/sda2'
+ neo = 'hdd_install_/dev/sda2'
elif lines.find('/dev/sdb2 /media/hdd') != -1:
- neo='hdd_install_/dev/sdb2'
+ neo = 'hdd_install_/dev/sdb2'
elif lines.find('/dev/sdc1 /media/hdd') != -1:
- neo='hdd_install_/dev/sdc1'
+ neo = 'hdd_install_/dev/sdc1'
elif lines.find('/dev/sdd1 /media/hdd') != -1:
- neo='hdd_install_/dev/sdd1'
+ neo = 'hdd_install_/dev/sdd1'
elif lines.find('/dev/sde1 /media/hdd') != -1:
- neo='hdd_install_/dev/sde1'
+ neo = 'hdd_install_/dev/sde1'
elif lines.find('/dev/sdf1 /media/hdd') != -1:
- neo='hdd_install_/dev/sdf1'
+ neo = 'hdd_install_/dev/sdf1'
+
+ return neo
- return neo
def getNeoMount2():
- neo='UNKNOWN'
+ neo = 'UNKNOWN'
if os.path.exists('/proc/mounts'):
with open('/proc/mounts', 'r') as f:
lines = f.read()
f.close()
if lines.find('/dev/sda1 /media/usb') != -1:
- neo='usb_install_/dev/sda1'
+ neo = 'usb_install_/dev/sda1'
elif lines.find('/dev/sdb1 /media/usb') != -1:
- neo='usb_install_/dev/sdb1'
+ neo = 'usb_install_/dev/sdb1'
elif lines.find('/dev/sdb2 /media/usb') != -1:
- neo='usb_install_/dev/sdb2'
+ neo = 'usb_install_/dev/sdb2'
elif lines.find('/dev/sdc1 /media/usb') != -1:
- neo='usb_install_/dev/sdc1'
+ neo = 'usb_install_/dev/sdc1'
elif lines.find('/dev/sdd1 /media/usb') != -1:
- neo='usb_install_/dev/sdd1'
+ neo = 'usb_install_/dev/sdd1'
elif lines.find('/dev/sde1 /media/usb') != -1:
- neo='usb_install_/dev/sde1'
+ neo = 'usb_install_/dev/sde1'
elif lines.find('/dev/sdf1 /media/usb') != -1:
- neo='usb_install_/dev/sdf1'
+ neo = 'usb_install_/dev/sdf1'
elif lines.find('/dev/sda1 /media/usb2') != -1:
- neo='usb_install_/dev/sda1'
+ neo = 'usb_install_/dev/sda1'
elif lines.find('/dev/sdb1 /media/usb2') != -1:
- neo='usb_install_/dev/sdb1'
+ neo = 'usb_install_/dev/sdb1'
elif lines.find('/dev/sdb2 /media/usb2') != -1:
- neo='usb_install_/dev/sdb2'
+ neo = 'usb_install_/dev/sdb2'
elif lines.find('/dev/sdc1 /media/usb2') != -1:
- neo='usb_install_/dev/sdc1'
+ neo = 'usb_install_/dev/sdc1'
elif lines.find('/dev/sdd1 /media/usb2') != -1:
- neo='usb_install_/dev/sdd1'
+ neo = 'usb_install_/dev/sdd1'
elif lines.find('/dev/sde1 /media/usb2') != -1:
- neo='usb_install_/dev/sde1'
+ neo = 'usb_install_/dev/sde1'
elif lines.find('/dev/sdf1 /media/usb2') != -1:
- neo='usb_install_/dev/sdf1'
+ neo = 'usb_install_/dev/sdf1'
return neo
+
def getNeoMount3():
- neo='UNKNOWN'
+ neo = 'UNKNOWN'
if os.path.exists('/proc/mounts'):
with open('/proc/mounts', 'r') as f:
lines = f.read()
f.close()
if lines.find('/dev/sda1 /media/cf') != -1:
- neo='cf_install_/dev/sda1'
+ neo = 'cf_install_/dev/sda1'
elif lines.find('/dev/sdb1 /media/cf') != -1:
- neo='cf_install_/dev/sdb1'
+ neo = 'cf_install_/dev/sdb1'
return neo
+
def getNeoMount4():
- neo='UNKNOWN'
+ neo = 'UNKNOWN'
if os.path.exists('/proc/mounts'):
with open('/proc/mounts', 'r') as f:
lines = f.read()
- f.close()
+ f.close()
if lines.find('/dev/sda1 /media/card') != -1:
- neo='card_install_/dev/sda1'
+ neo = 'card_install_/dev/sda1'
elif lines.find('/dev/sdb1 /media/card') != -1:
- neo='card_install_/dev/sdb1'
+ neo = 'card_install_/dev/sdb1'
return neo
-
+
+
def getNeoMount5():
- neo='UNKNOWN'
+ neo = 'UNKNOWN'
if os.path.exists('/proc/mounts'):
with open('/proc/mounts', 'r') as f:
lines = f.read()
f.close()
if lines.find('/dev/sda1 /media/mmc') != -1:
- neo='mmc_install_/dev/sda1'
+ neo = 'mmc_install_/dev/sda1'
elif lines.find('/dev/sdb1 /media/mmc') != -1:
- neo='mmc_install_/dev/sdb1'
+ neo = 'mmc_install_/dev/sdb1'
return neo
-#zwraca typ chipa prcesora
+#zwraca typ chipa prcesora
def getCPUSoC():
- chipset='UNKNOWN'
+ chipset = 'UNKNOWN'
if os.path.exists('/proc/stb/info/chipset'):
with open('/proc/stb/info/chipset', 'r') as f:
chipset = f.readline().strip()
- f.close()
+ f.close()
if chipset == '7405(with 3D)':
chipset = '7405'
return chipset
-
+
+
def getCPUSoCModel():
- devicetree='UNKNOWN'
+ devicetree = 'UNKNOWN'
if os.path.exists('/proc/device-tree/model'):
with open('/proc/device-tree/model', 'r') as f:
devicetree = f.readline().strip()
- f.close()
- return devicetree
+ f.close()
+ return devicetree
-#zwraca wybrane image w neoboot do uruchomienia
-def getImageNeoBoot():
- imagefile='UNKNOWN'
- if os.path.exists('%sImageBoot/.neonextboot' % getNeoLocation() ):
- with open('%sImageBoot/.neonextboot' % getNeoLocation() , 'r') as f:
+#zwraca wybrane image w neoboot do uruchomienia
+
+
+def getImageNeoBoot():
+ imagefile = 'UNKNOWN'
+ if os.path.exists('%sImageBoot/.neonextboot' % getNeoLocation()):
+ with open('%sImageBoot/.neonextboot' % getNeoLocation(), 'r') as f:
imagefile = f.readline().strip()
- f.close()
+ f.close()
return imagefile
-#zwraca model vuplus
+#zwraca model vuplus
+
+
def getBoxVuModel():
- vumodel='UNKNOWN'
+ vumodel = 'UNKNOWN'
if fileExists("/proc/stb/info/vumodel") and not fileExists("/proc/stb/info/boxtype"):
with open('/proc/stb/info/vumodel', 'r') as f:
vumodel = f.readline().strip()
- f.close()
+ f.close()
elif fileExists("/proc/stb/info/boxtype") and not fileExists("/proc/stb/info/vumodel"):
with open('/proc/stb/info/boxtype', 'r') as f:
vumodel = f.readline().strip()
f.close()
return vumodel
+
def getVuModel():
if fileExists("/proc/stb/info/vumodel") and not fileExists("/proc/stb/info/boxtype"):
brand = "Vu+"
- f = open("/proc/stb/info/vumodel",'r')
+ f = open("/proc/stb/info/vumodel", 'r')
procmodel = f.readline().strip()
f.close()
model = procmodel.title().replace("olose", "olo SE").replace("olo2se", "olo2 SE").replace("2", "²")
- return model
+ return model
+
+#zwraca nazwe stb z pliku hostname
+
-#zwraca nazwe stb z pliku hostname
def getBoxHostName():
if os.path.exists('/etc/hostname'):
with open('/etc/hostname', 'r') as f:
myboxname = f.readline().strip()
- f.close()
- return myboxname
+ f.close()
+ return myboxname
+
+#zwraca vuplus/vumodel
+
-#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"):
@@ -440,8 +480,10 @@ def getTunerModel(): #< neoboot.py
elif os.path.isfile('proc/stb/info/model') and not os.path.isfile("/proc/stb/info/mid"):
BOX_NAME = open('/proc/stb/info/model').read().strip()
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,57 +500,58 @@ def getKernelVersion():
return _('unknown')
# czysci pamiec
+
+
def runCMDS(cmdsList):
clearMemory()
if isinstance(cmdsList, (list, tuple)):
myCMD = '\n'.join(cmdsList)# + '\n'
ret = os.system(myCMD)
- return rett
+ return rett
-def getImageDistroN():
- image='Internal storage'
+def getImageDistroN():
+ image = 'Internal storage'
- if fileExists('/.multinfo') and fileExists ('%sImageBoot/.imagedistro' % getNeoLocation() ):
- with open('%sImageBoot/.imagedistro' % getNeoLocation() , 'r') as f:
+ if fileExists('/.multinfo') and fileExists('%sImageBoot/.imagedistro' % getNeoLocation()):
+ with open('%sImageBoot/.imagedistro' % getNeoLocation(), 'r') as f:
image = f.readline().strip()
f.close()
-
+
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 ", " ")
f.close()
image = imagever
elif not fileExists('/.multinfo') and fileExists('/etc/bhversion'):
- f = open("/etc/bhversion",'r')
+ f = open("/etc/bhversion", 'r')
imagever = f.readline().strip()
f.close()
image = imagever
# elif not fileExists('/.multinfo') and fileExists('/etc/vtiversion.info'):
-# image = 'VTI Team Image '
-
+# image = 'VTI Team Image '
+
elif fileExists('/.multinfo') and fileExists('/etc/bhversion'):
image = 'Flash ' + ' ' + getBoxHostName()
elif fileExists('/.multinfo') and fileExists('/etc/vtiversion.info'):
image = 'Flash ' + ' ' + getBoxHostName()
-
- elif fileExists('/usr/lib/enigma2/python/boxbranding.so') and not fileExists('/.multinfo'):
+ elif fileExists('/usr/lib/enigma2/python/boxbranding.so') and not fileExists('/.multinfo'):
from boxbranding import getImageDistro
image = getImageDistro()
- elif fileExists('/media/InternalFlash/etc/issue.net') and fileExists('/.multinfo') and not fileExists('%sImageBoot/.imagedistro' % getNeoLocation() ):
+ elif fileExists('/media/InternalFlash/etc/issue.net') and fileExists('/.multinfo') and not fileExists('%sImageBoot/.imagedistro' % getNeoLocation()):
obraz = open('/media/InternalFlash/etc/issue.net', 'r').readlines()
imagetype = obraz[0][:-3]
image = imagetype
-
+
elif fileExists('/etc/issue.net') and not fileExists('/.multinfo'):
obraz = open('/etc/issue.net', 'r').readlines()
imagetype = obraz[0][:-3]
- image = imagetype
+ image = imagetype
else:
image = 'Inernal Flash ' + ' ' + getBoxHostName()
@@ -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')
@@ -641,7 +690,8 @@ def getChipSetString():
return str(chipset.lower().replace('\n', '').replace('bcm', ''))
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')
@@ -678,14 +729,16 @@ def getCpuCoresString():
return cores
except IOError:
return 'unavailable'
-
+
+
def getEnigmaVersionString():
import enigma
enigma_version = enigma.getEnigmaVersionString()
if '-(no branch)' in enigma_version:
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:
@@ -771,60 +828,61 @@ def getMachineProcModel():
elif BOX_NAME == 'uno4k':
GETMACHINEPROCMODEL = 'bcm7252S'
elif BOX_NAME == 'solo4k':
- GETMACHINEPROCMODEL = 'bcm7376'
+ GETMACHINEPROCMODEL = 'bcm7376'
elif BOX_NAME == 'zero4K':
GETMACHINEPROCMODEL = 'bcm72604'
elif BOX_NAME == 'uno4kse':
- GETMACHINEPROCMODEL = ''
+ GETMACHINEPROCMODEL = ''
procmodel = getMachineProcModel()
return procmodel
-
+
def getMountPointAll():
- os.system('touch ' + LinkNeoBoot + '/files/mountpoint.sh; echo "#!/bin/sh\n" >> ' + LinkNeoBoot + '/files/mountpoint.sh; chmod 0755 ' + LinkNeoBoot + '/files/mountpoint.sh')
- if getNeoMount() == 'hdd_install_/dev/sda1':
- os.system('echo "umount -l /media/hdd\nmkdir -p /media/hdd\nmkdir -p /media/sda1\n/bin/mount /dev/sda1 /media/hdd\n/bin/mount /dev/sda1 /media/sda1" >> ' + LinkNeoBoot + '/files/mountpoint.sh')
- elif getNeoMount() == 'hdd_install_/dev/sdb1':
- os.system('echo "umount -l /media/hdd\nmkdir -p /media/hdd\nmkdir -p /media/sdb1\n/bin/mount /dev/sdb1 /media/hdd\n/bin/mount /dev/sdb1 /media/sdb1" >> ' + LinkNeoBoot + '/files/mountpoint.sh')
- elif getNeoMount() == 'hdd_install_/dev/sda2':
- os.system('echo "umount -l /media/hdd\nmkdir -p /media/hdd\nmkdir -p /media/sda2\n/bin/mount /dev/sda2 /media/hdd\n/bin/mount /dev/sda2 /media/sda2" >> ' + LinkNeoBoot + '/files/mountpoint.sh')
- elif getNeoMount() == 'hdd_install_/dev/sdb2':
- os.system('echo "umount -l /media/hdd\nmkdir -p /media/hdd\nmkdir -p /media/sdb2\n/bin/mount /dev/sdb2 /media/hdd\n/bin/mount /dev/sdb2 /media/sdb2" >> ' + LinkNeoBoot + '/files/mountpoint.sh')
+ os.system('touch ' + LinkNeoBoot + '/files/mountpoint.sh; echo "#!/bin/sh\n" >> ' + LinkNeoBoot + '/files/mountpoint.sh; chmod 0755 ' + LinkNeoBoot + '/files/mountpoint.sh')
+ if getNeoMount() == 'hdd_install_/dev/sda1':
+ os.system('echo "umount -l /media/hdd\nmkdir -p /media/hdd\nmkdir -p /media/sda1\n/bin/mount /dev/sda1 /media/hdd\n/bin/mount /dev/sda1 /media/sda1" >> ' + LinkNeoBoot + '/files/mountpoint.sh')
+ elif getNeoMount() == 'hdd_install_/dev/sdb1':
+ os.system('echo "umount -l /media/hdd\nmkdir -p /media/hdd\nmkdir -p /media/sdb1\n/bin/mount /dev/sdb1 /media/hdd\n/bin/mount /dev/sdb1 /media/sdb1" >> ' + LinkNeoBoot + '/files/mountpoint.sh')
+ elif getNeoMount() == 'hdd_install_/dev/sda2':
+ os.system('echo "umount -l /media/hdd\nmkdir -p /media/hdd\nmkdir -p /media/sda2\n/bin/mount /dev/sda2 /media/hdd\n/bin/mount /dev/sda2 /media/sda2" >> ' + LinkNeoBoot + '/files/mountpoint.sh')
+ elif getNeoMount() == 'hdd_install_/dev/sdb2':
+ os.system('echo "umount -l /media/hdd\nmkdir -p /media/hdd\nmkdir -p /media/sdb2\n/bin/mount /dev/sdb2 /media/hdd\n/bin/mount /dev/sdb2 /media/sdb2" >> ' + LinkNeoBoot + '/files/mountpoint.sh')
#---------------------------------------------
- if getNeoMount2() == 'usb_install_/dev/sdb1':
- os.system('echo "\numount -l /media/usb\nmkdir -p /media/usb\nmkdir -p /media/sdb1\n/bin/mount /dev/sdb1 /media/usb\n/bin/mount /dev/sdb1 /media/sdb1" >> ' + LinkNeoBoot + '/files/mountpoint.sh')
- elif getNeoMount2() == 'usb_install_/dev/sda1':
- os.system('echo "umount -l /media/usb\nmkdir -p /media/usb\nmkdir -p /media/sda1\n/bin/mount /dev/sda1 /media/sda1\n/bin/mount /dev/sda1 /media/usb" >> ' + LinkNeoBoot + '/files/mountpoint.sh')
- elif getNeoMount2() == 'usb_install_/dev/sdb2':
- os.system('echo "umount -l /media/usb\nmkdir -p /media/usb\nmkdir -p /media/sdb2\n/bin/mount /dev/sdb2 /media/sdb2\n/bin/mount /dev/sdb2 /media/usb" >> ' + LinkNeoBoot + '/files/mountpoint.sh')
- elif getNeoMount2() == 'usb_install_/dev/sdc1':
- os.system('echo "umount -l /media/usb\nmkdir -p /media/usb\nmkdir -p /media/sdc1\n/bin/mount /dev/sdc1 /media/sdb2\n/bin/mount /dev/sdc1 /media/usb" >> ' + LinkNeoBoot + '/files/mountpoint.sh')
- elif getNeoMount2() == 'usb_install_/dev/sdd1':
- os.system('echo "umount -l /media/usb\nmkdir -p /media/usb\nmkdir -p /media/sdd1\n/bin/mount /dev/sdd1 /media/sdd1\n/bin/mount /dev/sdd1 /media/usb" >> ' + LinkNeoBoot + '/files/mountpoint.sh')
- elif getNeoMount2() == 'usb_install_/dev/sde1':
- os.system('echo "umount -l /media/usb\nmkdir -p /media/usb\nmkdir -p /media/sde1\n/bin/mount /dev/sde1 /media/sde1\n/bin/mount /dev/sde1 /media/usb" >> ' + LinkNeoBoot + '/files/mountpoint.sh')
- elif getNeoMount2() == 'usb_install_/dev/sdf1':
- os.system('echo "umount -l /media/usb\nmkdir -p /media/usb\nmkdir -p /media/sdf1\n/bin/mount /dev/sdf1 /media/sdf1\n/bin/mount /dev/sdf1 /media/usb" >> ' + LinkNeoBoot + '/files/mountpoint.sh')
- #---------------------------------------------
- elif getNeoMount3() == 'cf_install_/dev/sda1':
- os.system('echo "umount -l /media/cf\nmkdir -p /media/cf\nmkdir -p /media/sdb1\n/bin/mount /dev/sda1 /media/cf\n/bin/mount /dev/sda1 /media/sda1" >> ' + LinkNeoBoot + '/files/mountpoint.sh')
- elif getNeoMount3() == 'cf_install_/dev/sdb1':
- os.system('echo "umount -l /media/cf\nmkdir -p /media/cf\nmkdir -p /media/sdb1\n/bin/mount /dev/sdb1 /media/cf\n/bin/mount /dev/sdb1 /media/sdb1" >> ' + LinkNeoBoot + '/files/mountpoint.sh')
+ if getNeoMount2() == 'usb_install_/dev/sdb1':
+ os.system('echo "\numount -l /media/usb\nmkdir -p /media/usb\nmkdir -p /media/sdb1\n/bin/mount /dev/sdb1 /media/usb\n/bin/mount /dev/sdb1 /media/sdb1" >> ' + LinkNeoBoot + '/files/mountpoint.sh')
+ elif getNeoMount2() == 'usb_install_/dev/sda1':
+ os.system('echo "umount -l /media/usb\nmkdir -p /media/usb\nmkdir -p /media/sda1\n/bin/mount /dev/sda1 /media/sda1\n/bin/mount /dev/sda1 /media/usb" >> ' + LinkNeoBoot + '/files/mountpoint.sh')
+ elif getNeoMount2() == 'usb_install_/dev/sdb2':
+ os.system('echo "umount -l /media/usb\nmkdir -p /media/usb\nmkdir -p /media/sdb2\n/bin/mount /dev/sdb2 /media/sdb2\n/bin/mount /dev/sdb2 /media/usb" >> ' + LinkNeoBoot + '/files/mountpoint.sh')
+ elif getNeoMount2() == 'usb_install_/dev/sdc1':
+ os.system('echo "umount -l /media/usb\nmkdir -p /media/usb\nmkdir -p /media/sdc1\n/bin/mount /dev/sdc1 /media/sdb2\n/bin/mount /dev/sdc1 /media/usb" >> ' + LinkNeoBoot + '/files/mountpoint.sh')
+ elif getNeoMount2() == 'usb_install_/dev/sdd1':
+ os.system('echo "umount -l /media/usb\nmkdir -p /media/usb\nmkdir -p /media/sdd1\n/bin/mount /dev/sdd1 /media/sdd1\n/bin/mount /dev/sdd1 /media/usb" >> ' + LinkNeoBoot + '/files/mountpoint.sh')
+ elif getNeoMount2() == 'usb_install_/dev/sde1':
+ os.system('echo "umount -l /media/usb\nmkdir -p /media/usb\nmkdir -p /media/sde1\n/bin/mount /dev/sde1 /media/sde1\n/bin/mount /dev/sde1 /media/usb" >> ' + LinkNeoBoot + '/files/mountpoint.sh')
+ elif getNeoMount2() == 'usb_install_/dev/sdf1':
+ os.system('echo "umount -l /media/usb\nmkdir -p /media/usb\nmkdir -p /media/sdf1\n/bin/mount /dev/sdf1 /media/sdf1\n/bin/mount /dev/sdf1 /media/usb" >> ' + LinkNeoBoot + '/files/mountpoint.sh')
#---------------------------------------------
- elif getNeoMount4() == 'card_install_/dev/sda1':
- os.system('echo "umount -l /media/card\nmkdir -p /media/card\nmkdir -p /media/sda1\n/bin/mount /dev/sda1 /media/card\n/bin/mount /dev/sda1 /media/sda1" >> ' + LinkNeoBoot + '/files/mountpoint.sh')
- elif getNeoMount4() == 'card_install_/dev/sdb1':
- os.system('echo "umount -l /media/card\nmkdir -p /media/card\nmkdir -p /media/sdb1\n/bin/mount /dev/sdb1 /media/card\n/bin/mount /dev/sdb1 /media/sdb1" >> ' + LinkNeoBoot + '/files/mountpoint.sh')
+ elif getNeoMount3() == 'cf_install_/dev/sda1':
+ os.system('echo "umount -l /media/cf\nmkdir -p /media/cf\nmkdir -p /media/sdb1\n/bin/mount /dev/sda1 /media/cf\n/bin/mount /dev/sda1 /media/sda1" >> ' + LinkNeoBoot + '/files/mountpoint.sh')
+ elif getNeoMount3() == 'cf_install_/dev/sdb1':
+ os.system('echo "umount -l /media/cf\nmkdir -p /media/cf\nmkdir -p /media/sdb1\n/bin/mount /dev/sdb1 /media/cf\n/bin/mount /dev/sdb1 /media/sdb1" >> ' + LinkNeoBoot + '/files/mountpoint.sh')
#---------------------------------------------
- elif getNeoMount5() == 'mmc_install_/dev/sda1':
- os.system('echo "umount -l /media/mmc\nmkdir -p /media/mmc\nmkdir -p /media/sda1\n/bin/mount /dev/sda1 /media/mmc\n/bin/mount /dev/sda1 /media/sda1" >> ' + LinkNeoBoot + '/files/mountpoint.sh')
- elif getNeoMount5() == 'mmc_install_/dev/sdb1':
- 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')
+ elif getNeoMount4() == 'card_install_/dev/sda1':
+ os.system('echo "umount -l /media/card\nmkdir -p /media/card\nmkdir -p /media/sda1\n/bin/mount /dev/sda1 /media/card\n/bin/mount /dev/sda1 /media/sda1" >> ' + LinkNeoBoot + '/files/mountpoint.sh')
+ elif getNeoMount4() == 'card_install_/dev/sdb1':
+ os.system('echo "umount -l /media/card\nmkdir -p /media/card\nmkdir -p /media/sdb1\n/bin/mount /dev/sdb1 /media/card\n/bin/mount /dev/sdb1 /media/sdb1" >> ' + LinkNeoBoot + '/files/mountpoint.sh')
+ #---------------------------------------------
+ elif getNeoMount5() == 'mmc_install_/dev/sda1':
+ os.system('echo "umount -l /media/mmc\nmkdir -p /media/mmc\nmkdir -p /media/sda1\n/bin/mount /dev/sda1 /media/mmc\n/bin/mount /dev/sda1 /media/sda1" >> ' + LinkNeoBoot + '/files/mountpoint.sh')
+ elif getNeoMount5() == 'mmc_install_/dev/sdb1':
+ 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')
+ os.system('' + LinkNeoBoot + '/files/mountpoint.sh')
+ os.system('echo ' + getLocationMultiboot() + ' > ' + LinkNeoBoot + '/bin/install; chmod 0755 ' + LinkNeoBoot + '/bin/install')
if getLocationMultiboot() == '/dev/sda1':
out = open('' + LinkNeoBoot + '/files/neo.sh', 'w')
out.write('#!/bin/sh\n\n/bin/mount /dev/sda1 ' + getNeoLocation() + ' \n\nexit 0')
@@ -844,7 +902,7 @@ def getMountPointNeo():
elif getLocationMultiboot() == '/dev/sdc1':
out = open('' + LinkNeoBoot + '/files/neo.sh', 'w')
out.write('#!/bin/sh\n\n/bin/mount /dev/sdc1 ' + getNeoLocation() + ' \n\nexit 0')
- out.close()
+ out.close()
elif getLocationMultiboot() == '/dev/sdd1':
out = open('' + LinkNeoBoot + '/files/neo.sh', 'w')
out.write('#!/bin/sh\n\n/bin/mount /dev/sdd1 ' + getNeoLocation() + ' \n\nexit 0')
@@ -859,49 +917,49 @@ 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')
- if getNeoMount() == 'hdd_install_/dev/sda1':
- os.system('echo "umount -l /media/hdd\nmkdir -p /media/hdd\n/bin/mount /dev/sda1 /media/hdd" >> ' + LinkNeoBoot + '/files/mountpoint.sh')
- elif getNeoMount() == 'hdd_install_/dev/sdb1':
- os.system('echo "umount -l /media/hdd\nmkdir -p /media/hdd\n/bin/mount /dev/sdb1 /media/hdd" >> ' + LinkNeoBoot + '/files/mountpoint.sh')
- elif getNeoMount() == 'hdd_install_/dev/sda2':
- os.system('echo "umount -l /media/hdd\nmkdir -p /media/hdd\n/bin/mount /dev/sda2 /media/hdd" >> ' + LinkNeoBoot + '/files/mountpoint.sh')
- elif getNeoMount() == 'hdd_install_/dev/sdb2':
- os.system('echo "umount -l /media/hdd\nmkdir -p /media/hdd\n/bin/mount /dev/sda2 /media/hdd" >> ' + LinkNeoBoot + '/files/mountpoint.sh')
+ os.system('touch ' + LinkNeoBoot + '/files/mountpoint.sh; echo "#!/bin/sh" > ' + LinkNeoBoot + '/files/mountpoint.sh; chmod 0755 ' + LinkNeoBoot + '/files/mountpoint.sh')
+ if getNeoMount() == 'hdd_install_/dev/sda1':
+ os.system('echo "umount -l /media/hdd\nmkdir -p /media/hdd\n/bin/mount /dev/sda1 /media/hdd" >> ' + LinkNeoBoot + '/files/mountpoint.sh')
+ elif getNeoMount() == 'hdd_install_/dev/sdb1':
+ os.system('echo "umount -l /media/hdd\nmkdir -p /media/hdd\n/bin/mount /dev/sdb1 /media/hdd" >> ' + LinkNeoBoot + '/files/mountpoint.sh')
+ elif getNeoMount() == 'hdd_install_/dev/sda2':
+ os.system('echo "umount -l /media/hdd\nmkdir -p /media/hdd\n/bin/mount /dev/sda2 /media/hdd" >> ' + LinkNeoBoot + '/files/mountpoint.sh')
+ elif getNeoMount() == 'hdd_install_/dev/sdb2':
+ os.system('echo "umount -l /media/hdd\nmkdir -p /media/hdd\n/bin/mount /dev/sda2 /media/hdd" >> ' + LinkNeoBoot + '/files/mountpoint.sh')
#---------------------------------------------
- if getNeoMount2() == 'usb_install_/dev/sdb1':
- os.system('echo "umount -l /media/usb\nmkdir -p /media/usb\n/bin/mount /dev/sdb1 /media/usb" >> ' + LinkNeoBoot + '/files/mountpoint.sh')
- elif getNeoMount2() == 'usb_install_/dev/sda1':
- os.system('echo "umount -l /media/usb\nmkdir -p /media/usb\n/bin/mount /dev/sda1 /media/usb" >> ' + LinkNeoBoot + '/files/mountpoint.sh')
- elif getNeoMount2() == 'usb_install_/dev/sdb2':
- os.system('echo "umount -l /media/usb\nmkdir -p /media/usb\n/bin/mount /dev/sdb2 /media/usb" >> ' + LinkNeoBoot + '/files/mountpoint.sh')
- elif getNeoMount2() == 'usb_install_/dev/sdc1':
- os.system('echo "umount -l /media/usb\nmkdir -p /media/usb\n/bin/mount /dev/sdc1 /media/usb" >> ' + LinkNeoBoot + '/files/mountpoint.sh')
- elif getNeoMount2() == 'usb_install_/dev/sdd1':
- os.system('echo "umount -l /media/usb\nmkdir -p /media/usb\n/bin/mount /dev/sdd1 /media/usb" >> ' + LinkNeoBoot + '/files/mountpoint.sh')
- elif getNeoMount2() == 'usb_install_/dev/sde1':
- os.system('echo "umount -l /media/usb\nmkdir -p /media/usb\n/bin/mount /dev/sde1 /media/usb" >> ' + LinkNeoBoot + '/files/mountpoint.sh')
- elif getNeoMount2() == 'usb_install_/dev/sdf1':
- os.system('echo "umount -l /media/usb\nmkdir -p /media/usb\n/bin/mount /dev/sdf1 /media/usb" >> ' + LinkNeoBoot + '/files/mountpoint.sh')
- #---------------------------------------------
- elif getNeoMount3() == 'cf_install_/dev/sda1':
- os.system('echo "umount -l /media/cf\nmkdir -p /media/cf\n/bin/mount /dev/sda1 /media/cf" >> ' + LinkNeoBoot + '/files/mountpoint.sh')
- elif getNeoMount3() == 'cf_install_/dev/sdb1':
- os.system('echo "umount -l /media/cf\nmkdir -p /media/cf\n/bin/mount /dev/sdb1 /media/cf" >> ' + LinkNeoBoot + '/files/mountpoint.sh')
+ if getNeoMount2() == 'usb_install_/dev/sdb1':
+ os.system('echo "umount -l /media/usb\nmkdir -p /media/usb\n/bin/mount /dev/sdb1 /media/usb" >> ' + LinkNeoBoot + '/files/mountpoint.sh')
+ elif getNeoMount2() == 'usb_install_/dev/sda1':
+ os.system('echo "umount -l /media/usb\nmkdir -p /media/usb\n/bin/mount /dev/sda1 /media/usb" >> ' + LinkNeoBoot + '/files/mountpoint.sh')
+ elif getNeoMount2() == 'usb_install_/dev/sdb2':
+ os.system('echo "umount -l /media/usb\nmkdir -p /media/usb\n/bin/mount /dev/sdb2 /media/usb" >> ' + LinkNeoBoot + '/files/mountpoint.sh')
+ elif getNeoMount2() == 'usb_install_/dev/sdc1':
+ os.system('echo "umount -l /media/usb\nmkdir -p /media/usb\n/bin/mount /dev/sdc1 /media/usb" >> ' + LinkNeoBoot + '/files/mountpoint.sh')
+ elif getNeoMount2() == 'usb_install_/dev/sdd1':
+ os.system('echo "umount -l /media/usb\nmkdir -p /media/usb\n/bin/mount /dev/sdd1 /media/usb" >> ' + LinkNeoBoot + '/files/mountpoint.sh')
+ elif getNeoMount2() == 'usb_install_/dev/sde1':
+ os.system('echo "umount -l /media/usb\nmkdir -p /media/usb\n/bin/mount /dev/sde1 /media/usb" >> ' + LinkNeoBoot + '/files/mountpoint.sh')
+ elif getNeoMount2() == 'usb_install_/dev/sdf1':
+ os.system('echo "umount -l /media/usb\nmkdir -p /media/usb\n/bin/mount /dev/sdf1 /media/usb" >> ' + LinkNeoBoot + '/files/mountpoint.sh')
#---------------------------------------------
- elif getNeoMount4() == 'card_install_/dev/sda1':
- os.system('echo "umount -l /media/card\nmkdir -p /media/card\n/bin/mount /dev/sda1 /media/card" >> ' + LinkNeoBoot + '/files/mountpoint.sh')
- elif getNeoMount4() == 'card_install_/dev/sdb1':
- os.system('echo "umount -l /media/card\nmkdir -p /media/card\n/bin/mount /dev/sdb1 /media/card" >> ' + LinkNeoBoot + '/files/mountpoint.sh')
+ elif getNeoMount3() == 'cf_install_/dev/sda1':
+ os.system('echo "umount -l /media/cf\nmkdir -p /media/cf\n/bin/mount /dev/sda1 /media/cf" >> ' + LinkNeoBoot + '/files/mountpoint.sh')
+ elif getNeoMount3() == 'cf_install_/dev/sdb1':
+ os.system('echo "umount -l /media/cf\nmkdir -p /media/cf\n/bin/mount /dev/sdb1 /media/cf" >> ' + LinkNeoBoot + '/files/mountpoint.sh')
#---------------------------------------------
- elif getNeoMount5() == 'mmc_install_/dev/sda1':
- os.system('echo "umount -l /media/mmc\nmkdir -p /media/mmc\n/bin/mount /dev/sda1 /media/mmc" >> ' + LinkNeoBoot + '/files/mountpoint.sh')
- elif getNeoMount5() == 'mmc_install_/dev/sdb1':
- os.system('echo "umount -l /media/mmc\nmkdir -p /media/mmc\n/bin/mount /dev/sdb1 /media/mmc" >> ' + LinkNeoBoot + '/files/mountpoint.sh')
+ elif getNeoMount4() == 'card_install_/dev/sda1':
+ os.system('echo "umount -l /media/card\nmkdir -p /media/card\n/bin/mount /dev/sda1 /media/card" >> ' + LinkNeoBoot + '/files/mountpoint.sh')
+ elif getNeoMount4() == 'card_install_/dev/sdb1':
+ os.system('echo "umount -l /media/card\nmkdir -p /media/card\n/bin/mount /dev/sdb1 /media/card" >> ' + LinkNeoBoot + '/files/mountpoint.sh')
+ #---------------------------------------------
+ elif getNeoMount5() == 'mmc_install_/dev/sda1':
+ os.system('echo "umount -l /media/mmc\nmkdir -p /media/mmc\n/bin/mount /dev/sda1 /media/mmc" >> ' + LinkNeoBoot + '/files/mountpoint.sh')
+ elif getNeoMount5() == 'mmc_install_/dev/sdb1':
+ os.system('echo "umount -l /media/mmc\nmkdir -p /media/mmc\n/bin/mount /dev/sdb1 /media/mmc" >> ' + LinkNeoBoot + '/files/mountpoint.sh')
os.system('echo "\n\nexit 0" >> ' + LinkNeoBoot + '/files/mountpoint.sh')
boxbrand = sys.modules[__name__]
-
diff --git a/NeoBoot/files/testinout b/NeoBoot/files/testinout
index 0c193ca..2b4d3b1 100644
--- a/NeoBoot/files/testinout
+++ b/NeoBoot/files/testinout
@@ -1,105 +1,103 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
-
+
import sys
import os
from os import system
-import time
+import time
from Tools.Directories import fileExists, SCOPE_PLUGINS
-def getAccesDate():
- timego=''
+def getAccesDate():
+ timego = ''
dana = getTestOutTime() # etc Nie! Szukana liczba jest wieksza!
- strzal = getTestInTime() # tmp Nie! Szukana liczba jest mniejsza!
+ strzal = getTestInTime() # tmp Nie! Szukana liczba jest mniejsza!
if strzal == dana:
- timego='access'
+ timego = 'access'
elif strzal < dana:
- timego='isaccess'
+ timego = 'isaccess'
else:
- timego='timeoff'
- os.system('echo "19700101" > /usr/lib/periodon/.kodn')
+ timego = 'timeoff'
+ os.system('echo "19700101" > /usr/lib/periodon/.kodn')
return timego
def getTestCzas():
- mytestnC=''
- if os.path.exists('/usr/lib/periodon/.accessdate'):
+ mytestnC = ''
+ if os.path.exists('/usr/lib/periodon/.accessdate'):
with open('/usr/lib/periodon/.accessdate', 'r') as f:
mytestnC = f.readline().strip()
- f.close()
+ f.close()
return mytestnC
def getTestToTest():
- mytestnb=''
- if os.path.exists('/tmp/.nkod'):
+ mytestnb = ''
+ if os.path.exists('/tmp/.nkod'):
with open('/tmp/.nkod', 'r') as f:
mytestnb = f.readline().strip()
- f.close()
+ f.close()
return mytestnb
-
+
def getTestIn():
- neopluspro='UNKNOWN'
+ neopluspro = 'UNKNOWN'
if os.path.exists('/usr/lib/periodon/.kodn'):
with open('/usr/lib/periodon/.kodn', 'r') as f:
lines = f.read()
f.close()
if lines.find('1234' + getTestToTest() + '') != -1:
- neopluspro='1234%s' % getTestToTest()
- return neopluspro
+ neopluspro = '1234%s' % getTestToTest()
+ return neopluspro
def getTestOut():
- neoplus='UNKNOWN'
+ neoplus = 'UNKNOWN'
if os.path.exists('/tmp/.nkod'):
with open('/tmp/.nkod', 'r') as f:
lines2 = f.read()
- f.close()
- if lines2.find("%s" %getTestToTest()) != -1:
- neoplus='1234%s' % getTestToTest()
- return neoplus
-
+ f.close()
+ if lines2.find("%s" % getTestToTest()) != -1:
+ neoplus = '1234%s' % getTestToTest()
+ return neoplus
+
def getAccessN():
- neopro='UNKNOWN'
+ neopro = 'UNKNOWN'
if os.path.exists('/usr/lib/periodon/.kodn'):
with open('/usr/lib/periodon/.kodn', 'r') as f:
lines3 = f.read()
- f.close()
- if lines3.find('1234') != -1:
- neopro='1234'
+ f.close()
+ if lines3.find('1234') != -1:
+ neopro = '1234'
elif not lines3.find('1234') != -1:
- neopro='1235'
- return neopro
+ neopro = '1235'
+ return neopro
-def getTestInTime():
- mydatein='UNKNOWN'
+def getTestInTime():
+ mydatein = 'UNKNOWN'
if os.path.exists('/tmp/.finishdate'):
with open('/tmp/.finishdate', 'r') as f:
mydatein = f.readline().strip()
- f.close()
- return mydatein
-
+ f.close()
+ return mydatein
+
def getTestOutTime():
- mydateout='UNKNOWN'
+ mydateout = 'UNKNOWN'
if os.path.exists('/usr/lib/periodon/.accessdate'):
with open('/usr/lib/periodon/.accessdate', 'r') as f:
mydateout = f.readline().strip()
- f.close()
+ f.close()
return mydateout
-
+
def getButtonPin():
- mypin='UNKNOWN'
- if os.path.exists('/usr/lib/periodon'):
+ mypin = 'UNKNOWN'
+ if os.path.exists('/usr/lib/periodon'):
out = open('/usr/lib/periodon/.kodn', 'w')
out.write('1234%s' % getTestToTest())
- out.close()
- mypin='pinok'
- return mypin
-
-
+ out.close()
+ mypin = 'pinok'
+ return mypin
diff --git a/NeoBoot/files/tools.py b/NeoBoot/files/tools.py
index 5b526a0..c46d1c5 100644
--- a/NeoBoot/files/tools.py
+++ b/NeoBoot/files/tools.py
@@ -2,7 +2,7 @@
# -*- coding: utf-8 -*-
# system modules
-from Plugins.Extensions.NeoBoot.__init__ import _
+from Plugins.Extensions.NeoBoot.__init__ import _
import codecs
from enigma import getDesktop
from Components.About import about
@@ -14,7 +14,7 @@ from Components.Label import Label
from Components.ProgressBar import ProgressBar
from Components.ScrollLabel import ScrollLabel
from Components.Pixmap import Pixmap, MultiPixmap
-from Components.config import *
+from Components.config import *
from Screens.VirtualKeyBoard import VirtualKeyBoard
from Screens.MessageBox import MessageBox
from Screens.ChoiceBox import ChoiceBox
@@ -33,72 +33,80 @@ from Tools.Directories import resolveFilename, SCOPE_PLUGINS, SCOPE_SKIN_IMAGE,
from os import system, listdir, mkdir, chdir, getcwd, rename as os_rename, remove as os_remove, popen
from os.path import dirname, isdir, isdir as os_isdir
from enigma import eTimer
-from Plugins.Extensions.NeoBoot.files.stbbranding import fileCheck, getNeoLocation, getImageNeoBoot, getKernelVersionString, getBoxHostName, getCPUtype, getBoxVuModel, getTunerModel, getCPUSoC, getImageATv, getBoxModelVU
+from Plugins.Extensions.NeoBoot.files.stbbranding import fileCheck, getNeoLocation, getImageNeoBoot, getKernelVersionString, getBoxHostName, getCPUtype, getBoxVuModel, getTunerModel, getCPUSoC, getImageATv, getBoxModelVU
import os
import time
import sys
-import struct, shutil
-if fileExists('/etc/vtiversion.info') or fileExists('/etc/bhversion') or fileExists('/usr/lib/python3.8') and fileExists('/.multinfo'):
- from Screens.Console import Console
+import struct
+import shutil
+if fileExists('/etc/vtiversion.info') or fileExists('/etc/bhversion') or fileExists('/usr/lib/python3.8') and fileExists('/.multinfo'):
+ from Screens.Console import Console
else:
try:
- from Plugins.Extensions.NeoBoot.files.neoconsole import Console
+ from Plugins.Extensions.NeoBoot.files.neoconsole import Console
except:
from Screens.Console import Console
-LinkNeoBoot = '/usr/lib/enigma2/python/Plugins/Extensions/NeoBoot'
-neoboot = getNeoLocation()
+LinkNeoBoot = '/usr/lib/enigma2/python/Plugins/Extensions/NeoBoot'
+neoboot = getNeoLocation()
media = getNeoLocation()
-mediahome = media + '/ImageBoot/'
-
+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
-
+ return desktopSize[0] >= 1920 and desktopSize[0] < 3840
+
def getKernelVersion():
try:
return open('/proc/version', 'r').read().split(' ', 4)[2].split('-', 2)[0]
except:
- return _('unknown')
+ return _('unknown')
+
def getCPUtype():
- cpu='UNKNOWN'
+ cpu = 'UNKNOWN'
if os.path.exists('/proc/cpuinfo'):
with open('/proc/cpuinfo', 'r') as f:
lines = f.read()
f.close()
if lines.find('ARMv7') != -1:
- cpu='ARMv7'
+ cpu = 'ARMv7'
elif lines.find('mips') != -1:
- cpu='MIPS'
+ cpu = 'MIPS'
return cpu
+
if os.path.exists('/etc/hostname'):
with open('/etc/hostname', 'r') as f:
myboxname = f.readline().strip()
- f.close()
-
+ f.close()
+
if os.path.exists('/proc/stb/info/vumodel'):
with open('/proc/stb/info/vumodel', 'r') as f:
vumodel = f.readline().strip()
- f.close()
+ f.close()
if os.path.exists('/proc/stb/info/boxtype'):
with open('/proc/stb/info/boxtype', 'r') as f:
boxtype = f.readline().strip()
- f.close()
+ f.close()
+
class BoundFunction:
__module__ = __name__
@@ -108,19 +116,19 @@ class BoundFunction:
self.args = args
def __call__(self):
- self.fnc(*self.args)
+ self.fnc(*self.args)
class MBTools(Screen):
if isFHD():
- skin = """
+ skin = """
-
+
\n \t\t{"template": [\n \t\t\tMultiContentEntryText(pos = (50, 1), size = (920, 56), flags = RT_HALIGN_LEFT|RT_VALIGN_CENTER, text = 0),\n \t\t\tMultiContentEntryPixmapAlphaTest(pos = (6, 4), size = (66, 66), png = 1),\n \t\t\t],\n \t\t\t"fonts": [gFont("Regular", 35)],\n \t\t\t"itemHeight": 60\n \t\t}\n \t\t
-
+
"""
else:
skin = '\n \n\t\t\n\t\t\t\n \t\t{"template": [\n \t\t\tMultiContentEntryText(pos = (50, 1), size = (520, 36), flags = RT_HALIGN_LEFT|RT_VALIGN_CENTER, text = 0),\n \t\t\tMultiContentEntryPixmapAlphaTest(pos = (4, 2), size = (36, 36), png = 1),\n \t\t\t],\n \t\t\t"fonts": [gFont("Regular", 22)],\n \t\t\t"itemHeight": 36\n \t\t}\n \t\t\n\t\t\n '
@@ -134,101 +142,100 @@ class MBTools(Screen):
self['actions'] = ActionMap(['WizardActions', 'ColorActions'], {'ok': self.KeyOk,
'back': self.close})
- def updateList(self):
+ def updateList(self):
self.list = []
- mypath = '' +LinkNeoBoot+ ''
+ mypath = '' + LinkNeoBoot + ''
if not fileExists(mypath + 'icons'):
- mypixmap = '' +LinkNeoBoot+ '/images/ok.png'
+ mypixmap = '' + LinkNeoBoot + '/images/ok.png'
png = LoadPixmap(mypixmap)
- res = (_ ('Make a copy of the image from NeoBoot'), png, 0)
- self.list.append (res)
- self ['list']. list = self.list
+ res = (_('Make a copy of the image from NeoBoot'), png, 0)
+ self.list.append(res)
+ self['list']. list = self.list
- res = (_ ('Restore a copy of the image to NeoBoot'), png, 1)
- self.list.append (res)
- self ['list']. list = self.list
-
- res = (_ ('Device manager'), png, 2)
- self.list.append (res)
- self ['list']. list = self.list
-
- res = (_ ('Delete image ZIP from the ImagesUpload directory'), png, 3)
- self.list.append (res)
- self ['list']. list = self.list
-
- res = (_ ('NeoBoot Backup'), png, 4)
- self.list.append (res)
- self ['list']. list = self.list
+ res = (_('Restore a copy of the image to NeoBoot'), png, 1)
+ self.list.append(res)
+ self['list']. list = self.list
- res = (_ ('Restore neoboot backup'), png, 5)
- self.list.append (res)
- self ['list']. list = self.list
+ res = (_('Device manager'), png, 2)
+ self.list.append(res)
+ self['list']. list = self.list
- res = (_ ('Uninstall NeoBoot'), png, 6)
- self.list.append (res)
- self ['list']. list = self.list
-
- res = (_ ('Update NeoBoot on all images.'), png, 7)
- self.list.append (res)
- self ['list']. list = self.list
-
- res = (_ ('Update TV list on installed image.'), png, 8)
- self.list.append (res)
- self ['list']. list = self.list
+ res = (_('Delete image ZIP from the ImagesUpload directory'), png, 3)
+ self.list.append(res)
+ self['list']. list = self.list
- res = (_ ('Update IPTVPlayer on installed image.'), png, 9)
- self.list.append (res)
- self ['list']. list = self.list
-
- res = (_ ('Update FeedExtra on the installed image.'), png, 10)
- self.list.append (res)
- self ['list']. list = self.list
+ res = (_('NeoBoot Backup'), png, 4)
+ self.list.append(res)
+ self['list']. list = self.list
- res = (_ ('Removing the root password.'), png, 11)
- self.list.append (res)
- self ['list']. list = self.list
+ res = (_('Restore neoboot backup'), png, 5)
+ self.list.append(res)
+ self['list']. list = self.list
- res = (_ ('Check the correctness of neoboot installation'), png, 12)
- self.list.append (res)
- self ['list']. list = self.list
-
- res = (_ ('Skin change'), png, 13)
- self.list.append (res)
- self ['list']. list = self.list
+ res = (_('Uninstall NeoBoot'), png, 6)
+ self.list.append(res)
+ self['list']. list = self.list
- res = (_ ('Block or unlock skins.'), png, 14)
- self.list.append (res)
- self ['list']. list = self.list
+ res = (_('Update NeoBoot on all images.'), png, 7)
+ self.list.append(res)
+ self['list']. list = self.list
- res = (_ ('Mount Internal Flash'), png, 15)
- self.list.append (res)
- self ['list']. list = self.list
+ res = (_('Update TV list on installed image.'), png, 8)
+ self.list.append(res)
+ self['list']. list = self.list
- res = (_ ('Deleting languages'), png, 16)
- self.list.append (res)
- self ['list']. list = self.list
+ res = (_('Update IPTVPlayer on installed image.'), png, 9)
+ self.list.append(res)
+ self['list']. list = self.list
- res = (_ ('Updates feed cam OpenATV softcam'), png, 17)
- self.list.append (res)
- self ['list']. list = self.list
-
- res = (_ ('Create swap- file.'), png, 18)
- self.list.append (res)
- self ['list']. list = self.list
+ res = (_('Update FeedExtra on the installed image.'), png, 10)
+ self.list.append(res)
+ self['list']. list = self.list
- res = (_ ('Supported sat tuners'), png, 19)
- self.list.append (res)
- self ['list']. list = self.list
+ res = (_('Removing the root password.'), png, 11)
+ self.list.append(res)
+ self['list']. list = self.list
- res = (_ ('NeoBoot Information'), png, 20)
- self.list.append (res)
- self ['list']. list = self.list
-
- res = (_ ('NeoBoot donate'), png, 21)
- self.list.append (res)
- self ['list']. list = self.list
+ res = (_('Check the correctness of neoboot installation'), png, 12)
+ self.list.append(res)
+ self['list']. list = self.list
+ res = (_('Skin change'), png, 13)
+ self.list.append(res)
+ self['list']. list = self.list
+
+ res = (_('Block or unlock skins.'), png, 14)
+ self.list.append(res)
+ self['list']. list = self.list
+
+ res = (_('Mount Internal Flash'), png, 15)
+ self.list.append(res)
+ self['list']. list = self.list
+
+ res = (_('Deleting languages'), png, 16)
+ self.list.append(res)
+ self['list']. list = self.list
+
+ res = (_('Updates feed cam OpenATV softcam'), png, 17)
+ self.list.append(res)
+ self['list']. list = self.list
+
+ res = (_('Create swap- file.'), png, 18)
+ self.list.append(res)
+ self['list']. list = self.list
+
+ res = (_('Supported sat tuners'), png, 19)
+ self.list.append(res)
+ self['list']. list = self.list
+
+ res = (_('NeoBoot Information'), png, 20)
+ self.list.append(res)
+ self['list']. list = self.list
+
+ res = (_('NeoBoot donate'), png, 21)
+ self.list.append(res)
+ self['list']. list = self.list
def KeyOk(self):
self.sel = self['list'].getCurrent()
@@ -244,7 +251,7 @@ class MBTools(Screen):
pass
if self.sel == 4 and self.session.open(BackupMultiboot):
pass
- if self.sel == 5 and self.session.open(ReinstllNeoBoot):
+ if self.sel == 5 and self.session.open(ReinstllNeoBoot):
pass
if self.sel == 6 and self.session.open(UnistallMultiboot):
pass
@@ -256,22 +263,22 @@ class MBTools(Screen):
pass
if self.sel == 10 and self.session.open(FeedExtra):
pass
- if self.sel == 11 and self.session.open(SetPasswd):
+ if self.sel == 11 and self.session.open(SetPasswd):
+ pass
+ if self.sel == 12 and self.session.open(CheckInstall):
pass
- if self.sel == 12 and self.session.open(CheckInstall):
- pass
if self.sel == 13 and self.session.open(SkinChange):
pass
if self.sel == 14 and self.session.open(BlocUnblockImageSkin):
- pass
- if self.sel == 15 and self.session.open(InternalFlash):
pass
- if self.sel == 16 and self.session.open(DeletingLanguages):
+ if self.sel == 15 and self.session.open(InternalFlash):
pass
- if self.sel == 17 and self.session.open(ATVcamfeed):
+ if self.sel == 16 and self.session.open(DeletingLanguages):
+ pass
+ if self.sel == 17 and self.session.open(ATVcamfeed):
+ pass
+ if self.sel == 18 and self.session.open(CreateSwap):
pass
- if self.sel == 18 and self.session.open(CreateSwap):
- pass
if self.sel == 19 and self.session.open(TunerInfo):
pass
if self.sel == 20 and self.session.open(MultiBootMyHelp):
@@ -281,30 +288,30 @@ class MBTools(Screen):
if self.sel == 22 and self.session.open(CheckInternet):
pass
-
+
class MBBackup(Screen):
if isFHD():
- skin = """
-
+ skin = """
+
-
-
-
-
-
-
+
+
+
+
+
+
"""
else:
- skin = """
-
-
-
- \
+ skin = """
+
+
+
+ \
- \n
-
- """
+ \n
+
+ """
def __init__(self, session):
Screen.__init__(self, session)
@@ -319,8 +326,8 @@ class MBBackup(Screen):
if pathExists('/media/usb/ImageBoot'):
neoboot = 'usb'
elif pathExists('/media/hdd/ImageBoot'):
- neoboot = 'hdd'
- self.backupdir = '/media/' + neoboot + '/CopyImageNEO'
+ neoboot = 'hdd'
+ self.backupdir = '/media/' + neoboot + '/CopyImageNEO'
self.availablespace = '0'
self.onShow.append(self.updateInfo)
@@ -328,8 +335,8 @@ class MBBackup(Screen):
if pathExists('/media/usb/ImageBoot'):
neoboot = 'usb'
elif pathExists('/media/hdd/ImageBoot'):
- neoboot = 'hdd'
- device = '/media/' + neoboot + ''
+ neoboot = 'hdd'
+ device = '/media/' + neoboot + ''
usfree = '0'
devicelist = ['cf',
'hdd',
@@ -346,7 +353,7 @@ class MBBackup(Screen):
for line in f.readlines():
if line.find('/hdd') != -1:
self.backupdir = '/media/' + neoboot + '/CopyImageNEO'
- device = '/media/' + neoboot + ''
+ device = '/media/' + neoboot + ''
f.close()
if pathExists(self.backupdir) == 0 and createDir(self.backupdir):
@@ -381,7 +388,7 @@ class MBBackup(Screen):
def backupImage(self):
if not fileExists('/.multinfo'):
- self.backupImage2()
+ self.backupImage2()
else:
self.myClose(_('Sorry, Neoboot can be installed or upgraded only when booted from Flash'))
@@ -395,7 +402,7 @@ class MBBackup(Screen):
if int(self.availablespace) < 150:
myerror = _('There is no space to make a copy of the image. You need 150 Mb of free space for copying the image.')
if myerror == '':
- message = (_('Make copies of the image: %s now ?') % image)
+ message = (_('Make copies of the image: %s now ?') % image)
ybox = self.session.openWithCallback(self.dobackupImage, MessageBox, message, MessageBox.TYPE_YESNO)
ybox.setTitle(_('Backup confirmation'))
else:
@@ -406,7 +413,7 @@ class MBBackup(Screen):
if pathExists('/media/usb/ImageBoot'):
neoboot = 'usb'
elif pathExists('/media/hdd/ImageBoot'):
- neoboot = 'hdd'
+ neoboot = 'hdd'
cmd = "echo -e '\n\n%s '" % _('Please wait, NeoBoot is working, the backup may take a few moments, the process is in progress ...')
cmd1 = '/bin/tar -cf ' + self.backupdir + '/' + self.backimage + '.tar /media/' + neoboot + '/ImageBoot/' + self.backimage + ' > /dev/null 2>&1'
cmd2 = 'mv -f ' + self.backupdir + '/' + self.backimage + '.tar ' + self.backupdir + '/' + self.backimage + '.mb'
@@ -419,39 +426,39 @@ class MBBackup(Screen):
else:
self.close()
-
def myClose(self, message):
- self.session.open(MessageBox, message, MessageBox.TYPE_INFO)
+ self.session.open(MessageBox, message, MessageBox.TYPE_INFO)
self.close()
+
class MBRestore(Screen):
- __module__ = __name__
- skin = """
-
-
-
-
-
-
-
-
+ __module__ = __name__
+ skin = """
+
+
+
+
+
+
+
+
"""
- def __init__(self, session):
+ def __init__(self, session):
Screen.__init__(self, session)
self['lab1'] = Label(_('Choose copy you want to restore or delete.'))
self['key_red'] = Label(_('Delete file'))
self['key_green'] = Label(_('Restore'))
- self['list'] = List([])
+ self['list'] = List([])
self['actions'] = ActionMap(['WizardActions', 'ColorActions'], {'back': self.close,
'ok': self.restoreImage,
'red': self.deleteback,
- 'green': self.restoreImage})
+ 'green': self.restoreImage})
self.backupdir = '' + getNeoLocation() + 'CopyImageNEO'
self.onShow.append(self.updateInfo)
def updateInfo(self):
- linesdevice = open('' +LinkNeoBoot+ '/.location', 'r').readlines()
+ linesdevice = open('' + LinkNeoBoot + '/.location', 'r').readlines()
deviceneo = linesdevice[0][0:-1]
device = deviceneo
usfree = '0'
@@ -476,7 +483,7 @@ class MBRestore(Screen):
self.backupdir = '' + getNeoLocation() + 'CopyImageNEO'
elif line.find('/usb') != -1:
self.backupdir = '' + getNeoLocation() + 'CopyImageNEO'
- f.close()
+ f.close()
if pathExists(self.backupdir) == 0 and createDir(self.backupdir):
pass
if fileExists('/tmp/ninfo.tmp'):
@@ -494,7 +501,7 @@ class MBRestore(Screen):
f.close()
os_remove('/tmp/ninfo.tmp')
-
+
imageslist = []
for fn in listdir(self.backupdir):
imageslist.append(fn)
@@ -503,7 +510,7 @@ class MBRestore(Screen):
def deleteback(self):
if not fileExists('/.multinfo'):
- self.deleteback2()
+ self.deleteback2()
else:
self.myClose(_('Sorry, Neoboot can be installed or upgraded only when booted from Flash'))
@@ -511,7 +518,7 @@ class MBRestore(Screen):
image = self['list'].getCurrent()
if image:
self.delimage = image.strip()
- message = (_('Software selected: %s remove ?') % image )
+ message = (_('Software selected: %s remove ?') % image)
ybox = self.session.openWithCallback(self.dodeleteback, MessageBox, message, MessageBox.TYPE_YESNO)
ybox.setTitle(_('Confirmation of Deletion...'))
@@ -526,7 +533,7 @@ class MBRestore(Screen):
def restoreImage(self):
if not fileExists('/.multinfo'):
- self.restoreImage2()
+ self.restoreImage2()
else:
self.myClose(_('Sorry, Neoboot can be installed or upgraded only when booted from Flash'))
@@ -544,7 +551,7 @@ class MBRestore(Screen):
if curimage == imagename:
myerror = _('Sorry you cannot overwrite the image currently booted from. Please, boot from Flash to restore this backup.')
if myerror == '':
- message = (_('The required space on the device is 300 MB.\nDo you want to take this image: %s \nnow ?') % image)
+ message = (_('The required space on the device is 300 MB.\nDo you want to take this image: %s \nnow ?') % image)
ybox = self.session.openWithCallback(self.dorestoreImage, MessageBox, message, MessageBox.TYPE_YESNO)
ybox.setTitle(_('Restore Confirmation'))
else:
@@ -567,12 +574,13 @@ class MBRestore(Screen):
cmd5])
self.close()
else:
- self.close()
+ self.close()
def myClose(self, message):
- self.session.open(MessageBox, message, MessageBox.TYPE_INFO)
+ self.session.open(MessageBox, message, MessageBox.TYPE_INFO)
self.close()
-
+
+
class MenagerDevices(Screen):
__module__ = __name__
skin = """
@@ -582,9 +590,9 @@ class MenagerDevices(Screen):
"""
def __init__(self, session):
- Screen.__init__(self, session)
- self['lab1'] = Label(_('Start the device manager'))
- self['key_red'] = Label(_('Run'))
+ Screen.__init__(self, session)
+ self['lab1'] = Label(_('Start the device manager'))
+ self['key_red'] = Label(_('Run'))
self['actions'] = ActionMap(['WizardActions', 'ColorActions'], {'back': self.close,
'red': self.MD})
@@ -592,7 +600,7 @@ class MenagerDevices(Screen):
try:
from Plugins.Extensions.NeoBoot.files.devices import ManagerDevice
self.session.open(ManagerDevice)
-
+
except:
False
@@ -620,7 +628,7 @@ class MBDeleUpload(Screen):
def pedeleup(self, answer):
if answer is True:
cmd = "echo -e '\n\n%s '" % _('Wait, deleting .....')
- cmd1 = 'rm -r ' + getNeoLocation() + 'ImagesUpload/*.zip'
+ cmd1 = 'rm -r ' + getNeoLocation() + 'ImagesUpload/*.zip'
self.session.open(Console, _('Deleting downloaded image zip files ....'), [cmd, cmd1])
self.close()
else:
@@ -629,7 +637,7 @@ class MBDeleUpload(Screen):
class BackupMultiboot(Screen):
__module__ = __name__
- skin = """
+ skin = """
\n\t\t{"template": [\n\t\t\tMultiContentEntryText(pos = (50, 1), size = (620, 46), flags = RT_HALIGN_LEFT|RT_VALIGN_CENTER, text = 0),\n\t\t\tMultiContentEntryPixmapAlphaTest(pos = (6, 4), size = (46, 46), png = 1),\n\t\t\t],\n\t\t\t"fonts": [gFont("dugme", 30)],\n\t\t\t"itemHeight": 46\n\t\t}\n\t\t
@@ -651,7 +659,7 @@ class BackupMultiboot(Screen):
'red': self.gobackupneobootplugin})
def gobackupneobootplugin(self):
- cmd = 'sh ' +LinkNeoBoot+ '/files/neobackup.sh -i'
+ cmd = 'sh ' + LinkNeoBoot + '/files/neobackup.sh -i'
self.session.open(Console, _('The backup will be saved to /media/neoboot. Performing ...'), [cmd])
self.close()
@@ -673,12 +681,12 @@ class UnistallMultiboot(Screen):
def usun(self):
if not fileExists('/.multinfo'):
- self.usun2()
+ self.usun2()
else:
self.myClose(_('Sorry, Neoboot can be installed or upgraded only when booted from Flash'))
def myClose(self, message):
- self.session.open(MessageBox, message, MessageBox.TYPE_INFO)
+ self.session.open(MessageBox, message, MessageBox.TYPE_INFO)
self.close()
def usun2(self):
@@ -696,12 +704,12 @@ class UnistallMultiboot(Screen):
cmd3 = 'ln -sfn /sbin/init.sysvinit /sbin/init'
cmd4 = 'chmod 777 /sbin/init; sleep 2'
cmd4a = "echo -e 'NeoBoot restoring media mounts...\n'"
- cmd6 = 'rm -f ' + getNeoLocation() + 'ImageBoot/initneo.log ' + getNeoLocation() + 'ImageBoot/.imagedistro ' + getNeoLocation() + 'ImageBoot/.neonextboot '+ getNeoLocation() + 'ImageBoot/.updateversion '+ getNeoLocation() + 'ImageBoot/.Flash ' + getNeoLocation() + 'ImageBoot/.version ' + getNeoLocation() + 'ImageBoot/NeoInit.log ; sleep 2'
- cmd7 = 'rm -f '+LinkNeoBoot+ '/.location '+LinkNeoBoot+ '/bin/install '+LinkNeoBoot+ '/bin/reading_blkid '+LinkNeoBoot+ '/files/mountpoint.sh '+LinkNeoBoot+ '/files/neo.sh '+LinkNeoBoot+ '/files/neom '+LinkNeoBoot+ '/.neo_info '
+ cmd6 = 'rm -f ' + getNeoLocation() + 'ImageBoot/initneo.log ' + getNeoLocation() + 'ImageBoot/.imagedistro ' + getNeoLocation() + 'ImageBoot/.neonextboot ' + getNeoLocation() + 'ImageBoot/.updateversion ' + getNeoLocation() + 'ImageBoot/.Flash ' + getNeoLocation() + 'ImageBoot/.version ' + getNeoLocation() + 'ImageBoot/NeoInit.log ; sleep 2'
+ cmd7 = 'rm -f ' + LinkNeoBoot + '/.location ' + LinkNeoBoot + '/bin/install ' + LinkNeoBoot + '/bin/reading_blkid ' + LinkNeoBoot + '/files/mountpoint.sh ' + LinkNeoBoot + '/files/neo.sh ' + LinkNeoBoot + '/files/neom ' + LinkNeoBoot + '/.neo_info '
cmd7a = "echo -e '\n\nUninstalling neoboot...\n'"
cmd8 = "echo -e '\n\nRestore mount.'"
cmd9 = "echo -e '\n\nNeoBoot uninstalled, you can do reinstallation.'"
- cmd10 = "echo -e '\n\nNEOBoot Exit or Back - RESTART GUI NOW !!!'"
+ cmd10 = "echo -e '\n\nNEOBoot Exit or Back - RESTART GUI NOW !!!'"
self.session.open(Console, _('NeoBoot is reinstall...'), [cmd0,
cmd,
cmd1,
@@ -715,17 +723,17 @@ class UnistallMultiboot(Screen):
cmd7a,
cmd8,
cmd9,
- cmd10])
+ cmd10])
else:
self.close()
def myClose(self, message):
- self.session.open(MessageBox, message, MessageBox.TYPE_INFO)
+ self.session.open(MessageBox, message, MessageBox.TYPE_INFO)
self.close()
def checkNeo(self):
- if not fileCheck(''+LinkNeoBoot+ '/.location') and not fileCheck(' ' + getNeoLocation() + 'ImageBoot/.neonextboot') :
- self.restareE2()
+ if not fileCheck('' + LinkNeoBoot + '/.location') and not fileCheck(' ' + getNeoLocation() + 'ImageBoot/.neonextboot'):
+ self.restareE2()
else:
self.close()
@@ -747,29 +755,29 @@ class ReinstllNeoBoot(Screen):
self['key_red'] = Label(_('Backup'))
self['actions'] = ActionMap(['WizardActions', 'ColorActions'], {'back': self.close,
'red': self.reinstallMB})
-
+
def reinstallMB(self):
- self.session.open(ReinstllNeoBoot2)
-
+ self.session.open(ReinstllNeoBoot2)
+
class ReinstllNeoBoot2(Screen):
__module__ = __name__
- skin = """
-
-
-
-
-
-
-
-
+ skin = """
+
+
+
+
+
+
+
+
"""
def __init__(self, session):
Screen.__init__(self, session)
self['lab1'] = Label(_('Choose copy you want to restore or delete.'))
self['key_red'] = Label(_('Delete file'))
- self['key_green'] = Label(_('Restore'))
+ self['key_green'] = Label(_('Restore'))
self['list'] = List([])
self['actions'] = ActionMap(['WizardActions', 'ColorActions'], {'back': self.close,
'ok': self.restoreImage,
@@ -782,7 +790,7 @@ class ReinstllNeoBoot2(Screen):
self.backupdir = '' + getNeoLocation() + 'CopyNEOBoot'
if pathExists(self.backupdir) == 0 and createDir(self.backupdir):
pass
-
+
imageslist = []
for fn in listdir(self.backupdir):
imageslist.append(fn)
@@ -793,7 +801,7 @@ class ReinstllNeoBoot2(Screen):
image = self['list'].getCurrent()
if image:
self.delimage = image.strip()
- message = (_('Software selected: %s remove ?') % image )
+ message = (_('Software selected: %s remove ?') % image)
ybox = self.session.openWithCallback(self.dodeleteback, MessageBox, message, MessageBox.TYPE_YESNO)
ybox.setTitle(_('Confirmation of Deletion...'))
@@ -810,14 +818,14 @@ class ReinstllNeoBoot2(Screen):
image = self['list'].getCurrent()
myerror = ''
if myerror == '':
- message = (_('The required space on the device is 300 MB.\nDo you want to take this image: %s \nnow ?') % image)
+ message = (_('The required space on the device is 300 MB.\nDo you want to take this image: %s \nnow ?') % image)
ybox = self.session.openWithCallback(self.dorestoreImage, MessageBox, message, MessageBox.TYPE_YESNO)
ybox.setTitle(_('Restore Confirmation'))
else:
self.session.open(MessageBox, myerror, MessageBox.TYPE_INFO)
def dorestoreImage(self, answer):
- image = self['list'].getCurrent()
+ image = self['list'].getCurrent()
if answer is True:
self.backimage = image.strip()
imagename = self.backimage[0:-3]
@@ -849,14 +857,15 @@ class UpdateNeoBoot(Screen):
def mbupload(self):
if not fileExists('/.multinfo'):
- self.session.open(MyUpgrade2)
+ self.session.open(MyUpgrade2)
else:
self.myClose(_('Sorry, Neoboot can be installed or upgraded only when booted from Flash'))
def myClose(self, message):
- self.session.open(MessageBox, message, MessageBox.TYPE_INFO)
+ self.session.open(MessageBox, message, MessageBox.TYPE_INFO)
self.close()
+
class MyUpgrade2(Screen):
if isFHD():
skin = """
@@ -877,7 +886,7 @@ class MyUpgrade2(Screen):
def updateInfo(self):
periodo = '/usr/lib/periodon'
- testinout = '/usr/lib/enigma2/python/Tools/Testinout.p*'
+ testinout = '/usr/lib/enigma2/python/Tools/Testinout.p*'
self.activityTimer.stop()
f2 = open('%sImageBoot/.neonextboot' % getNeoLocation(), 'r')
mypath2 = f2.readline().strip()
@@ -885,31 +894,31 @@ class MyUpgrade2(Screen):
if mypath2 != 'Flash':
self.myClose(_('Sorry, NeoBoot can installed or upgraded only when booted from Flash STB'))
self.close()
- else:
- for fn in listdir('%sImageBoot' % getNeoLocation() ):
- dirfile = '%sImageBoot/' % getNeoLocation() + fn
+ else:
+ for fn in listdir('%sImageBoot' % getNeoLocation()):
+ dirfile = '%sImageBoot/' % getNeoLocation() + fn
if isdir(dirfile):
- target = dirfile + '' +LinkNeoBoot+ ''
+ target = dirfile + '' + LinkNeoBoot + ''
target1 = dirfile + '/usr/lib/'
- target2 = dirfile + '/usr/lib/enigma2/python/Tools/'
+ target2 = dirfile + '/usr/lib/enigma2/python/Tools/'
cmd = 'rm -r ' + target + ' > /dev/null 2>&1'
system(cmd)
- cmd = 'cp -r ' +LinkNeoBoot+ ' ' + target
+ cmd = 'cp -r ' + LinkNeoBoot + ' ' + target
system(cmd)
- cmd1 = 'cp -rf ' +periodo+ ' ' + target1
+ cmd1 = 'cp -rf ' + periodo + ' ' + target1
system(cmd1)
- cmd2 = 'cp -rf ' +testinout+ ' ' + target2
- system(cmd2)
+ cmd2 = 'cp -rf ' + testinout + ' ' + target2
+ system(cmd2)
- out = open('%sImageBoot/.version' % getNeoLocation(), 'w')
+ out = open('%sImageBoot/.version' % getNeoLocation(), 'w')
out.write(PLUGINVERSION)
out.close()
self.myClose(_('NeoBoot successfully updated. You can restart the plugin now.\nHave fun !!'))
def myClose(self, message):
- self.session.open(MessageBox, message, MessageBox.TYPE_INFO)
- self.close()
-
+ self.session.open(MessageBox, message, MessageBox.TYPE_INFO)
+ self.close()
+
class ListTv(Screen):
__module__ = __name__
@@ -928,7 +937,7 @@ class ListTv(Screen):
def listupload(self):
if not fileExists('/.multinfo'):
- self.listupload2()
+ self.listupload2()
else:
self.myClose(_('Sorry, Neoboot can be installed or upgraded only when booted from Flash'))
@@ -936,7 +945,7 @@ class ListTv(Screen):
self.session.open(ListTv2)
def myClose(self, message):
- self.session.open(MessageBox, message, MessageBox.TYPE_INFO)
+ self.session.open(MessageBox, message, MessageBox.TYPE_INFO)
self.close()
@@ -946,7 +955,7 @@ class ListTv2(Screen):
if isFHD():
skin = """
- """
+ """
else:
skin = '\n\t\t\n\t'
@@ -1013,7 +1022,7 @@ class IPTVPlayer(Screen):
def IPTVPlayerUpload(self):
if not fileExists('/.multinfo'):
- self.IPTVPlayerUpload2()
+ self.IPTVPlayerUpload2()
else:
self.myClose(_('Sorry, Neoboot can be installed or upgraded only when booted from Flash'))
@@ -1021,9 +1030,10 @@ class IPTVPlayer(Screen):
self.session.open(IPTVPlayer2)
def myClose(self, message):
- self.session.open(MessageBox, message, MessageBox.TYPE_INFO)
+ self.session.open(MessageBox, message, MessageBox.TYPE_INFO)
self.close()
+
class IPTVPlayer2(Screen):
__module__ = __name__
@@ -1089,7 +1099,7 @@ class FeedExtra(Screen):
def FeedExtraUpload(self):
if not fileExists('/.multinfo'):
- self.FeedExtraUpload2()
+ self.FeedExtraUpload2()
else:
self.myClose(_('Sorry, Neoboot can be installed or upgraded only when booted from Flash'))
@@ -1097,9 +1107,10 @@ class FeedExtra(Screen):
self.session.open(FeedExtra2)
def myClose(self, message):
- self.session.open(MessageBox, message, MessageBox.TYPE_INFO)
+ self.session.open(MessageBox, message, MessageBox.TYPE_INFO)
self.close()
+
class FeedExtra2(Screen):
__module__ = __name__
@@ -1189,79 +1200,80 @@ class CheckInstall(Screen):
self['key_red'] = Label(_('Start'))
self['actions'] = ActionMap(['WizardActions', 'ColorActions'], {'back': self.close,
'red': self.neocheck})
-
+
def neocheck(self):
if not fileExists('/.multinfo'):
- self.neocheck2()
+ self.neocheck2()
else:
self.myClose(_('Sorry, Neoboot can be installed or upgraded only when booted from Flash'))
def neocheck2(self):
- os.system(_('rm -f ' + LinkNeoBoot + '/files/modulecheck; echo %s - %s > ' +LinkNeoBoot+ '/files/modulecheck') % (getBoxModelVU(), getCPUSoC()) )
- os.system('echo "\n====================================================>\nCheck result:" >> ' + LinkNeoBoot + '/files/modulecheck')
- os.system('echo "* neoboot location:" >> ' +LinkNeoBoot+ '/files/modulecheck; cat "/usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/.location" >> ' +LinkNeoBoot+ '/files/modulecheck')
- os.system('echo "\n* neoboot location install:" >> ' +LinkNeoBoot+ '/files/modulecheck; cat "/usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/bin/install" >> ' +LinkNeoBoot+ '/files/modulecheck')
- os.system('echo "\n* neoboot location mount:" >> ' +LinkNeoBoot+ '/files/modulecheck; cat "/usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/files/neo.sh" >> ' +LinkNeoBoot+ '/files/modulecheck')
+ os.system(_('rm -f ' + LinkNeoBoot + '/files/modulecheck; echo %s - %s > ' + LinkNeoBoot + '/files/modulecheck') % (getBoxModelVU(), getCPUSoC()))
+ os.system('echo "\n====================================================>\nCheck result:" >> ' + LinkNeoBoot + '/files/modulecheck')
+ os.system('echo "* neoboot location:" >> ' + LinkNeoBoot + '/files/modulecheck; cat "/usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/.location" >> ' + LinkNeoBoot + '/files/modulecheck')
+ os.system('echo "\n* neoboot location install:" >> ' + LinkNeoBoot + '/files/modulecheck; cat "/usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/bin/install" >> ' + LinkNeoBoot + '/files/modulecheck')
+ os.system('echo "\n* neoboot location mount:" >> ' + LinkNeoBoot + '/files/modulecheck; cat "/usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/files/neo.sh" >> ' + LinkNeoBoot + '/files/modulecheck')
if getCPUtype() == 'ARMv7' and getCPUtype() != 'MIPS':
if os.system('opkg update; opkg list-installed | grep python-subprocess') != 0:
- os.system('echo "\n* python-subprocess not installed" >> ' +LinkNeoBoot+ '/files/modulecheck')
+ os.system('echo "\n* python-subprocess not installed" >> ' + LinkNeoBoot + '/files/modulecheck')
if os.system('opkg list-installed | grep python-argparse') != 0:
- os.system('echo "* python-argparse not installed" >> ' +LinkNeoBoot+ '/files/modulecheck')
+ os.system('echo "* python-argparse not installed" >> ' + LinkNeoBoot + '/files/modulecheck')
if os.system('opkg list-installed | grep curl') != 0:
- os.system('echo "* curl not installed" >> ' +LinkNeoBoot+ '/files/modulecheck')
- else:
- os.system('echo "\n* opkg packed everything is OK !" >> ' +LinkNeoBoot+ '/files/modulecheck')
+ os.system('echo "* curl not installed" >> ' + LinkNeoBoot + '/files/modulecheck')
+ else:
+ os.system('echo "\n* opkg packed everything is OK !" >> ' + LinkNeoBoot + '/files/modulecheck')
elif getCPUtype() != 'ARMv7' and getCPUtype() == 'MIPS':
if os.system('opkg list-installed | grep kernel-module-nandsim') != 0:
- os.system('echo "\n* kernel-module-nandsim not installed" >> ' +LinkNeoBoot+ '/files/modulecheck')
+ os.system('echo "\n* kernel-module-nandsim not installed" >> ' + LinkNeoBoot + '/files/modulecheck')
if os.system('opkg list-installed | grep mtd-utils-jffs2') != 0:
- os.system('echo "* mtd-utils-jffs2 not installed" >> ' +LinkNeoBoot+ '/files/modulecheck')
+ os.system('echo "* mtd-utils-jffs2 not installed" >> ' + LinkNeoBoot + '/files/modulecheck')
if os.system('opkg list-installed | grep lzo') != 0:
- os.system('echo "* lzo not installed" >> ' +LinkNeoBoot+ '/files/modulecheck')
- if os.system('opkg list-installed | grep python-setuptools') != 0:
- os.system('echo "* python-setuptools not installed" >> ' +LinkNeoBoot+ '/files/modulecheck')
- if os.system('opkg list-installed | grep util-linux-sfdisk') != 0:
- os.system('echo "* util-linux-sfdisk not installed" >> ' +LinkNeoBoot+ '/files/modulecheck')
- if os.system('opkg list-installed | grep packagegroup-base-nfs') != 0:
- os.system('echo "* packagegroup-base-nfs not installed" >> ' +LinkNeoBoot+ '/files/modulecheck')
+ os.system('echo "* lzo not installed" >> ' + LinkNeoBoot + '/files/modulecheck')
+ if os.system('opkg list-installed | grep python-setuptools') != 0:
+ os.system('echo "* python-setuptools not installed" >> ' + LinkNeoBoot + '/files/modulecheck')
+ if os.system('opkg list-installed | grep util-linux-sfdisk') != 0:
+ os.system('echo "* util-linux-sfdisk not installed" >> ' + LinkNeoBoot + '/files/modulecheck')
+ if os.system('opkg list-installed | grep packagegroup-base-nfs') != 0:
+ os.system('echo "* packagegroup-base-nfs not installed" >> ' + LinkNeoBoot + '/files/modulecheck')
if os.system('opkg list-installed | grep ofgwrite') != 0:
- os.system('echo "* ofgwrite not installed" >> ' +LinkNeoBoot+ '/files/modulecheck')
- if os.system('opkg list-installed | grep bzip2') != 0:
- os.system('echo "* bzip2 not installed" >> ' +LinkNeoBoot+ '/files/modulecheck')
+ os.system('echo "* ofgwrite not installed" >> ' + LinkNeoBoot + '/files/modulecheck')
+ if os.system('opkg list-installed | grep bzip2') != 0:
+ os.system('echo "* bzip2 not installed" >> ' + LinkNeoBoot + '/files/modulecheck')
if os.system('opkg list-installed | grep mtd-utils') != 0:
- os.system('echo "* mtd-utils not installed" >> ' +LinkNeoBoot+ '/files/modulecheck')
+ os.system('echo "* mtd-utils not installed" >> ' + LinkNeoBoot + '/files/modulecheck')
if os.system('opkg list-installed | grep mtd-utils-ubifs') != 0:
- os.system('echo "* mtd-utils-ubifs not installed" >> ' +LinkNeoBoot+ '/files/modulecheck')
- else:
- os.system('echo "\n* opkg packed everything is OK !" >> ' +LinkNeoBoot+ '/files/modulecheck')
- else:
- os.system('echo "\n* STB is not ARMv7 or MIPS" >> ' +LinkNeoBoot+ '/files/modulecheck')
+ os.system('echo "* mtd-utils-ubifs not installed" >> ' + LinkNeoBoot + '/files/modulecheck')
+ else:
+ os.system('echo "\n* opkg packed everything is OK !" >> ' + LinkNeoBoot + '/files/modulecheck')
+ else:
+ os.system('echo "\n* STB is not ARMv7 or MIPS" >> ' + LinkNeoBoot + '/files/modulecheck')
- cmd = 'echo "\n<====================================================" >> ' + LinkNeoBoot + '/files/modulecheck; cat ' +LinkNeoBoot+ '/files/modulecheck'
+ cmd = 'echo "\n<====================================================" >> ' + LinkNeoBoot + '/files/modulecheck; cat ' + LinkNeoBoot + '/files/modulecheck'
cmd1 = ''
self.session.openWithCallback(self.close, Console, _('NeoBoot....'), [cmd,
- cmd1])
+ cmd1])
self.close()
def myClose(self, message):
self.session.open(MessageBox, message, MessageBox.TYPE_INFO)
self.close()
+
class SkinChange(Screen):
if isFHD():
skin = """
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
"""
else:
- skin = ' \n\n \n\n \n \n \n\t\t\t\n \n\n\n\n \n\n '
+ skin = ' \n\n \n\n \n \n \n\t\t\t\n \n\n\n\n \n\n '
def __init__(self, session):
Screen.__init__(self, session)
@@ -1274,24 +1286,23 @@ class SkinChange(Screen):
'ok': self.SkinGO,
'red': self.SkinGO,
'9': self.restareE2})
-
+
self.onShow.append(self.updateInfo)
def updateInfo(self):
- self.skindir = '' +LinkNeoBoot+ '/neoskins/'
-
+ self.skindir = '' + LinkNeoBoot + '/neoskins/'
+
if pathExists(self.skindir) == 0 and createDir(self.skindir):
pass
skinlist = ['default']
- for fn in listdir('' +LinkNeoBoot+ '/neoskins'):
- dirfile = '' +LinkNeoBoot+ '/neoskins/' + fn
+ for fn in listdir('' + LinkNeoBoot + '/neoskins'):
+ dirfile = '' + LinkNeoBoot + '/neoskins/' + fn
if os_isdir(dirfile) and skinlist.append(fn):
pass
self['list'].list = skinlist
-
def SkinGO(self):
skin = self['list'].getCurrent()
if skin:
@@ -1310,14 +1321,14 @@ class SkinChange(Screen):
def DefaultSkin(self):
cmd = "echo -e '\n\n%s '" % _('Please wait, NeoBot is working, skin change is progress...')
cmd1 = "echo -e '\n\n%s '" % _('NeoBoot: Complete Skin Change!')
-# cmd2 = 'cp -r ' +LinkNeoBoot+ '/neoskins/default.py ' +LinkNeoBoot+ '/skin.py'
- cmd2 = 'rm -f ' +LinkNeoBoot+ '/usedskin.p*; sleep 2'
- cmd3 = 'ln -sf "neoskins/default.py" "' +LinkNeoBoot+ '/usedskin.py"'
+# cmd2 = 'cp -r ' +LinkNeoBoot+ '/neoskins/default.py ' +LinkNeoBoot+ '/skin.py'
+ cmd2 = 'rm -f ' + LinkNeoBoot + '/usedskin.p*; sleep 2'
+ cmd3 = 'ln -sf "neoskins/default.py" "' + LinkNeoBoot + '/usedskin.py"'
self.session.open(Console, _('NeoBoot Skin Change'), [cmd, cmd1, cmd2, cmd3])
def doSkinChange(self, answer):
if answer is True:
- if isFHD():
+ if isFHD():
if getBoxHostName() == 'vuultimo4k':
system('cp -r ' + LinkNeoBoot + '/images/ultimo4k.png ' + LinkNeoBoot + '/images/box.png')
elif getBoxHostName() == 'vusolo4k':
@@ -1325,7 +1336,7 @@ class SkinChange(Screen):
elif getBoxHostName() == 'vuduo4k':
system('cp -r ' + LinkNeoBoot + '/images/duo4k.png ' + LinkNeoBoot + '/images/box.png')
elif getBoxHostName() == 'vuduo4kse':
- system('cp -r ' + LinkNeoBoot + '/images/duo4k.png ' + LinkNeoBoot + '/images/box.png')
+ system('cp -r ' + LinkNeoBoot + '/images/duo4k.png ' + LinkNeoBoot + '/images/box.png')
elif getBoxHostName() == 'vuuno4k':
system('cp -r ' + LinkNeoBoot + '/images/uno4k.png ' + LinkNeoBoot + '/images/box.png')
elif getBoxHostName() == 'vuuno4kse':
@@ -1333,44 +1344,44 @@ class SkinChange(Screen):
elif getBoxHostName() == 'vuzero4kse':
system('cp -r ' + LinkNeoBoot + '/images/zero4kse.png ' + LinkNeoBoot + '/images/box.png')
elif getBoxHostName() == 'sf4008':
- system('cp -r ' + LinkNeoBoot + '/images/sf4008.png ' + LinkNeoBoot + '/images/box.png')
+ system('cp -r ' + LinkNeoBoot + '/images/sf4008.png ' + LinkNeoBoot + '/images/box.png')
elif getBoxHostName() == 'ustym4kpro':
- system('cp -r ' + LinkNeoBoot + '/images/ustym4kpro.png ' + LinkNeoBoot + '/images/box.png')
- elif getBoxHostName() == 'h7' or getBoxHostName() == 'zgemmah7' :
+ system('cp -r ' + LinkNeoBoot + '/images/ustym4kpro.png ' + LinkNeoBoot + '/images/box.png')
+ elif getBoxHostName() == 'h7' or getBoxHostName() == 'zgemmah7':
system('cp -r ' + LinkNeoBoot + '/images/zgmmah7.png ' + LinkNeoBoot + '/images/box.png')
elif getBoxHostName() == 'vusolo2':
system('cp -r ' + LinkNeoBoot + '/images/solo2.png ' + LinkNeoBoot + '/images/box.png')
-
+
cmd = "echo -e '\n\n%s '" % _('Please wait, NeoBot is working, skin change is progress...')
- cmd1 = 'rm -f ' +LinkNeoBoot+ '/usedskin.p*; sleep 2'
- cmd2 = 'sleep 2; cp -r ' + self.skindir + '/' + self.selectedskin + '/*.py ' +LinkNeoBoot+ '/usedskin.py'
- cmd3 = "echo -e '\n\n%s '" % _('NeoBoot: Complete Skin Change!')
- cmd4 = "echo -e '\n\n%s '" % _('To use the new skin please restart enigma2')
+ cmd1 = 'rm -f ' + LinkNeoBoot + '/usedskin.p*; sleep 2'
+ cmd2 = 'sleep 2; cp -r ' + self.skindir + '/' + self.selectedskin + '/*.py ' + LinkNeoBoot + '/usedskin.py'
+ cmd3 = "echo -e '\n\n%s '" % _('NeoBoot: Complete Skin Change!')
+ cmd4 = "echo -e '\n\n%s '" % _('To use the new skin please restart enigma2')
self.session.open(Console, _('NeoBoot Skin Change'), [cmd, cmd1, cmd2, cmd3, cmd4])
elif isHD():
cmd = "echo -e '\n\n%s '" % _('Please wait, NeoBot is working, skin change is progress...')
- cmd1 = 'rm -f ' +LinkNeoBoot+ '/usedskin.p*; sleep 2'
- cmd2 = 'sleep 2; cp -r ' + self.skindir + '/' + self.selectedskin + '/*.py ' +LinkNeoBoot+ '/usedskin.py'
+ cmd1 = 'rm -f ' + LinkNeoBoot + '/usedskin.p*; sleep 2'
+ cmd2 = 'sleep 2; cp -r ' + self.skindir + '/' + self.selectedskin + '/*.py ' + LinkNeoBoot + '/usedskin.py'
cmd3 = "echo -e '\n\n%s '" % _('NeoBoot: Complete Skin Change!')
- cmd4 = "echo -e '\n\n%s '" % _('Skin change available only for full hd skin.')
- cmd5 = "echo -e '\n\n%s '" % _('Please come back to default skin.')
- cmd6 = "echo -e '\n\n%s '" % _('To use the new skin please restart enigma2')
+ cmd4 = "echo -e '\n\n%s '" % _('Skin change available only for full hd skin.')
+ cmd5 = "echo -e '\n\n%s '" % _('Please come back to default skin.')
+ cmd6 = "echo -e '\n\n%s '" % _('To use the new skin please restart enigma2')
self.session.open(Console, _('NeoBoot Skin Change'), [cmd, cmd1, cmd2, cmd3, cmd4, cmd5, cmd6])
-
+
else:
self.close()
def checkimageskin(self):
- if fileCheck('/etc/vtiversion.info'):
-# fail = '/usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/usedskin.py'
+ if fileCheck('/etc/vtiversion.info'):
+# fail = '/usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/usedskin.py'
# f = open(fail, 'r')
# content = f.read()
-# f.close()
+# f.close()
# localfile2 = '/usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/usedskin.py'
# temp_file2 = open(localfile2, 'w')
# temp_file2.write(content.replace('selektor.png', 'slekvti.png'))
-# temp_file2.close()
- self.restareE2()
+# temp_file2.close()
+ self.restareE2()
else:
self.restareE2()
@@ -1378,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)
@@ -1388,22 +1398,22 @@ class SkinChange(Screen):
class BlocUnblockImageSkin(Screen):
__module__ = __name__
- skin = """
-
-
-
-
-
-
+ skin = """
+
+
+
+
+
+
"""
def __init__(self, session):
Screen.__init__(self, session)
- self['lab1'] = Label(_('Block or unblock the neoboot skin display in the system skin.'))
- self['key_red'] = Label(_('Block or unlock skins.'))
+ self['lab1'] = Label(_('Block or unblock the neoboot skin display in the system skin.'))
+ self['key_red'] = Label(_('Block or unlock skins.'))
self['list'] = List([])
self['actions'] = ActionMap(['WizardActions', 'ColorActions'], {'back': self.restareE2,
- 'red': self.deleteback})
+ 'red': self.deleteback})
self.backupdir = '/usr/share/enigma2'
self.onShow.append(self.updateInfo)
@@ -1411,7 +1421,7 @@ class BlocUnblockImageSkin(Screen):
self.backupdir = '/usr/share/enigma2'
if pathExists(self.backupdir) == 0 and createDir(self.backupdir):
pass
-
+
imageslist = []
for fn in listdir(self.backupdir):
imageslist.append(fn)
@@ -1422,7 +1432,7 @@ class BlocUnblockImageSkin(Screen):
image = self['list'].getCurrent()
self.delimage = image.strip()
if fileExists(self.backupdir + '/' + self.delimage + '/skin.xml'):
- self.deleteback2()
+ self.deleteback2()
else:
self.myClose(_('Sorry, not find skin neoboot.'))
@@ -1430,30 +1440,29 @@ class BlocUnblockImageSkin(Screen):
image = self['list'].getCurrent()
if image:
self.delimage = image.strip()
- message = (_('Select Yes to lock or No to unlock.\n %s ?') % image )
+ message = (_('Select Yes to lock or No to unlock.\n %s ?') % image)
ybox = self.session.openWithCallback(self.Block_Unlock_Skin, MessageBox, message, MessageBox.TYPE_YESNO)
ybox.setTitle(_('Confirmation...'))
def Block_Unlock_Skin(self, answer):
- if answer is True:
+ if answer is True:
fail = self.backupdir + '/' + self.delimage + '/skin.xml'
f = open(fail, 'r')
content = f.read()
- f.close()
- localfile2 = self.backupdir + '/' + self.delimage + '/skin.xml'
+ f.close()
+ localfile2 = self.backupdir + '/' + self.delimage + '/skin.xml'
temp_file2 = open(localfile2, 'w')
temp_file2.write(content.replace('NeoBootImageChoose', 'neoBootImageChoose'))
- temp_file2.close()
- else:
+ temp_file2.close()
+ else:
fail = self.backupdir + '/' + self.delimage + '/skin.xml'
f = open(fail, 'r')
content = f.read()
- f.close()
- localfile2 = self.backupdir + '/' + self.delimage + '/skin.xml'
+ f.close()
+ localfile2 = self.backupdir + '/' + self.delimage + '/skin.xml'
temp_file2 = open(localfile2, 'w')
temp_file2.write(content.replace('neoBootImageChoose', 'NeoBootImageChoose'))
- temp_file2.close()
-
+ 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)
@@ -1466,7 +1475,7 @@ class BlocUnblockImageSkin(Screen):
self.close()
def myClose(self, message):
- self.session.open(MessageBox, message, MessageBox.TYPE_INFO)
+ self.session.open(MessageBox, message, MessageBox.TYPE_INFO)
self.close()
@@ -1484,64 +1493,64 @@ class InternalFlash(Screen):
self['key_red'] = Label(_('Start - Red'))
self['actions'] = ActionMap(['WizardActions', 'ColorActions'], {'back': self.close,
'red': self.mountIF})
-
+
def mountIF(self):
if fileExists('/.multinfo') and getCPUtype() != 'MIPS':
- self.mountinternalflash()
+ self.mountinternalflash()
else:
self.myClose(_('Sorry, the operation is not possible from Flash or not supported.'))
self.close()
def mountinternalflash(self):
- if fileExists('/.multinfo') and getCPUtype() == 'ARMv7':
+ if fileExists('/.multinfo') and getCPUtype() == 'ARMv7':
if os.path.exists('/proc/stb/info/boxtype'):
- if getBoxHostName == 'sf4008': #getCPUSoC() == 'bcm7251'
- os.system('mkdir -p /media/InternalFlash; mount /dev/mmcblk0p4 /media/InternalFlash')
+ if getBoxHostName == 'sf4008': #getCPUSoC() == 'bcm7251'
+ os.system('mkdir -p /media/InternalFlash; mount /dev/mmcblk0p4 /media/InternalFlash')
if os.path.exists('/proc/stb/info/boxtype'):
- if getBoxHostName == 'et1x000': #getCPUSoC() == 'bcm7251' or
- os.system('mkdir -p /media/InternalFlash; mount /dev/mmcblk0p4 /media/InternalFlash')
+ if getBoxHostName == 'et1x000': #getCPUSoC() == 'bcm7251' or
+ os.system('mkdir -p /media/InternalFlash; mount /dev/mmcblk0p4 /media/InternalFlash')
if os.path.exists('/proc/stb/info/boxtype'):
- if getBoxHostName == 'ax51': #getCPUSoC() == 'bcm7251s' or
- os.system('mkdir -p /media/InternalFlash; mount /dev/mmcblk0p4 /media/InternalFlash')
+ if getBoxHostName == 'ax51': #getCPUSoC() == 'bcm7251s' or
+ os.system('mkdir -p /media/InternalFlash; mount /dev/mmcblk0p4 /media/InternalFlash')
if os.path.exists('/proc/stb/info/boxtype'):
- if getCPUSoC() == 'bcm7251s' or getBoxHostName() == 'h7' or getBoxHostName() == 'zgemmah7' :
+ if getCPUSoC() == 'bcm7251s' or getBoxHostName() == 'h7' or getBoxHostName() == 'zgemmah7':
os.system('mkdir -p /media/InternalFlash; mount /dev/mmcblk0p3 /media/InternalFlash')
if os.path.exists('/proc/stb/info/boxtype'):
- if getBoxHostName() == 'zgemmah9s':
+ if getBoxHostName() == 'zgemmah9s':
os.system('mkdir -p /media/InternalFlash; mount /dev/mmcblk0p7 /media/InternalFlash')
-
+
# if os.path.exists('/proc/stb/info/boxtype'):
-# if getBoxHostName() == 'zgemmah9combo':
-# os.system('mkdir -p /media/InternalFlash; mount /dev/mmcblk0p7 /media/InternalFlash')
+# if getBoxHostName() == 'zgemmah9combo':
+# os.system('mkdir -p /media/InternalFlash; mount /dev/mmcblk0p7 /media/InternalFlash')
- if getBoxHostName == 'sf8008':
- os.system('mkdir -p /media/InternalFlash; mount /dev/mmcblk0p13 /media/InternalFlash')
+ if getBoxHostName == 'sf8008':
+ os.system('mkdir -p /media/InternalFlash; mount /dev/mmcblk0p13 /media/InternalFlash')
- if getBoxHostName == 'ax60':
+ if getBoxHostName == 'ax60':
os.system('mkdir -p /media/InternalFlash; mount /dev/mmcblk0p21 /media/InternalFlash')
- if getBoxHostName() == 'ustym4kpro' or getTunerModel() == 'ustym4kpro':
+ if getBoxHostName() == 'ustym4kpro' or getTunerModel() == 'ustym4kpro':
os.system('mkdir -p /media/InternalFlash; mount /dev/mmcblk0p13 /media/InternalFlash')
if os.path.exists('/proc/stb/info/model'):
- if getTunerModel() == 'dm900' or getCPUSoC() == 'BCM97252SSFF':
+ if getTunerModel() == 'dm900' or getCPUSoC() == 'BCM97252SSFF':
os.system('mkdir -p /media/InternalFlash; mount /dev/mmcblk0p2 /media/InternalFlash')
-
- if getBoxVuModel() == 'uno4kse' or getBoxVuModel() == 'uno4k' or getBoxVuModel() == 'ultimo4k' or getBoxVuModel() == 'solo4k':
+
+ if getBoxVuModel() == 'uno4kse' or getBoxVuModel() == 'uno4k' or getBoxVuModel() == 'ultimo4k' or getBoxVuModel() == 'solo4k':
os.system('mkdir -p /media/InternalFlash; mount /dev/mmcblk0p4 /media/InternalFlash')
- if getBoxVuModel() == 'zero4k':
+ if getBoxVuModel() == 'zero4k':
os.system('mkdir -p /media/InternalFlash; mount /dev/mmcblk0p7 /media/InternalFlash')
- if getBoxVuModel() == 'duo4k':
+ if getBoxVuModel() == 'duo4k':
os.system('mkdir -p /media/InternalFlash; mount /dev/mmcblk0p9 /media/InternalFlash')
- if getBoxVuModel() == 'duo4kse':
- os.system('mkdir -p /media/InternalFlash; mount /dev/mmcblk0p9 /media/InternalFlash')
+ if getBoxVuModel() == 'duo4kse':
+ os.system('mkdir -p /media/InternalFlash; mount /dev/mmcblk0p9 /media/InternalFlash')
if getCPUSoC() == 'bcm7252s' or getBoxHostName() == 'gbquad4k':
os.system('mkdir -p /media/InternalFlash; mount /dev/mmcblk0p5 /media/InternalFlash')
@@ -1562,26 +1571,25 @@ class InternalFlash(Screen):
self.close()
-
class DeletingLanguages(Screen):
__module__ = __name__
- skin = """
-
-
-
-
-
-
+ skin = """
+
+
+
+
+
+
"""
def __init__(self, session):
Screen.__init__(self, session)
self['lab1'] = Label(_('Select to delete.'))
- self['key_red'] = Label(_('Delete file'))
+ self['key_red'] = Label(_('Delete file'))
self['list'] = List([])
self['actions'] = ActionMap(['WizardActions', 'ColorActions'], {'back': self.close,
'ok': self.deleteback,
- 'red': self.deleteback})
+ 'red': self.deleteback})
self.backupdir = '/usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/locale'
self.onShow.append(self.updateInfo)
@@ -1589,7 +1597,7 @@ class DeletingLanguages(Screen):
self.backupdir = '/usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/locale'
if pathExists(self.backupdir) == 0 and createDir(self.backupdir):
pass
-
+
imageslist = []
for fn in listdir(self.backupdir):
imageslist.append(fn)
@@ -1600,7 +1608,7 @@ class DeletingLanguages(Screen):
image = self['list'].getCurrent()
if image:
self.delimage = image.strip()
- message = (_('File: %s remove ?') % image )
+ message = (_('File: %s remove ?') % image)
ybox = self.session.openWithCallback(self.dodeleteback, MessageBox, message, MessageBox.TYPE_YESNO)
ybox.setTitle(_('Confirmation of Deletion...'))
@@ -1630,19 +1638,19 @@ class ATVcamfeed(Screen):
'red': self.addcamatv})
def addcamatv(self):
- if getImageATv() == 'okfeedCAMatv':
+ if getImageATv() == 'okfeedCAMatv':
cmd = "echo -e '\n\n%s '" % _('NeoBoot - ATV add cam feed ...')
- cmd1 = 'wget -O - -q http://updates.mynonpublic.com/oea/feed | bash'
+ cmd1 = 'wget -O - -q http://updates.mynonpublic.com/oea/feed | bash'
self.session.open(Console, _('NeoBoot: Cams feed add...'), [cmd, cmd1])
- elif getImageATv() != 'okfeedCAMatv':
+ elif getImageATv() != 'okfeedCAMatv':
self.myClose(_('Sorry, is not image Open ATV !!!'))
def myClose(self, message):
self.session.open(MessageBox, message, MessageBox.TYPE_INFO)
self.close()
-
-
+
+
class TunerInfo(Screen):
__module__ = __name__
skin = """
@@ -1657,19 +1665,20 @@ class TunerInfo(Screen):
self['key_red'] = Label(_('Start - Red'))
self['actions'] = ActionMap(['WizardActions', 'ColorActions'], {'back': self.close,
'red': self.iNFO})
-
+
def iNFO(self):
try:
- cmd = ' cat ' +LinkNeoBoot+ '/stbinfo.cfg'
+ cmd = ' cat ' + LinkNeoBoot + '/stbinfo.cfg'
cmd1 = ''
self.session.openWithCallback(self.close, Console, _('NeoBoot....'), [cmd,
- cmd1])
+ cmd1])
self.close()
except:
False
-
-class CreateSwap(Screen):
+
+
+class CreateSwap(Screen):
__module__ = __name__
skin = """
@@ -1683,54 +1692,55 @@ class CreateSwap(Screen):
self['key_red'] = Label(_('Start create file swap.'))
self['actions'] = ActionMap(['WizardActions', 'ColorActions'], {'back': self.close,
'red': self.CreateSwap})
-
+
def CreateSwap(self):
if os.path.exists('/media/hdd/ImageBoot/.neonextboot'):
if not os.path.exists('/media/hdd/swapfile'):
- cmd0 = "echo -e '\n\n%s '" % _('Creation swap 512MB, please wait...')
+ cmd0 = "echo -e '\n\n%s '" % _('Creation swap 512MB, please wait...')
cmd1 = 'dd if=/dev/zero of=/media/hdd/swapfile bs=1024 count=524288'
cmd2 = 'mkswap /media/hdd/swapfile'
- cmd3 = 'swapon /media/hdd/swapfile'
- cmd4 = 'echo "/media/hdd/swapfile swap swap defaults 0 0 " >> /etc/fstab'
+ cmd3 = 'swapon /media/hdd/swapfile'
+ cmd4 = 'echo "/media/hdd/swapfile swap swap defaults 0 0 " >> /etc/fstab'
cmd5 = 'echo "/sbin/swapon /hdd/swapfile; swapon -a " > /etc/init.d/rcS.local'
- cmd6 = 'chmod 755 /etc/init.d/rcS.local; chmod 755 /media/hdd/swapfile; /sbin/swapon /hdd/swapfile'
- cmd7 = "echo -e '\n\n%s '" % _('Creation complete swap 512MB')
- self.session.open(Console, _('NeoBoot....'), [cmd0,
- cmd1,
- cmd2,
- cmd3,
- cmd4,
- cmd5,
- cmd6,
- cmd7])
+ cmd6 = 'chmod 755 /etc/init.d/rcS.local; chmod 755 /media/hdd/swapfile; /sbin/swapon /hdd/swapfile'
+ cmd7 = "echo -e '\n\n%s '" % _('Creation complete swap 512MB')
+ self.session.open(Console, _('NeoBoot....'), [cmd0,
+ cmd1,
+ cmd2,
+ cmd3,
+ cmd4,
+ cmd5,
+ cmd6,
+ cmd7])
else:
- self.myClose(_('The file swapfile already exists!'))
- elif os.path.exists('/media/usb/ImageBoot/.neonextboot'):
+ self.myClose(_('The file swapfile already exists!'))
+ elif os.path.exists('/media/usb/ImageBoot/.neonextboot'):
if not os.path.exists('/media/usb/swapfile'):
- cmd0 = "echo -e '\n\n%s '" % _('Creation swap 512MB, please wait...')
+ cmd0 = "echo -e '\n\n%s '" % _('Creation swap 512MB, please wait...')
cmd1 = 'dd if=/dev/zero of=/media/usb/swapfile bs=1024 count=524288'
cmd2 = 'mkswap /media/usb/swapfile'
- cmd3 = 'swapon /media/usb/swapfile'
- cmd4 = 'echo "/media/usb/swapfile swap swap defaults 0 0 " >> /etc/fstab'
+ cmd3 = 'swapon /media/usb/swapfile'
+ cmd4 = 'echo "/media/usb/swapfile swap swap defaults 0 0 " >> /etc/fstab'
cmd5 = 'echo "/sbin/swapon /usb/swapfile; swapon -a " > /etc/init.d/rcS.local'
- cmd6 = 'chmod 755 /etc/init.d/rcS.local; chmod 755 /media/usb/swapfile; /sbin/swapon /usb/swapfile'
- cmd7 = "echo -e '\n\n%s '" % _('Creation complete swap 512MB')
- self.session.open(Console, _('NeoBoot....'), [cmd0,
- cmd1,
- cmd2,
- cmd3,
- cmd4,
- cmd5,
- cmd6,
- cmd7])
- else:
+ cmd6 = 'chmod 755 /etc/init.d/rcS.local; chmod 755 /media/usb/swapfile; /sbin/swapon /usb/swapfile'
+ cmd7 = "echo -e '\n\n%s '" % _('Creation complete swap 512MB')
+ self.session.open(Console, _('NeoBoot....'), [cmd0,
+ cmd1,
+ cmd2,
+ cmd3,
+ cmd4,
+ cmd5,
+ cmd6,
+ cmd7])
+ else:
self.myClose(_('The file swapfile already exists!'))
- else:
+ else:
self.myClose(_('The folder hdd or usb not exists!'))
def myClose(self, message):
self.session.open(MessageBox, message, MessageBox.TYPE_INFO)
- self.close()
+ self.close()
+
class MultiBootMyHelp(Screen):
if isFHD():
@@ -1763,7 +1773,7 @@ class MultiBootMyHelp(Screen):
message += 'ubi_reader by Jason Pruitt - Thanks\n\n'
message += 'Translation by gutosie and other people!\n\n'
message += _('Thank you to everyone not here for helping to improve NeoBoot \n\n')
- message += _('Successful fun :)\n\n')
+ message += _('Successful fun :)\n\n')
self['lab1'].show()
self['lab1'].setText(message)
@@ -1782,7 +1792,7 @@ class MyHelpNeo(Screen):
__module__ = __name__
- def __init__(self, session):
+ def __init__(self, session):
Screen.__init__(self, session)
self['lab1'] = ScrollLabel('')
self['actions'] = ActionMap(['WizardActions', 'ColorActions', 'DirectionActions'], {'back': self.close,
@@ -1794,7 +1804,7 @@ class MyHelpNeo(Screen):
self['lab1'].hide()
self.updatetext()
- def updatetext(self):
+ def updatetext(self):
message = _('NeoBoot Ver. ' + PLUGINVERSION + ' Enigma2\n\nDuring the entire installation process does not restart the receiver !!!\n\n')
message += _('NeoBoot Ver. updates ' + UPDATEVERSION + ' \n\n')
message = _('For proper operation NeoBota type device is required USB stick or HDD, formatted on your system files Linux ext3 or ext4..\n\n')
@@ -1804,8 +1814,8 @@ class MyHelpNeo(Screen):
message += _('4. Install the needed packages...\n\n')
message += _('5. For proper installation NenoBota receiver must be connected to the Internet.\n\n')
message += _('6. In the event of a problem with the installation cancel and inform the author of the plug of a problem.\n\n')
- message += _('Buy a satellite tuner in the store: http://www.expert-tvsat.com/\n')
- message += _('Have fun !!!')
+ message += _('Buy a satellite tuner in the store: http://www.expert-tvsat.com/\n')
+ message += _('Have fun !!!')
self['lab1'].show()
self['lab1'].setText(message)
@@ -1819,11 +1829,11 @@ class Opis(Screen):
-
+
-
+
- """
+ """
else:
skin = """
@@ -1838,14 +1848,15 @@ class Opis(Screen):
"""
__module__ = __name__
- def __init__(self, session):
+
+ def __init__(self, session):
Screen.__init__(self, session)
self['key_red'] = Label(_('Remove NeoBoot of STB'))
self['key_green'] = Label(_('Instal neoobot from github'))
self['lab1'] = ScrollLabel('')
self['actions'] = ActionMap(['WizardActions', 'ColorActions', 'DirectionActions'], {'back': self.close,
'red': self.delete,
- 'green': self.neoinstallgithub,
+ 'green': self.neoinstallgithub,
'ok': self.close,
'up': self['lab1'].pageUp,
'left': self['lab1'].pageUp,
@@ -1854,24 +1865,23 @@ class Opis(Screen):
self['lab1'].hide()
self.updatetext()
-
- def updatetext(self):
+ def updatetext(self):
message = _('\\ NeoBoot Ver. ' + PLUGINVERSION + ' - NeoBoot Ver. updates ' + UPDATEVERSION + '//\n\n')
message += _('\----------NEOBOOT - VIP FULL VERSION----------/\n')
- message += _('Get the full version of the multiboot plugin.\n')
- message += _('Send an e-mail request for the neoboot vip version.\n')
+ message += _('Get the full version of the multiboot plugin.\n')
+ message += _('Send an e-mail request for the neoboot vip version.\n')
message += _('e-mail: krzysztofgutosie@gmail.com\n\n')
message += _('----------------Free donate----------------\n')
- message += _('Spendenbetrag\nDonaco\nDarowizna\nПожертвование\n')
- message += _('Donate to the project\n')
+ message += _('Spendenbetrag\nDonaco\nDarowizna\nПожертвование\n')
+ message += _('Donate to the project\n')
message += _('- Access to the latest version\n')
message += _('- Online support\n')
- message += _('- Full version\n')
+ message += _('- Full version\n')
message += _('- More information email\n')
message += _('We thank you for any help\n')
message += _('If you want to support the neoboot project, you can do so by contacting us by e-mail:\n')
message += _(' krzysztofgutosie@gmail.com\n\n')
- message += _(' PayPal adress: krzysztofgutosie@gmail.com\n')
+ message += _(' PayPal adress: krzysztofgutosie@gmail.com\n')
message += _('---------------- ¯\_(ツ)_/¯ ----------------\n\n')
message += _('1. Requirements: For proper operation of the device NeoBota are required USB stick or HDD.\n\n')
message += _('2. NeoBot is fully automated\n\n')
@@ -1881,68 +1891,69 @@ class Opis(Screen):
message += _('6. The installed to multiboot images, it is not indicated update to a newer version.\n\n')
message += _('The authors plug NeoBot not liable for damage a receiver, NeoBoota incorrect use or installation of unauthorized additions or images.!!!\n\n')
message += _('\nCompletely uninstall NeoBota: \nIf you think NeoBot not you need it, you can uninstall it.\nTo uninstall now press the red button on the remote control.\n\n')
- message += _('Have fun !!!')
+ message += _('Have fun !!!')
self['lab1'].show()
self['lab1'].setText(message)
- def neoinstallgithub(self):
+ def neoinstallgithub(self):
message = _('Are you sure you want to reinstall neoboot from github.')
ybox = self.session.openWithCallback(self.neogithub, MessageBox, message, MessageBox.TYPE_YESNO)
ybox.setTitle(_('Install.'))
- def neogithub(self, answer):
- if answer is True:
- if fileExists('' + LinkNeoBoot + '/.location'):
- system('rm -f ' + LinkNeoBoot + '/.location')
- if fileExists('/usr/bin/curl'):
+ def neogithub(self, answer):
+ if answer is True:
+ if fileExists('' + LinkNeoBoot + '/.location'):
+ system('rm -f ' + LinkNeoBoot + '/.location')
+ if fileExists('/usr/bin/curl'):
cmd1 = 'rm -f /usr/lib/periodon/.kodn; curl -kLs https://raw.githubusercontent.com/gutosie/neoboot/master/iNB.sh|sh'
self.session.open(Console, _('NeoBoot....'), [cmd1])
self.close()
- elif fileExists('/usr/bin/wget'):
+ elif fileExists('/usr/bin/wget'):
cmd1 = 'rm -f /usr/lib/periodon/.kodn; cd /tmp; rm ./*.sh; wget --no-check-certificate https://raw.githubusercontent.com/gutosie/neoboot/master/iNB.sh;chmod 755 ./iNB.sh;sh ./iNB.sh; rm ./iNB.sh; cd /'
self.session.open(Console, _('NeoBoot....'), [cmd1])
- self.close()
- elif fileExists('/usr/bin/fullwget'):
+ self.close()
+ elif fileExists('/usr/bin/fullwget'):
cmd1 = 'rm -f /usr/lib/periodon/.kodn; cd /tmp; rm ./*.sh; fullwget --no-check-certificate https://raw.githubusercontent.com/gutosie/neoboot/master/iNB.sh;chmod 755 ./iNB.sh;sh ./iNB.sh; rm ./iNB.sh; cd /'
self.session.open(Console, _('NeoBoot....'), [cmd1])
- self.close()
+ self.close()
else:
pass
else:
- self.close()
+ self.close()
- def delete(self):
+ def delete(self):
message = _('Are you sure you want to completely remove NeoBoota of your image?\n\nIf you choose so all directories NeoBoota will be removed.\nA restore the original image settings Flash.')
ybox = self.session.openWithCallback(self.mbdelete, MessageBox, message, MessageBox.TYPE_YESNO)
ybox.setTitle(_('Removed successfully.'))
- def mbdelete(self, answer):
- if answer is True:
+ def mbdelete(self, answer):
+ if answer is True:
if fileExists('/etc/fstab.org'):
- system('rm -r /etc/fstab; mv /etc/fstab.org /etc/fstab')
+ system('rm -r /etc/fstab; mv /etc/fstab.org /etc/fstab')
if fileExists('/etc/init.d/volatile-media.sh.org'):
- system(' mv /etc/init.d/volatile-media.sh.org /etc/init.d/volatile-media.sh; rm -r /etc/init.d/volatile-media.sh.org; chmod 755 /etc/init.d/volatile-media.sh ')
- if os.path.isfile('%sImageBoot/.neonextboot' % 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 ' % getNeoLocation()):
+ system(' mv /etc/init.d/volatile-media.sh.org /etc/init.d/volatile-media.sh; rm -r /etc/init.d/volatile-media.sh.org; chmod 755 /etc/init.d/volatile-media.sh ')
+ if os.path.isfile('%sImageBoot/.neonextboot' % 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 ' % getNeoLocation()):
os.system('rm -r %sImagesUpload/.kernel' % getNeoLocation())
cmd = "echo -e '\n\n%s '" % _('Recovering setting....\n')
- cmd1 = 'rm -R ' + LinkNeoBoot + ''
- cmd2 = 'rm -R /sbin/neoinit*'
- cmd3 = 'ln -sfn /sbin/init.sysvinit /sbin/init'
- cmd4 = 'rm -rf /usr/lib/enigma2/python/Tools/Testinout.p*'
+ cmd1 = 'rm -R ' + LinkNeoBoot + ''
+ cmd2 = 'rm -R /sbin/neoinit*'
+ cmd3 = 'ln -sfn /sbin/init.sysvinit /sbin/init'
+ cmd4 = 'rm -rf /usr/lib/enigma2/python/Tools/Testinout.p*'
cmd5 = 'rm -rf /usr/lib/periodon'
- cmd6 = 'opkg install --force-maintainer --force-reinstall --force-overwrite --force-downgrade volatile-media; sleep 10; PATH=/sbin:/bin:/usr/sbin:/usr/bin; echo -n "Rebooting... "; reboot -d -f'
+ cmd6 = 'opkg install --force-maintainer --force-reinstall --force-overwrite --force-downgrade volatile-media; sleep 10; PATH=/sbin:/bin:/usr/sbin:/usr/bin; echo -n "Rebooting... "; reboot -d -f'
self.session.open(Console, _('NeoBot was removed !!! \nThe changes will be visible only after complete restart of the receiver.'), [cmd,
cmd1,
cmd2,
cmd3,
cmd4,
- cmd5,
+ cmd5,
cmd6])
self.close()
else:
- self.close()
+ self.close()
+
class ReinstallKernel(Screen):
__module__ = __name__
@@ -1951,7 +1962,7 @@ class ReinstallKernel(Screen):
- """
+ """
def __init__(self, session):
Screen.__init__(self, session)
@@ -1963,7 +1974,7 @@ class ReinstallKernel(Screen):
def InfoCheck(self):
if fileExists('/.multinfo'):
if getCPUtype() == 'MIPS':
- if not fileExists( '/boot/' + getBoxHostName() + '.vmlinux.gz'):
+ if not fileExists('/boot/' + getBoxHostName() + '.vmlinux.gz'):
mess = _('Update available only from the image Flash.')
self.session.open(MessageBox, mess, MessageBox.TYPE_INFO)
else:
@@ -1974,7 +1985,7 @@ class ReinstallKernel(Screen):
mess = _('Update available only from the image Flash.')
self.session.open(MessageBox, mess, MessageBox.TYPE_INFO)
else:
- self.kernel_update()
+ self.kernel_update()
else:
self.kernel_update()
@@ -1983,7 +1994,7 @@ class ReinstallKernel(Screen):
os.system('echo "Flash " > ' + getNeoLocation() + 'ImageBoot/.neonextboot')
out = open('' + getNeoLocation() + 'ImagesUpload/.kernel/used_flash_kernel', 'w')
out.write('Used Kernel: Flash')
- out.close()
+ out.close()
cmd1 = 'rm -f /home/root/*.ipk; opkg download kernel-image; sleep 2; opkg install --force-maintainer --force-reinstall --force-overwrite --force-downgrade /home/root/*.ipk; opkg configure update-modules; rm -f /home/root/*.ipk'
self.session.open(Console, _('NeoBoot....'), [cmd1])
self.close()
@@ -2001,7 +2012,7 @@ class neoDONATION(Screen):
__module__ = __name__
- def __init__(self, session):
+ def __init__(self, session):
Screen.__init__(self, session)
self['lab1'] = ScrollLabel('')
self['actions'] = ActionMap(['WizardActions', 'ColorActions', 'DirectionActions'], {'back': self.close,
@@ -2013,20 +2024,20 @@ class neoDONATION(Screen):
self['lab1'].hide()
self.updatetext()
- def updatetext(self):
+ def updatetext(self):
message = _('NeoBoot Ver. ' + PLUGINVERSION + ' Enigma2\n\n')
message += _('NeoBoot Ver. updates ' + UPDATEVERSION + ' \n\n')
message += _('----------------Free donate----------------\n\n')
- message += _('Spendenbetrag\nDonaco\nDarowizna\nПожертвование\n')
- message += _('Donate to the project\n')
+ message += _('Spendenbetrag\nDonaco\nDarowizna\nПожертвование\n')
+ message += _('Donate to the project\n')
message += _('- Access to the latest version\n')
message += _('- Online support\n')
message += _('- More information email\n')
message += _('We thank you for any help\n')
- message += _('If you want to support the neoboot project, you can do so by contacting us by e-mail:\n')
- message += _(' krzysztofgutosie@gmail.com\n\n')
- message += _(' PayPal adress: krzysztofgutosie@gmail.com\n')
- message += _('----------------Free donate----------------\n')
+ message += _('If you want to support the neoboot project, you can do so by contacting us by e-mail:\n')
+ message += _(' krzysztofgutosie@gmail.com\n\n')
+ message += _(' PayPal adress: krzysztofgutosie@gmail.com\n')
+ message += _('----------------Free donate----------------\n')
message += _('¯\_(ツ)_/¯ Have fun !!!')
self['lab1'].show()
self['lab1'].setText(message)
@@ -2035,6 +2046,7 @@ class neoDONATION(Screen):
def myboot(session, **kwargs):
session.open(MBTools)
+
def Plugins(path, **kwargs):
global pluginpath
pluginpath = path
diff --git a/NeoBoot/neoskins/darog69/skin_darog69.py b/NeoBoot/neoskins/darog69/skin_darog69.py
index 45e8d65..513062f 100644
--- a/NeoBoot/neoskins/darog69/skin_darog69.py
+++ b/NeoBoot/neoskins/darog69/skin_darog69.py
@@ -5,11 +5,11 @@ import os
# darog69 = ./neoskins/darog69/skin_darog69.py
### ImageChooseFULLHD - darog69
-ImageChooseFULLHD ="""
+ImageChooseFULLHD = """
-
+
@@ -21,10 +21,10 @@ ImageChooseFULLHD ="""
-
-
+
+
-
+
@@ -40,20 +40,20 @@ ImageChooseFULLHD ="""
-
+
-
-
+
+
-
-
-
-
+
+
+
+
-
+
"""
###
diff --git a/NeoBoot/neoskins/darog69_Ustym4kpro/skin_darog69_Ustym4kpro.py b/NeoBoot/neoskins/darog69_Ustym4kpro/skin_darog69_Ustym4kpro.py
index 8f16d3c..abaa265 100644
--- a/NeoBoot/neoskins/darog69_Ustym4kpro/skin_darog69_Ustym4kpro.py
+++ b/NeoBoot/neoskins/darog69_Ustym4kpro/skin_darog69_Ustym4kpro.py
@@ -5,7 +5,7 @@ import os
# darog69 = ./neoskins/darog69_Ustym4kpro/skin_darog69_Ustym4kpro.py
### ImageChooseFULLHD - darog69_Ustym4kpro
-ImageChooseFULLHD ="""
+ImageChooseFULLHD = """
@@ -51,11 +51,9 @@ ImageChooseFULLHD ="""
-
+
-
+
"""
###
-
-
\ No newline at end of file
diff --git a/NeoBoot/neoskins/default.py b/NeoBoot/neoskins/default.py
index 073d785..9c1cec8 100644
--- a/NeoBoot/neoskins/default.py
+++ b/NeoBoot/neoskins/default.py
@@ -4,23 +4,23 @@ from Screens.Screen import Screen
from Components.Pixmap import Pixmap
import os
-#Colors (#AARRGGBB)
+#Colors (#AARRGGBB)
#____Recommended colors - Zalecane kolory :
-#color name="white" value="#ffffff"
-#color name="darkwhite" value="#00dddddd"
-#color name="red" value="#f23d21"
-#color name="green" value="#389416"
-#color name="blue" value="#0064c7"
-#color name="yellow" value="#bab329"
-#color name="orange" value="#00ffa500"
-#color name="gray" value="#808080"
-#color name="lightgrey" value="#009b9b9b"
+#color name="white" value="#ffffff"
+#color name="darkwhite" value="#00dddddd"
+#color name="red" value="#f23d21"
+#color name="green" value="#389416"
+#color name="blue" value="#0064c7"
+#color name="yellow" value="#bab329"
+#color name="orange" value="#00ffa500"
+#color name="gray" value="#808080"
+#color name="lightgrey" value="#009b9b9b"
# green = '#00389416' lub #00389416
# red = '#00ff2525'
# yellow = '#00ffe875'
# orange = '#00ff7f50'
# seledynowy = #00FF00
-# jasny-blue = #99FFFF
+# jasny-blue = #99FFFF
# Zamiast font=Regular ktory nie rozpoznaje polskich znakow np. na VTi, mozesz zmienic na ponizsze font="*:
# font - genel
@@ -28,15 +28,15 @@ import os
# font - tasat
# font - dugme
-#
+#
###____ Skin Ultra HD - ImageChooseFULLHD ___ mod. gutosie___
-ImageChooseFULLHD ="""
+ImageChooseFULLHD = """
-
-
-
+
+
+
@@ -55,10 +55,10 @@ ImageChooseFULLHD ="""
-
-
-
-
+
+
+
+
@@ -89,100 +89,100 @@ ImageChooseFULLHD ="""
###____ Skin Ultra HD - ImageChooseULTRAHD ___ mod. gutosie___
-ImageChooseULTRAHD ="""
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+ImageChooseULTRAHD = """
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
- Default
+ Default
- Format:%A
+ Format:%A
Format:%e. %b.
-
+
"""
###____ Skin HD - ImageChoose ___mod. gutosie ___
-ImageChooseHD ="""
-\n
- \n
- \n
- \n
- \n
- \n
- \n
- \n
- \n
- \n
- \n
- \n
- \n
- \n
- \n
- \n
- \n
- \n
- \n
- \n
- \n
- \n
- \n
- \n
- \n
- \n
- \n
- \n
- \n
- \n
- \n
- \n
- \n
- \n
- \n
+ImageChooseHD = """
+\n
+ \n
+ \n
+ \n
+ \n
+ \n
+ \n
+ \n
+ \n
+ \n
+ \n
+ \n
+ \n
+ \n
+ \n
+ \n
+ \n
+ \n
+ \n
+ \n
+ \n
+ \n
+ \n
+ \n
+ \n
+ \n
+ \n
+ \n
+ \n
+ \n
+ \n
+ \n
+ \n
+ \n
+ \n
\n
\n
- \n
+ \n
Default
- \n
+ \n
Format:%A
- \n
+ \n
Format:%e. %b.
\n
@@ -190,7 +190,7 @@ ImageChooseHD ="""
###____ Skin FULLHD - MyUpgradeFULLHD ___mod. gutosie ___
-MyUpgradeFULLHD ="""
+MyUpgradeFULLHD = """
@@ -209,24 +209,24 @@ MyUpgradeFULLHD ="""
###____ Skin UltraHD - MyUpgradeUltraHD ___mod. gutosie ___
-MyUpgradeUltraHD ="""
-
-
-
-
+MyUpgradeUltraHD = """
+
+
+
+
{"template": [MultiContentEntryText(pos=(0,0), size=(1680,132), flags=RT_HALIGN_CENTER|RT_VALIGN_CENTER, text=0)], "fonts": [gFont("Regular",66)], "itemHeight":132}\n
-
-
-
-
-
-
+
+
+
+
+
+
"""
-
+
###____ Skin MyUpgradeHD - MyUpgradeHD ___mod. gutosie ___
-MyUpgradeHD ="""
+MyUpgradeHD = """
@@ -241,11 +241,11 @@ MyUpgradeHD ="""
- """
-
-
+ """
+
+
###____ Skin NeoBootInstallationFULLHD - NeoBootInstallationFULLHD ___mod. gutosie ___
-NeoBootInstallationFULLHD ="""
+NeoBootInstallationFULLHD = """
@@ -267,58 +267,51 @@ NeoBootInstallationFULLHD ="""
"""
###____ Skin NeoBootInstallationUltraHD - NeoBootInstallationUltraHD ___mod. gutosie ___
-NeoBootInstallationUltraHD ="""
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+NeoBootInstallationUltraHD = """
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Default
-
+
Format:%A
-
+
Format:%e. %b.
"""
###____ Skin NeoBootInstallationHD - NeoBootInstallationHD ___mod. gutosie ___
-NeoBootInstallationHD ="""
+NeoBootInstallationHD = """
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
"""
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/NeoBoot/neoskins/mercus/mercus_skin.py b/NeoBoot/neoskins/mercus/mercus_skin.py
index eb85862..37128ad 100644
--- a/NeoBoot/neoskins/mercus/mercus_skin.py
+++ b/NeoBoot/neoskins/mercus/mercus_skin.py
@@ -6,10 +6,10 @@ import os
# mercus = /neoskins/mercus/mercus_skin.py
### ImageChooseFULLHD - mercus
-ImageChooseFULLHD ="""
+ImageChooseFULLHD = """
-
+
@@ -46,7 +46,7 @@ ImageChooseFULLHD ="""
-
+
diff --git a/NeoBoot/neoskins/metrix/metrix_skin.py b/NeoBoot/neoskins/metrix/metrix_skin.py
index ba6c362..d302a40 100644
--- a/NeoBoot/neoskins/metrix/metrix_skin.py
+++ b/NeoBoot/neoskins/metrix/metrix_skin.py
@@ -5,54 +5,54 @@ import os
# skin /neoskins/matrix/matrix_skin.py - mod.gutosie
-### ImageChooseFULLHD
-ImageChooseFULLHD ="""
-
-
-
-
-
-
-
-
-
-
-
-
+### ImageChooseFULLHD
+ImageChooseFULLHD = """
+
+
+
+
+
+
+
+
+
+
+
+
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Default
-
+
Format:%A
-
+
Format:%e. %b.
diff --git a/NeoBoot/neoskins/neo/neo_skin.py b/NeoBoot/neoskins/neo/neo_skin.py
index 46bb0ea..d3034a3 100644
--- a/NeoBoot/neoskins/neo/neo_skin.py
+++ b/NeoBoot/neoskins/neo/neo_skin.py
@@ -5,17 +5,17 @@ from Components.Pixmap import Pixmap
import os
-#Colors (#AARRGGBB)
+#Colors (#AARRGGBB)
#____Recommended colors - Zalecane kolory :
-#color name="white" value="#ffffff"
-#color name="darkwhite" value="#00dddddd"
-#color name="red" value="#f23d21"
-#color name="green" value="#389416"
-#color name="blue" value="#0064c7"
-#color name="yellow" value="#bab329"
-#color name="orange" value="#00ffa500"
-#color name="gray" value="#808080"
-#color name="lightgrey" value="#009b9b9b"
+#color name="white" value="#ffffff"
+#color name="darkwhite" value="#00dddddd"
+#color name="red" value="#f23d21"
+#color name="green" value="#389416"
+#color name="blue" value="#0064c7"
+#color name="yellow" value="#bab329"
+#color name="orange" value="#00ffa500"
+#color name="gray" value="#808080"
+#color name="lightgrey" value="#009b9b9b"
# font genel
# font baslk
@@ -25,91 +25,91 @@ import os
#jak by chcial ktos wlasny selektor, to przyklad:
#
-### ImageChooseFULLHD
-ImageChooseFULLHD ="""
-
+### ImageChooseFULLHD
+ImageChooseFULLHD = """
+
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
-
-
+
+
+
-
+
-
-
+
+
-
-
+
+
-
-#Window image selection - Okno wyboru image
-
+
+#Window image selection - Okno wyboru image
+
#Used Kernel:
#More options - Menu
-
+
-#key 1> 2> 3>
+#key 1> 2> 3>
-
+
-
-#Please choose an image to boot
-
-#NeoBoot is running from:
+#Please choose an image to boot
+
+
+#NeoBoot is running from:
-
-#NeoBoot is running image:
+
+#NeoBoot is running image:
-
-
-#Memory disc: - Pamiec dysku
+
+
+#Memory disc: - Pamiec dysku
-
+
#Number of images installed:
-
-
-#Version update:
+
+
+#Version update:
#UPDATEVERSION
-
+
+
+#NeoBoot version:
+
+#PLUGINVERSION
+
+
+#Kernel Version
+
+#KERNELVERSION
+
-#NeoBoot version:
-
-#PLUGINVERSION
-
-
-#Kernel Version
-
-#KERNELVERSION
-
-
#hostname
-
+
#Memory - Used: Available:
@@ -117,10 +117,8 @@ ImageChooseFULLHD ="""
#VIP
-
+
"""
-
-###ImageChoose-HD
-
+###ImageChoose-HD
diff --git a/NeoBoot/neoskins/oldhd/hd_skin.py b/NeoBoot/neoskins/oldhd/hd_skin.py
index 78a42c3..7f4ea4b 100644
--- a/NeoBoot/neoskins/oldhd/hd_skin.py
+++ b/NeoBoot/neoskins/oldhd/hd_skin.py
@@ -4,14 +4,13 @@ from Components.Pixmap import Pixmap
import os
-
###____ Skin HD - ImageChoose ___mod. gutosie ___
-ImageChooseHD ="""
-
-
-
-
-
+ImageChooseHD = """
+
+
+
+
+
@@ -29,7 +28,7 @@ ImageChooseHD ="""
-
+
@@ -47,6 +46,6 @@ ImageChooseHD ="""
Format:%-H:%M
-
+
"""
diff --git a/NeoBoot/plugin.py b/NeoBoot/plugin.py
index e65e269..80e5cdb 100644
--- a/NeoBoot/plugin.py
+++ b/NeoBoot/plugin.py
@@ -1,9 +1,9 @@
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
-####################### _q(-_-)p_ gutosie _q(-_-)p_ #######################
+####################### _q(-_-)p_ gutosie _q(-_-)p_ #######################
# Copyright (c) , gutosie license
-#
-# Redystrybucja wersji programu i dokonywania modyfikacji JEST DOZWOLONE, pod warunkiem zachowania niniejszej informacji o prawach autorskich.
+#
+# Redystrybucja wersji programu i dokonywania modyfikacji JEST DOZWOLONE, pod warunkiem zachowania niniejszej informacji o prawach autorskich.
# Autor NIE ponosi JAKIEJKOLWIEK odpowiedzialności za skutki użtkowania tego programu oraz za wykorzystanie zawartych tu informacji.
# Modyfikacje przeprowadzasz na wlasne ryzyko!!!
# O wszelkich zmianach prosze poinformować na http://all-forum.cba.pl w temacie pod nazwa -#[NEOBOOT]#-
@@ -12,15 +12,15 @@
# source and binary forms, with or without modification, ARE PERMITTED provided
# save this copyright notice. This document/program is distributed WITHOUT any
# warranty, use at YOUR own risk.
-#neoboot modules
+#neoboot modules
#--------------------------------------------- NEOBOOT ---------------------------------------------#
from __future__ import absolute_import
from . import _
-from Plugins.Extensions.NeoBoot.files.stbbranding import LogCrashGS, getSupportedTuners, getLabelDisck, getINSTALLNeo, getNeoLocation, getLocationMultiboot, getNeoMount, getNeoMount2, getNeoMount3, getNeoMount4, getNeoMount5, getFSTAB, getFSTAB2, getKernelVersionString, getKernelImageVersion, getCPUtype, getCPUSoC, getImageNeoBoot, getBoxVuModel, getBoxHostName, getTunerModel, getImageDistroN, getFormat, getNEO_filesystems, getBoxModelVU, getMountPointAll, getMountPointNeo
-from Plugins.Extensions.NeoBoot.files import Harddisk
-from Components.About import about
+from Plugins.Extensions.NeoBoot.files.stbbranding import LogCrashGS, getSupportedTuners, getLabelDisck, getINSTALLNeo, getNeoLocation, getLocationMultiboot, getNeoMount, getNeoMount2, getNeoMount3, getNeoMount4, getNeoMount5, getFSTAB, getFSTAB2, getKernelVersionString, getKernelImageVersion, getCPUtype, getCPUSoC, getImageNeoBoot, getBoxVuModel, getBoxHostName, getTunerModel, getImageDistroN, getFormat, getNEO_filesystems, getBoxModelVU, getMountPointAll, getMountPointNeo
+from Plugins.Extensions.NeoBoot.files import Harddisk
+from Components.About import about
from enigma import getDesktop, eTimer
-from Screens.Screen import Screen
+from Screens.Screen import Screen
from Screens.MessageBox import MessageBox
from Screens.ChoiceBox import ChoiceBox
from Screens.VirtualKeyBoard import VirtualKeyBoard
@@ -34,7 +34,7 @@ from Components.MenuList import MenuList
from Components.Input import Input
from Components.Label import Label
from Components.ProgressBar import ProgressBar
-from Components.ScrollLabel import ScrollLabel
+from Components.ScrollLabel import ScrollLabel
from Components.Pixmap import Pixmap, MultiPixmap
from Components.config import *
from Components.ConfigList import ConfigListScreen
@@ -46,31 +46,32 @@ import os
import time
from time import gmtime, strftime
from Tools.Testinout import getTestIn, getTestOut, getTestInTime, getTestOutTime, getAccessN, getAccesDate, getButtonPin, getTestToTest
-if fileExists('/etc/vtiversion.info') or fileExists('/etc/bhversion') or fileExists('/usr/lib/python3.8') and fileExists('/.multinfo'):
- from Screens.Console import Console
+if fileExists('/etc/vtiversion.info') or fileExists('/etc/bhversion') or fileExists('/usr/lib/python3.8') and fileExists('/.multinfo'):
+ from Screens.Console import Console
else:
try:
- from Plugins.Extensions.NeoBoot.files.neoconsole import Console
+ from Plugins.Extensions.NeoBoot.files.neoconsole import Console
except:
from Screens.Console import Console
-
+
loggscrash = time.localtime(time.time())
PLUGINVERSION = '9.25'
UPDATEVERSION = '9.26'
-UPDATEDATE = '"+%Y05%d"'
-LinkNeoBoot = '/usr/lib/enigma2/python/Plugins/Extensions/NeoBoot'
+UPDATEDATE = '"+%Y05%d"'
+LinkNeoBoot = '/usr/lib/enigma2/python/Plugins/Extensions/NeoBoot'
try:
from enigma import addFont
font_osans = LinkNeoBoot + '/neoskins/osans.ttf'
font_sagoe = LinkNeoBoot + '/neoskins/sagoe.ttf'
- addFont(font_osans, 'genel', 100, True)
+ addFont(font_osans, 'genel', 100, True)
addFont(font_sagoe, 'baslk', 100, True)
addFont(font_sagoe, 'tasat', 100, True)
addFont(font_sagoe, 'dugme', 90, True)
except:
- print ("ERROR INSERTING FONT")
-
+ print("ERROR INSERTING FONT")
+
+
def neoTranslator():
neolang = ''
usedlang = open('/etc/enigma2/settings', 'r')
@@ -82,32 +83,37 @@ 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
- skin=MyUpgradeFULLHD
+ skin = MyUpgradeFULLHD
elif isUHD():
from Plugins.Extensions.NeoBoot.neoskins.default import MyUpgradeUltraHD
- skin=MyUpgradeUltraHD
+ skin = MyUpgradeUltraHD
else:
from Plugins.Extensions.NeoBoot.neoskins.default import MyUpgradeHD
- skin=MyUpgradeHD
+ skin = MyUpgradeHD
__module__ = __name__
@@ -119,7 +125,7 @@ class MyUpgrade(Screen):
self['actions'] = ActionMap(['WizardActions', 'ColorActions'], {'ok': self.KeyOk,
'back': self.changever})
- def changever(self):
+ def changever(self):
ImageChoose = self.session.open(NeoBootImageChoose)
if fileExists('' + LinkNeoBoot + '/.location'):
out = open('%sImageBoot/.version' % getNeoLocation(), 'w')
@@ -141,7 +147,7 @@ class MyUpgrade(Screen):
self.list.append(res)
self['list'].list = self.list
- def KeyOk(self):
+ def KeyOk(self):
self.sel = self['list'].getCurrent()
if self.sel:
self.sel = self.sel[2]
@@ -149,10 +155,10 @@ class MyUpgrade(Screen):
pass
self.close()
- def goKeyOk(self):
- try:
+ def goKeyOk(self):
+ try:
from Plugins.Extensions.NeoBoot.files.tools import UpdateNeoBoot
- self.session.open(UpdateNeoBoot)
+ self.session.open(UpdateNeoBoot)
except Exception as e:
loggscrash = time.localtime(time.time())
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)))
@@ -162,13 +168,13 @@ class MyUpgrade(Screen):
class NeoBootInstallation(Screen):
if isFHD():
from Plugins.Extensions.NeoBoot.neoskins.default import NeoBootInstallationFULLHD
- skin=NeoBootInstallationFULLHD
+ skin = NeoBootInstallationFULLHD
elif isUHD():
from Plugins.Extensions.NeoBoot.neoskins.default import NeoBootInstallationUltraHD
- skin=NeoBootInstallationUltraHD
+ skin = NeoBootInstallationUltraHD
else:
from Plugins.Extensions.NeoBoot.neoskins.default import NeoBootInstallationHD
- skin=NeoBootInstallationHD
+ skin = NeoBootInstallationHD
def __init__(self, session):
Screen.__init__(self, session)
@@ -181,18 +187,18 @@ class NeoBootInstallation(Screen):
self['label1'] = Label(_('Welcome to NeoBoot %s Plugin installation.') % PLUGINVERSION)
self['label3'] = Label(_('It is recommended to give a label to the disk.'))
self['label2'] = Label(_('Here is the list of mounted devices in Your STB\nPlease choose a device where You would like to install NeoBoot'))
- self['actions'] = ActionMap(['WizardActions', 'ColorActions', 'DirectionActions'], {'red': self.Instrukcja,
+ self['actions'] = ActionMap(['WizardActions', 'ColorActions', 'DirectionActions'], {'red': self.Instrukcja,
'green': self.checkinstall,
'ok': self.checkinstall,
'key_menu': self.datadrive,
- 'yellow': self.SetDiskLabel,
- 'blue': self.devices,
- 'back': self.close})
+ 'yellow': self.SetDiskLabel,
+ 'blue': self.devices,
+ 'back': self.close})
self.updateList()
-
+
if fileExists('/etc/fstab'):
- neoformat = getFormat()
- writefile = open('/tmp/.neo_format' , 'w')
+ neoformat = getFormat()
+ writefile = open('/tmp/.neo_format', 'w')
writefile.write(neoformat)
writefile.close()
@@ -204,8 +210,8 @@ class NeoBootInstallation(Screen):
loggscrash = time.localtime(time.time())
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 menu set disk label\nAccess Fails with Error code 0x01.')
- self.session.open(MessageBox, mess, MessageBox.TYPE_INFO)
-
+ self.session.open(MessageBox, mess, MessageBox.TYPE_INFO)
+
def Instrukcja(self):
try:
from Plugins.Extensions.NeoBoot.files.tools import MyHelpNeo
@@ -215,7 +221,7 @@ class NeoBootInstallation(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 menu set disk label\nAccess Fails with Error code 0x01.')
self.session.open(MessageBox, mess, MessageBox.TYPE_INFO)
-
+
def datadrive(self):
try:
message = "echo -e '\n"
@@ -224,7 +230,7 @@ class NeoBootInstallation(Screen):
os.system(" 'mount | sed '/sd/!d' | cut -d" " -f1,2,3,4,5' ")
cmd = '/sbin/blkid '
system(cmd)
- print ("[MULTI-BOOT]: "), cmd
+ print("[MULTI-BOOT]: "), cmd
self.session.open(Console, _(' NeoBot - Available media:'), [message, cmd])
except Exception as e:
loggscrash = time.localtime(time.time())
@@ -284,12 +290,12 @@ class NeoBootInstallation(Screen):
mysd
self.list.append(mysd)
else:
- mysd
+ mysd
if mycard:
mycard
self.list.append(mycard)
else:
- mycard
+ mycard
if myhdd:
myhdd
self.list.append(myhdd)
@@ -302,7 +308,7 @@ class NeoBootInstallation(Screen):
myssd
self['config'].setList(self.list)
-
+
def checkReadWriteDir(self, configele):
supported_filesystems = frozenset(('ext4', 'ext3', 'ext2', 'nfs'))
candidates = []
@@ -311,7 +317,7 @@ class NeoBootInstallation(Screen):
for partition in Harddisk.harddiskmanager.getMountedPartitions(False, mounts):
if partition.filesystem(mounts) in supported_filesystems:
candidates.append((partition.description, partition.mountpoint))
-
+
if candidates:
locations = []
for validdevice in candidates:
@@ -325,7 +331,7 @@ class NeoBootInstallation(Screen):
self.session.open(MessageBox, _('The directory %s is not a ext2, ext3, ext4 or nfs partition.\nMake sure you select a valid partition type to install.') % dir, type=MessageBox.TYPE_ERROR)
return False
- elif getFormat() == 'ext4' or getFormat() == 'ext3' or getFormat() == 'ext2' or getFormat() == 'nfs' :
+ elif getFormat() == 'ext4' or getFormat() == 'ext3' or getFormat() == 'ext2' or getFormat() == 'nfs':
return True
else:
@@ -356,34 +362,34 @@ class NeoBootInstallation(Screen):
if fileExists('/.multinfo'):
mess = _('Sorry, Neoboot can be installed or upgraded only when booted from Flash')
self.session.open(MessageBox, mess, MessageBox.TYPE_INFO)
- else:
+ else:
self.checkinstall2()
-
+
def checkinstall2(self):
- if fileExists('/media/usb/ImageBoot/') and fileExists('/media/hdd/ImageBoot/'):
- mess = _('An error was encountered, you have neoboot installed on usb and hdd.\nUninstall one directories from one drive.')
+ if fileExists('/media/usb/ImageBoot/') and fileExists('/media/hdd/ImageBoot/'):
+ mess = _('An error was encountered, you have neoboot installed on usb and hdd.\nUninstall one directories from one drive.')
self.session.open(MessageBox, mess, MessageBox.TYPE_INFO)
else:
self.checkinstall3()
def checkinstall3(self):
- if checkInternet():
+ if checkInternet():
self.check_LabelDisck()
else:
mess = _('Geen internet')
- self.session.open(MessageBox, mess, MessageBox.TYPE_INFO)
+ self.session.open(MessageBox, mess, MessageBox.TYPE_INFO)
def check_LabelDisck(self):
- system('blkid -c /dev/null /dev/sd* > ' + LinkNeoBoot + '/bin/reading_blkid; chmod 755 ' + LinkNeoBoot + '/bin/reading_blkid ')
- if getLabelDisck() != 'LABEL=':
- message = _('NeoBot - First use yellow button and Set Disk Label!\nWithout labeling disc neoboot may not work properly')
+ system('blkid -c /dev/null /dev/sd* > ' + LinkNeoBoot + '/bin/reading_blkid; chmod 755 ' + LinkNeoBoot + '/bin/reading_blkid ')
+ if getLabelDisck() != 'LABEL=':
+ message = _('NeoBot - First use yellow button and Set Disk Label!\nWithout labeling disc neoboot may not work properly')
ybox = self.session.openWithCallback(self.goSetDiskLabel, MessageBox, message, MessageBox.TYPE_YESNO)
ybox.setTitle(_('Install Confirmation'))
else:
self.check_fstabUUID()
- def check_fstabUUID(self):
+ def check_fstabUUID(self):
if getFSTAB2() != 'OKinstall':
message = (_('Disk UUID not found\n - Universally unique identifier (UUID) is not required.\nYou can proceed with further installation or give an ID to your disk.\nTo continue the installation neoboo, press OK or No to abort.'))
ybox = self.session.openWithCallback(self.SetMountPointFSTAB, MessageBox, message, MessageBox.TYPE_YESNO)
@@ -393,37 +399,37 @@ class NeoBootInstallation(Screen):
self.first_installation()
def goSetDiskLabel(self, yesno):
- if yesno:
+ if yesno:
from Plugins.Extensions.NeoBoot.files.devices import SetDiskLabel
self.session.open(SetDiskLabel)
else:
- message = _('NeoBot - choose what you want to do, install or not !!!')
+ message = _('NeoBot - choose what you want to do, install or not !!!')
ybox = self.session.openWithCallback(self.goInstall, MessageBox, message, MessageBox.TYPE_YESNO)
ybox.setTitle(_('Install Confirmation'))
def SetMountPointFSTAB(self, yesno):
- if yesno:
- message = _('Proceed with further installation without providing a unique identifier for the disks ?')
+ if yesno:
+ message = _('Proceed with further installation without providing a unique identifier for the disks ?')
ybox = self.session.openWithCallback(self.goInstall, MessageBox, message, MessageBox.TYPE_YESNO)
ybox.setTitle(_('Install Confirmation'))
else:
self.devices()
-
+
def goInstall(self, yesno):
if yesno:
- self.first_installation()
+ self.first_installation()
else:
- self.myclose2(_('NeoBoot has not been installed ! :(' ))
+ self.myclose2(_('NeoBoot has not been installed ! :('))
def first_installation(self):
check = False
if fileExists('/proc/mounts'):
with open('/proc/mounts', 'r') as f:
for line in f.readlines():
- if line.find(' ext') and line.find('/media/hdd') or line.find('/media/usb') == -1 and (line.find('ext4') != -1 or line.find('ext3') != -1 or line.find('ext2') != -1):
+ if line.find(' ext') and line.find('/media/hdd') or line.find('/media/usb') == -1 and (line.find('ext4') != -1 or line.find('ext3') != -1 or line.find('ext2') != -1):
check = True
break
-
+
if check == False:
self.session.open(MessageBox, _('Sorry, there is not any connected devices in your STB.\nPlease connect HDD or USB to install NeoBoot!'), MessageBox.TYPE_INFO)
else:
@@ -435,35 +441,35 @@ class NeoBootInstallation(Screen):
else:
self.close()
- def install2(self, yesno):
- print ("yesno:"), yesno
- if yesno:
+ def install2(self, yesno):
+ print("yesno:"), yesno
+ if yesno:
self.first_installationNeoBoot()
else:
- self.myclose2(_('NeoBoot has not been installed ! :(' ))
+ self.myclose2(_('NeoBoot has not been installed ! :('))
- def first_installationNeoBoot(self):
+ def first_installationNeoBoot(self):
self.mysel = self['config'].getCurrent()
- os.system('cd ' + LinkNeoBoot + '/; chmod 0755 ./bin/neoini*; chmod 0755 ./ex_init.py; chmod 0755 ./tmpfiles/target/*.sh; chmod 0755 ./files/userscript.sh')
- cmd1 = 'mkdir ' + self.mysel + 'ImageBoot;mkdir ' + self.mysel + 'ImagesUpload'
+ os.system('cd ' + LinkNeoBoot + '/; chmod 0755 ./bin/neoini*; chmod 0755 ./ex_init.py; chmod 0755 ./tmpfiles/target/*.sh; chmod 0755 ./files/userscript.sh')
+ cmd1 = 'mkdir ' + self.mysel + 'ImageBoot;mkdir ' + self.mysel + 'ImagesUpload'
system(cmd1)
- cmd2 = 'mkdir ' + self.mysel + 'ImageBoot;mkdir ' + self.mysel + 'ImagesUpload/.kernel'
- system(cmd2)
+ cmd2 = 'mkdir ' + self.mysel + 'ImageBoot;mkdir ' + self.mysel + 'ImagesUpload/.kernel'
+ system(cmd2)
- if os.path.isfile('' + LinkNeoBoot + '/.location'):
- os.system('rm -f ' + LinkNeoBoot + '/.location')
+ if os.path.isfile('' + LinkNeoBoot + '/.location'):
+ os.system('rm -f ' + LinkNeoBoot + '/.location')
out = open('/usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/.location', 'w')
out.write(self.mysel)
- out.close()
-
- if os.path.isfile('%sImageBoot/.neonextboot' % getNeoLocation()):
- os.system('rm -f /etc/neoimage; rm -f /etc/imageboot; rm -f %sImageBoot/.neonextboot; rm -f %sImageBoot/.version; rm -f %sImageBoot/.Flash; rm -f %sImageBoot/.imagedistro; rm -f %sImageBoot/.initneo.log; rm -f %sImageBoot/.updateversion' % ( getNeoLocation(), getNeoLocation(), getNeoLocation(), getNeoLocation(), getNeoLocation(), getNeoLocation()) )
+ out.close()
- if os.path.isfile('%sImageBoot/.neonextboot' % 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('%sImageBoot/.neonextboot' % getNeoLocation()):
+ os.system('rm -f /etc/neoimage; rm -f /etc/imageboot; rm -f %sImageBoot/.neonextboot; rm -f %sImageBoot/.version; rm -f %sImageBoot/.Flash; rm -f %sImageBoot/.imagedistro; rm -f %sImageBoot/.initneo.log; rm -f %sImageBoot/.updateversion' % (getNeoLocation(), getNeoLocation(), getNeoLocation(), getNeoLocation(), 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()) )
+ if os.path.isfile('%sImageBoot/.neonextboot' % 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())):
+ os.system('rm -f %sImagesUpload/.kernel/zImage*.ipk; rm -f %sImagesUpload/.kernel/zImage*.bin' % (getNeoLocation(), getNeoLocation()))
if fileExists('/etc/issue.net'):
try:
@@ -473,13 +479,13 @@ class NeoBootInstallation(Screen):
open('%sImageBoot/.Flash' % getNeoLocation(), 'w').write(image)
except:
False
-
+
if not fileExists('/usr/lib/periodon/.accessdate'):
os.system('date %s > /usr/lib/periodon/.accessdate' % UPDATEDATE)
out1 = open('%sImageBoot/.version' % getNeoLocation(), 'w')
out1.write(PLUGINVERSION)
- out1.close()
+ out1.close()
out2 = open('%sImageBoot/.neonextboot' % getNeoLocation(), 'w')
out2.write('Flash ')
out2.close()
@@ -488,26 +494,26 @@ class NeoBootInstallation(Screen):
out3.write('Kernel-Version: ' + about.getKernelVersionString() + '\n')
out3.write('NeoBoot\n')
out3.write('NeoBoot-Version: ' + PLUGINVERSION + '\n')
- out3.close()
+ out3.close()
out = open('%sImageBoot/.updateversion' % getNeoLocation(), 'w')
out.write(UPDATEVERSION)
out.close()
if fileExists('/usr/lib/enigma2/python/boxbranding.so'):
from boxbranding import getImageDistro
- imagedistro = getImageDistro()
+ imagedistro = getImageDistro()
writefile = open('%sImageBoot/.imagedistro' % getNeoLocation(), 'w')
writefile.write(imagedistro)
writefile.close()
elif fileExists('/usr/lib/enigma2/python/Plugins/PLi'):
obraz = open('/etc/issue.net', 'r').readlines()
imagetype = obraz[0][:-3]
- image = imagetype
+ image = imagetype
writefile = open('%sImageBoot/.imagedistro' % getNeoLocation(), 'w')
writefile.write(imagetype)
- writefile.close()
+ writefile.close()
elif fileExists('/etc/vtiversion.info'):
- f = open("/etc/vtiversion.info",'r')
+ f = open("/etc/vtiversion.info", 'r')
imagever = f.readline().strip().replace("Release ", " ")
f.close()
image = imagever
@@ -515,7 +521,7 @@ class NeoBootInstallation(Screen):
writefile.write(imagever)
writefile.close()
elif fileExists('/etc/bhversion'):
- f = open("/etc/bhversion",'r')
+ f = open("/etc/bhversion", 'r')
imagever = f.readline().strip()
f.close()
image = imagever
@@ -523,164 +529,162 @@ class NeoBootInstallation(Screen):
writefile.write(imagever)
writefile.close()
- if not os.path.isfile('/etc/name') :
+ if not os.path.isfile('/etc/name'):
if os.system('opkg update; opkg list-installed | grep python-subprocess') != 0:
os.system('opkg install python-subprocess')
if os.system('opkg list-installed | grep python-argparse') != 0:
os.system('opkg install python-argparse')
if os.system('opkg list-installed | grep curl') != 0:
- os.system('opkg install curl')
+ os.system('opkg install curl')
if getCPUtype() == 'MIPS':
if os.system('opkg list-installed | grep kernel-module-nandsim') != 0:
- os.system('opkg install kernel-module-nandsim')
+ os.system('opkg install kernel-module-nandsim')
if os.system('opkg list-installed | grep mtd-utils-jffs2') != 0:
os.system('opkg install mtd-utils-jffs2')
- if os.system('opkg list-installed | grep lzo') != 0:
- os.system('opkg install lzo')
- if os.system('opkg list-installed | grep python-setuptools') != 0:
- os.system('opkg install python-setuptools')
- if os.system('opkg list-installed | grep util-linux-sfdisk') != 0:
- os.system('opkg install util-linux-sfdisk')
- if os.system('opkg list-installed | grep packagegroup-base-nfs') != 0:
- os.system('opkg install packagegroup-base-nfs')
- if os.system('opkg list-installed | grep ofgwrite') != 0:
+ if os.system('opkg list-installed | grep lzo') != 0:
+ os.system('opkg install lzo')
+ if os.system('opkg list-installed | grep python-setuptools') != 0:
+ os.system('opkg install python-setuptools')
+ if os.system('opkg list-installed | grep util-linux-sfdisk') != 0:
+ os.system('opkg install util-linux-sfdisk')
+ if os.system('opkg list-installed | grep packagegroup-base-nfs') != 0:
+ os.system('opkg install packagegroup-base-nfs')
+ if os.system('opkg list-installed | grep ofgwrite') != 0:
os.system('opkg install ofgwrite')
- if os.system('opkg list-installed | grep bzip2') != 0:
+ if os.system('opkg list-installed | grep bzip2') != 0:
os.system('opkg install bzip2')
if os.system('opkg list-installed | grep mtd-utils') != 0:
os.system('opkg install mtd-utils')
- if os.system('opkg list-installed | grep mtd-utils-ubifs') != 0:
- os.system('opkg install mtd-utils-ubifs')
+ if os.system('opkg list-installed | grep mtd-utils-ubifs') != 0:
+ os.system('opkg install mtd-utils-ubifs')
# STB ARM
- if getCPUtype() == "ARMv7" :
+ if getCPUtype() == "ARMv7":
if getBoxHostName() == "vuduo4k" and getBoxHostName() != "ustym4kpro":
- os.system('cd ' + LinkNeoBoot + '/' )
- os.system('cp -Rf ' + LinkNeoBoot + '/bin/neoinitarm /sbin/neoinitarm; cp -Rf ' + LinkNeoBoot + '/bin/neoinitarmvuDuo4k /sbin/neoinitarmvu; mv ' + LinkNeoBoot + '/tmpfiles/runpy/duo4k_run.py ' + LinkNeoBoot + '/run.py; cd')
- os.system('chmod 755 /sbin/neoinitarm; chmod 755 /sbin/neoinitarmvu')
- os.system('dd if=/dev/mmcblk0p6 of=%sImagesUpload/.kernel/flash-kernel-%s.bin' % (getNeoLocation(), getBoxHostName()) )
- os.system('mv ' + LinkNeoBoot + '/tmpfiles/target/vuDuo4Kmmcblk0p6.sh ' + LinkNeoBoot + '/files/kernel.sh; cd')
+ os.system('cd ' + LinkNeoBoot + '/')
+ os.system('cp -Rf ' + LinkNeoBoot + '/bin/neoinitarm /sbin/neoinitarm; cp -Rf ' + LinkNeoBoot + '/bin/neoinitarmvuDuo4k /sbin/neoinitarmvu; mv ' + LinkNeoBoot + '/tmpfiles/runpy/duo4k_run.py ' + LinkNeoBoot + '/run.py; cd')
+ os.system('chmod 755 /sbin/neoinitarm; chmod 755 /sbin/neoinitarmvu')
+ os.system('dd if=/dev/mmcblk0p6 of=%sImagesUpload/.kernel/flash-kernel-%s.bin' % (getNeoLocation(), getBoxHostName()))
+ os.system('mv ' + LinkNeoBoot + '/tmpfiles/target/vuDuo4Kmmcblk0p6.sh ' + LinkNeoBoot + '/files/kernel.sh; cd')
elif getBoxHostName() == "vuduo4kse" and getBoxHostName() != "vuultimo4k" and getBoxHostName() != "ustym4kpro":
- os.system('cd ' + LinkNeoBoot + '/' )
- os.system('cp -Rf ' + LinkNeoBoot + '/bin/neoinitarm /sbin/neoinitarm; cp -Rf ' + LinkNeoBoot + '/bin/neoinitarmvuDuo4k /sbin/neoinitarmvu; mv ' + LinkNeoBoot + '/tmpfiles/runpy/duo4kse_run.py ' + LinkNeoBoot + '/run.py; cd')
- os.system('chmod 755 /sbin/neoinitarm; chmod 755 /sbin/neoinitarmvu')
- os.system('dd if=/dev/mmcblk0p6 of=%sImagesUpload/.kernel/flash-kernel-%s.bin' % (getNeoLocation(), getBoxHostName()) )
- os.system('mv ' + LinkNeoBoot + '/tmpfiles/target/vuDuo4Ksemmcblk0p6.sh ' + LinkNeoBoot + '/files/kernel.sh; cd')
-
- elif getBoxHostName() == "vuzero4k" and getBoxHostName() != "ustym4kpro":
- os.system('cd ' + LinkNeoBoot + '/' )
- os.system('cp -Rf ' + LinkNeoBoot + '/bin/neoinitarm /sbin/neoinitarm; cp -Rf ' + LinkNeoBoot + '/bin/neoinitarmvu /sbin/neoinitarmvu; cd')
+ os.system('cd ' + LinkNeoBoot + '/')
+ os.system('cp -Rf ' + LinkNeoBoot + '/bin/neoinitarm /sbin/neoinitarm; cp -Rf ' + LinkNeoBoot + '/bin/neoinitarmvuDuo4k /sbin/neoinitarmvu; mv ' + LinkNeoBoot + '/tmpfiles/runpy/duo4kse_run.py ' + LinkNeoBoot + '/run.py; cd')
os.system('chmod 755 /sbin/neoinitarm; chmod 755 /sbin/neoinitarmvu')
- os.system('dd if=/dev/mmcblk0p4 of=%sImagesUpload/.kernel/flash-kernel-%s.bin' % (getNeoLocation(), getBoxHostName()) )
- os.system('mv ' + LinkNeoBoot + '/tmpfiles/target/vuZero4Kmmcblk0p4.sh ' + LinkNeoBoot + '/files/kernel.sh; mv ' + LinkNeoBoot + '/tmpfiles/runpy/zero4k_run.py ' + LinkNeoBoot + '/run.py; rm -f ' + LinkNeoBoot + '/bin/neoinitarmvuDuo4k; cd')
-
+ os.system('dd if=/dev/mmcblk0p6 of=%sImagesUpload/.kernel/flash-kernel-%s.bin' % (getNeoLocation(), getBoxHostName()))
+ os.system('mv ' + LinkNeoBoot + '/tmpfiles/target/vuDuo4Ksemmcblk0p6.sh ' + LinkNeoBoot + '/files/kernel.sh; cd')
+
+ elif getBoxHostName() == "vuzero4k" and getBoxHostName() != "ustym4kpro":
+ os.system('cd ' + LinkNeoBoot + '/')
+ os.system('cp -Rf ' + LinkNeoBoot + '/bin/neoinitarm /sbin/neoinitarm; cp -Rf ' + LinkNeoBoot + '/bin/neoinitarmvu /sbin/neoinitarmvu; cd')
+ os.system('chmod 755 /sbin/neoinitarm; chmod 755 /sbin/neoinitarmvu')
+ os.system('dd if=/dev/mmcblk0p4 of=%sImagesUpload/.kernel/flash-kernel-%s.bin' % (getNeoLocation(), getBoxHostName()))
+ os.system('mv ' + LinkNeoBoot + '/tmpfiles/target/vuZero4Kmmcblk0p4.sh ' + LinkNeoBoot + '/files/kernel.sh; mv ' + LinkNeoBoot + '/tmpfiles/runpy/zero4k_run.py ' + LinkNeoBoot + '/run.py; rm -f ' + LinkNeoBoot + '/bin/neoinitarmvuDuo4k; cd')
+
elif getBoxHostName() == "vuultimo4k" or getBoxHostName() == "vusolo4k" or getBoxHostName() == "vuuno4k" or getBoxHostName() == "vuuno4kse" and getBoxHostName() != "ustym4kpro":
- os.system('cd ' + LinkNeoBoot + '/' )
- os.system('cp -Rf ' + LinkNeoBoot + '/bin/neoinitarm /sbin/neoinitarm; cp -Rf ' + LinkNeoBoot + '/bin/neoinitarmvu /sbin/neoinitarmvu; cd')
- os.system('chmod 755 /sbin/neoinitarm; chmod 755 /sbin/neoinitarmvu')
- os.system('dd if=/dev/mmcblk0p1 of=%sImagesUpload/.kernel/flash-kernel-%s.bin' % (getNeoLocation(), getBoxHostName()) )
- os.system('mv ' + LinkNeoBoot + '/tmpfiles/target/vu_mmcblk0p1.sh ' + LinkNeoBoot + '/files/kernel.sh; mv ' + LinkNeoBoot + '/tmpfiles/runpy/vu4k_run.py ' + LinkNeoBoot + '/run.py; rm -f; rm -f ' + LinkNeoBoot + '/bin/neoinitarmvuDuo4k; cd')
+ os.system('cd ' + LinkNeoBoot + '/')
+ os.system('cp -Rf ' + LinkNeoBoot + '/bin/neoinitarm /sbin/neoinitarm; cp -Rf ' + LinkNeoBoot + '/bin/neoinitarmvu /sbin/neoinitarmvu; cd')
+ os.system('chmod 755 /sbin/neoinitarm; chmod 755 /sbin/neoinitarmvu')
+ os.system('dd if=/dev/mmcblk0p1 of=%sImagesUpload/.kernel/flash-kernel-%s.bin' % (getNeoLocation(), getBoxHostName()))
+ os.system('mv ' + LinkNeoBoot + '/tmpfiles/target/vu_mmcblk0p1.sh ' + LinkNeoBoot + '/files/kernel.sh; mv ' + LinkNeoBoot + '/tmpfiles/runpy/vu4k_run.py ' + LinkNeoBoot + '/run.py; rm -f; rm -f ' + LinkNeoBoot + '/bin/neoinitarmvuDuo4k; cd')
else:
os.system('cp -f ' + LinkNeoBoot + '/bin/neoinitarm /sbin/neoinitarm; chmod 0755 /sbin/neoinitarm; ln -sfn /sbin/neoinitarm /sbin/init; mv ' + LinkNeoBoot + '/tmpfiles/runpy/arm_run.py ' + LinkNeoBoot + '/run.py; rm -f ' + LinkNeoBoot + '/bin/neoinitarmvuDuo4k; cd')
- # STB MIPS
+ # STB MIPS
elif getCPUtype() == 'MIPS':
#vuplus stb mtd1
if getBoxHostName() == 'bm750' or getBoxHostName() == 'vuduo' or getBoxHostName() == 'vusolo' or getBoxHostName() == 'vuuno' or getBoxHostName() == 'vuultimo':
- if fileExists ('/usr/sbin/nanddump'):
- os.system('cd ' + getNeoLocation() + 'ImagesUpload/.kernel/; /usr/sbin/nanddump /dev/mtd1 > vmlinux.gz; mv ./vmlinux.gz ./' + getBoxHostName() + '.vmlinux.gz' )
- elif not fileExists ('/usr/sbin/nanddump'):
- os.system('cd ' + getNeoLocation() + 'ImagesUpload/.kernel/; ' + LinkNeoBoot + '/bin/nanddump_mips /dev/mtd1 > vmlinux.gz; mv ./vmlinux.gz ./' + getBoxHostName() + '.vmlinux.gz' )
- os.system('cd ' + LinkNeoBoot + '/; rm ./bin/fontforneoboot.ttf; rm ./bin/libpngneo; mv ' + LinkNeoBoot + '/tmpfiles/target/vu_dev_mtd1.sh ' + LinkNeoBoot + '/files/kernel.sh;mv ' + LinkNeoBoot + '/tmpfiles/runpy/vu_mtd1_run.py ' + LinkNeoBoot + '/run.py; cd')
+ if fileExists('/usr/sbin/nanddump'):
+ os.system('cd ' + getNeoLocation() + 'ImagesUpload/.kernel/; /usr/sbin/nanddump /dev/mtd1 > vmlinux.gz; mv ./vmlinux.gz ./' + getBoxHostName() + '.vmlinux.gz')
+ elif not fileExists('/usr/sbin/nanddump'):
+ os.system('cd ' + getNeoLocation() + 'ImagesUpload/.kernel/; ' + LinkNeoBoot + '/bin/nanddump_mips /dev/mtd1 > vmlinux.gz; mv ./vmlinux.gz ./' + getBoxHostName() + '.vmlinux.gz')
+ os.system('cd ' + LinkNeoBoot + '/; rm ./bin/fontforneoboot.ttf; rm ./bin/libpngneo; mv ' + LinkNeoBoot + '/tmpfiles/target/vu_dev_mtd1.sh ' + LinkNeoBoot + '/files/kernel.sh;mv ' + LinkNeoBoot + '/tmpfiles/runpy/vu_mtd1_run.py ' + LinkNeoBoot + '/run.py; cd')
- #vuplus stb mtd2
+ #vuplus stb mtd2
elif getBoxHostName() == 'vusolo2' or getBoxHostName() == 'vuduo2' or getBoxHostName() == 'vusolose' or getBoxHostName() == 'vuzero':
- if fileExists ('/usr/sbin/nanddump'):
- os.system('cd ' + getNeoLocation() + 'ImagesUpload/.kernel/; /usr/sbin/nanddump /dev/mtd2 > vmlinux.gz; mv ./vmlinux.gz ./' + getBoxHostName() + '.vmlinux.gz' )
- elif not fileExists ('/usr/sbin/nanddump'):
- os.system('cd ' + getNeoLocation() + 'ImagesUpload/.kernel/; ' + LinkNeoBoot + '/bin/nanddump_mips /dev/mtd2 > vmlinux.gz; mv ./vmlinux.gz ./' + getBoxHostName() + '.vmlinux.gz' )
- os.system('cd ' + LinkNeoBoot + '/; rm ./bin/fontforneoboot.ttf; rm ./bin/libpngneo; mv ' + LinkNeoBoot + '/tmpfiles/target/vu_dev_mtd2.sh ' + LinkNeoBoot + '/files/kernel.sh; mv ' + LinkNeoBoot + '/tmpfiles/runpy/vu_mtd2_run.py ' + LinkNeoBoot + '/run.py; cd')
+ if fileExists('/usr/sbin/nanddump'):
+ os.system('cd ' + getNeoLocation() + 'ImagesUpload/.kernel/; /usr/sbin/nanddump /dev/mtd2 > vmlinux.gz; mv ./vmlinux.gz ./' + getBoxHostName() + '.vmlinux.gz')
+ elif not fileExists('/usr/sbin/nanddump'):
+ os.system('cd ' + getNeoLocation() + 'ImagesUpload/.kernel/; ' + LinkNeoBoot + '/bin/nanddump_mips /dev/mtd2 > vmlinux.gz; mv ./vmlinux.gz ./' + getBoxHostName() + '.vmlinux.gz')
+ os.system('cd ' + LinkNeoBoot + '/; rm ./bin/fontforneoboot.ttf; rm ./bin/libpngneo; mv ' + LinkNeoBoot + '/tmpfiles/target/vu_dev_mtd2.sh ' + LinkNeoBoot + '/files/kernel.sh; mv ' + LinkNeoBoot + '/tmpfiles/runpy/vu_mtd2_run.py ' + LinkNeoBoot + '/run.py; cd')
- #Other stb MIPS
- else:
+ #Other stb MIPS
+ else:
os.system('cd ' + LinkNeoBoot + '/; chmod 755 ./bin/nandwrite; mv ./bin/fontforneoboot.ttf /usr/share/fonts; mv ./bin/libpngneo /usr/lib; cp -f ./bin/neoinitmips /sbin/neoinitmips; cp -f ./bin/neoinitmipsvu /sbin/neoinitmipsvu; chmod 0755 /sbin/neoinit*; rm -f ./bin/neobm; mv ./bin/neobmmips ./bin/neobm; chmod 0755 ./bin/neobm; chmod 0755 /usr/lib/libpngneo; cd; chmod 0755 /sbin/neoinitmips; ln -sf /media/neoboot/ImageBoot/.neonextboot /etc/neoimage; mv ' + LinkNeoBoot + '/tmpfiles/runpy/mips_run.py ' + LinkNeoBoot + '/run.py; cd')
-
- os.system('cp -Rf ' + LinkNeoBoot + '/bin/neoinitmips /sbin/neoinitmips; cp -Rf ' + LinkNeoBoot + '/bin/neoinitmipsvu /sbin/neoinitmipsvu; chmod 755 /sbin/neoinit*')
+
+ os.system('cp -Rf ' + LinkNeoBoot + '/bin/neoinitmips /sbin/neoinitmips; cp -Rf ' + LinkNeoBoot + '/bin/neoinitmipsvu /sbin/neoinitmipsvu; chmod 755 /sbin/neoinit*')
os.system('chmod 755 ' + LinkNeoBoot + '/bin/nfidump; chmod 0755 ' + LinkNeoBoot + '/bin/nanddump_mips; rm -r ' + LinkNeoBoot + '/bin/neoinitar*; cd /')
if fileExists('' + LinkNeoBoot + '/bin/fontforneoboot.ttf'):
('cd ' + LinkNeoBoot + '/;mv ./bin/fontforneoboot.ttf /usr/share/fonts; cd /')
if fileExists('' + LinkNeoBoot + '/bin/libpngneo'):
- ('cd ' + LinkNeoBoot + '/;mv ./bin/libpngneo /usr/lib; chmod 0755 /usr/lib/libpngneo; cd /')
+ ('cd ' + LinkNeoBoot + '/;mv ./bin/libpngneo /usr/lib; chmod 0755 /usr/lib/libpngneo; cd /')
if fileExists('' + LinkNeoBoot + '/bin/neobm'):
('cd ' + LinkNeoBoot + '/;chmod 0755 ./bin/neobm; cd /')
else:
self.messagebox = self.session.open(MessageBox, _('The tuner is not supported by NeoBoot.\nContact the author.\nNo proper STB for installation !!!!'), type=MessageBox.TYPE_ERROR)
-
+
if fileExists('/home/root/vmlinux.gz'):
- os.system('mv -f /home/root/vmlinux.gz %sImagesUpload/.kernel/%s.vmlinux.gz' % (getNeoLocation(), getBoxHostName()) )
-
- if fileExists('' + LinkNeoBoot + '/ubi_reader_mips') or fileExists('' + LinkNeoBoot + '/ubi_reader_arm') and fileExists('' + LinkNeoBoot + '/ubi_reader'):
- os.system('rm -r ' + LinkNeoBoot + '/ubi_reader ')
-
- if getCPUtype() == 'ARMv7':
- os.system('cd ' + LinkNeoBoot + '/;chmod 755 ./files/findsk.sh; mv ./bin/fbcleararm ./bin/fbclear; chmod 755 ./bin/fbclear; rm -f ./bin/nandwrite; rm -f ./bin/fbclearmips; mv ./ubi_reader_arm ./ubi_reader; rm -r ./ubi_reader_mips; rm ./bin/neoinitmips; rm ./bin/neoinitmipsvu; rm -r ./bin/nanddump_mips; rm ./bin/nfidump; rm ./bin/neobmmips; rm ./bin/neobm; mv ./bin/neobmarm ./bin/neobm; rm ./bin/fontforneoboot.ttf; rm ./bin/libpngneo; cd')
- elif getCPUtype() == 'MIPS':
+ os.system('mv -f /home/root/vmlinux.gz %sImagesUpload/.kernel/%s.vmlinux.gz' % (getNeoLocation(), getBoxHostName()))
+
+ if fileExists('' + LinkNeoBoot + '/ubi_reader_mips') or fileExists('' + LinkNeoBoot + '/ubi_reader_arm') and fileExists('' + LinkNeoBoot + '/ubi_reader'):
+ os.system('rm -r ' + LinkNeoBoot + '/ubi_reader ')
+
+ if getCPUtype() == 'ARMv7':
+ os.system('cd ' + LinkNeoBoot + '/;chmod 755 ./files/findsk.sh; mv ./bin/fbcleararm ./bin/fbclear; chmod 755 ./bin/fbclear; rm -f ./bin/nandwrite; rm -f ./bin/fbclearmips; mv ./ubi_reader_arm ./ubi_reader; rm -r ./ubi_reader_mips; rm ./bin/neoinitmips; rm ./bin/neoinitmipsvu; rm -r ./bin/nanddump_mips; rm ./bin/nfidump; rm ./bin/neobmmips; rm ./bin/neobm; mv ./bin/neobmarm ./bin/neobm; rm ./bin/fontforneoboot.ttf; rm ./bin/libpngneo; cd')
+ elif getCPUtype() == 'MIPS':
os.system('cd ' + LinkNeoBoot + '/;rm -f ./files/findsk.sh; mv ./bin/fbclearmips ./bin/fbclear; chmod 755 ./bin/fbclear; rm -f ./bin/fbcleararm; mv ./ubi_reader_mips ./ubi_reader; rm -r ./ubi_reader_arm; rm -f /bin/neoinitarm; rm -f /bin/neoinitarmvu; rm -r ./bin/nanddump_arm; rm -f /bin/neoinitarmvuDuo4k; rm -f ./bin/neobmarm')
-
+
os.system(' ln -sfn ' + getNeoLocation() + 'ImageBoot/.neonextboot /etc/neoimage; chmod 644 ' + getNeoLocation() + 'ImagesUpload/.kernel/*; ln -sfn ' + getNeoLocation() + 'ImageBoot /etc/imageboot; rm -r ' + LinkNeoBoot + '/tmpfiles; chmod 0755 ' + LinkNeoBoot + '/files/kernel.sh')
-
- if os.path.isfile('' + LinkNeoBoot + '/.location'):
- if getLabelDisck() != 'LABEL=':
+
+ if os.path.isfile('' + LinkNeoBoot + '/.location'):
+ if getLabelDisck() != 'LABEL=':
cmd = "echo -e '\n%s '" % _('NeoBoot has been installed succesfully!\nNeoBoot has detected that the disks do not have a label.\nFor correct neo boot operation, please give the disks the name LABEL\nRecommended total restart of the tuner.\n')
- elif getLabelDisck() == 'LABEL=':
- cmd = "echo -e '\n%s '" % _('Installed succesfully NEOBOOT!\nNeoBoot has detected that the disks have been marked.\nRecommended total restart of the tuner\n')
- else:
- self.myclose2(_('NeoBoot has not been installed ! :(' ))
+ elif getLabelDisck() == 'LABEL=':
+ cmd = "echo -e '\n%s '" % _('Installed succesfully NEOBOOT!\nNeoBoot has detected that the disks have been marked.\nRecommended total restart of the tuner\n')
+ else:
+ self.myclose2(_('NeoBoot has not been installed ! :('))
if os.path.isfile('/etc/name'):
- self.myclose2(_('The plug-in has been successfully installed.' ))
+ self.myclose2(_('The plug-in has been successfully installed.'))
else:
if not fileExists('/etc/name'):
- os.system('touch /etc/name')
- closereboot = self.rebootSTBE2()
- self.session.open(Console, _('NeoBoot Install....'), [cmd])
- self.close(closereboot)
-
+ os.system('touch /etc/name')
+ closereboot = self.rebootSTBE2()
+ 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):
+
+ def rebootSTBE2(self):
restartbox = self.session.openWithCallback(self.RebootSTB, MessageBox, _('Reboot stb now ?'), MessageBox.TYPE_YESNO)
restartbox.setTitle(_('Reboot'))
def RebootSTB(self, answer):
if answer is True:
os.system('sync && echo 3 > /proc/sys/vm/drop_caches; reboot -d -f')
- else:
- self.close()
+ else:
+ self.close()
class NeoBootImageChoose(Screen):
- if isFHD():
+ if isFHD():
try:
from Plugins.Extensions.NeoBoot.usedskin import ImageChooseFULLHD
- skin=ImageChooseFULLHD
+ skin = ImageChooseFULLHD
except:
from Plugins.Extensions.NeoBoot.neoskins.default import ImageChooseFULLHD
- skin=ImageChooseFULLHD
+ skin = ImageChooseFULLHD
elif isUHD():
from Plugins.Extensions.NeoBoot.neoskins.default import ImageChooseULTRAHD
- skin=ImageChooseULTRAHD
+ skin = ImageChooseULTRAHD
else:
try:
from Plugins.Extensions.NeoBoot.usedskin import ImageChooseHD
- skin=ImageChooseHD
+ skin = ImageChooseHD
except:
from Plugins.Extensions.NeoBoot.neoskins.default import ImageChooseHD
- skin=ImageChooseHD
+ skin = ImageChooseHD
- def __init__(self, session):
+ def __init__(self, session):
Screen.__init__(self, session)
self.list = []
@@ -696,7 +700,7 @@ class NeoBootImageChoose(Screen):
self['key_menu'] = Label(_('More options'))
self['key_1'] = Label(_('Update NeoBot'))
self['key_2'] = Label(_('Reinstall NeoBoot'))
- self['key_3'] = Label(_('Reinstall kernel'))
+ self['key_3'] = Label(_('Reinstall kernel'))
self['label1'] = Label(_('Please choose an image to boot'))
self['label2'] = Label(_('NeoBoot is running from:'))
self['label3'] = Label('')
@@ -704,65 +708,64 @@ class NeoBootImageChoose(Screen):
self['label5'] = Label('')
self['label6'] = Label('')
self['label7'] = Label('')
- self['label8'] = Label(_('Number of images installed:'))
+ self['label8'] = Label(_('Number of images installed:'))
self['label9'] = Label('')
self['label10'] = Label('')
self['label11'] = Label('')
self['label12'] = Label('')
self['label13'] = Label(_('Version update: '))
self['label14'] = Label(_('NeoBoot version: '))
- self['label15'] = Label(_('Memory disc:'))
- self['label16'] = Label(_('Kernel'))
- self['label17'] = Label('')
- self['label18'] = Label('')
- self['label19'] = Label('')
- self['label20'] = Label('')
- self['label21'] = Label('NEO VIP')
+ self['label15'] = Label(_('Memory disc:'))
+ self['label16'] = Label(_('Kernel'))
+ self['label17'] = Label('')
+ self['label18'] = Label('')
+ self['label19'] = Label('')
+ self['label20'] = Label('')
+ self['label21'] = Label('NEO VIP')
self['actions'] = ActionMap(['WizardActions',
'ColorActions',
'MenuActions',
'NumberActionMap',
'SetupActions',
'number'], {'ok': self.bootIMG,
- 'red': self.DownloadImageOnline,
+ 'red': self.DownloadImageOnline,
'green': self.ImageInstall,
'yellow': self.removeIMG,
'blue': self.pomoc,
- 'menu': self.mytools,
+ 'menu': self.mytools,
'1': self.neoboot_update,
'2': self.ReinstallNeoBoot,
- '3': self.ReinstallKernel,
- '4': self.touch4, #hidden option
+ '3': self.ReinstallKernel,
+ '4': self.touch4, #hidden option
'5': self.touch5, #hidden option
- '6': self.touch6, #hidden option
+ '6': self.touch6, #hidden option
'7': self.touch7, #hidden option
'8': self.touch8, #hidden option
- '9': self.touch9, #hidden option
- '0': self.touch0, #hidden option
+ '9': self.touch9, #hidden option
+ '0': self.touch0, #hidden option
'back': self.close_exit})
- self.availablespace = 0
+ self.availablespace = 0
self.onShow.append(self.updateList)
if not fileExists('' + LinkNeoBoot + '/files/mountpoint.sh'):
getMountPointAll()
-
+
if not fileExists('' + LinkNeoBoot + '/files/neo.sh'):
getMountPointNeo()
-
+
if fileExists('/tmp/.init_reboot'):
system('rm /tmp/.init_reboot')
if fileExists('/.multinfo'):
if not fileExists('/.control_ok'):
- if fileExists('/.control_boot_new_image'):
- os.system('rm -f /.control_boot_new_image; echo "Image uruchomione OK\nNie kasuj tego pliku. \n\nImage started OK\nDo not delete this file." > /.control_ok ')
- 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')
+ if fileExists('/.control_boot_new_image'):
+ os.system('rm -f /.control_boot_new_image; echo "Image uruchomione OK\nNie kasuj tego pliku. \n\nImage started OK\nDo not delete this file." > /.control_ok ')
+ 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):
+ 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 ?---' )
+ message = _('Plugin ImageDownloader not installed!\nInstall plugin to download new image? \and---Continue ?---')
ybox = self.session.openWithCallback(self.InstallImageDownloader, MessageBox, message, MessageBox.TYPE_YESNO)
ybox.setTitle(_('Installation'))
else:
@@ -775,40 +778,41 @@ class NeoBootImageChoose(Screen):
mess = _('Sorry cannot open Image Downloader.\nAccess Fails with Error code 0x05.')
self.session.open(MessageBox, mess, MessageBox.TYPE_INFO)
- def InstallImageDownloader(self, yesno):
+ def InstallImageDownloader(self, yesno):
if yesno:
- if checkInternet():
+ if checkInternet():
cmd = 'mkdir /tmp/install; touch /tmp/install/plugin.txt; rm -rf /tmp/*.ipk'
system(cmd)
- if fileExists('/usr/bin/curl'):
+ if fileExists('/usr/bin/curl'):
os.system('cd /tmp; curl -O --ftp-ssl http://read.cba.pl/panel_extra/enigma2-plugin-extensions-imagedownloader_2.6_all.ipk')
- if not fileExists('/tmp/enigma2-plugin-extensions-imagedownloader_2.6_all.ipk'):
+ if not fileExists('/tmp/enigma2-plugin-extensions-imagedownloader_2.6_all.ipk'):
if fileExists('/usr/bin/fullwget'):
cmd1 = 'cd /tmp; fullwget --no-check-certificate http://read.cba.pl/panel_extra/enigma2-plugin-extensions-imagedownloader_2.6_all.ipk'
system(cmd1)
- if not fileExists('/tmp/enigma2-plugin-extensions-imagedownloader_2.6_all.ipk'):
- if fileExists('/usr/bin/wget'):
+ if not fileExists('/tmp/enigma2-plugin-extensions-imagedownloader_2.6_all.ipk'):
+ if fileExists('/usr/bin/wget'):
os.system('cd /tmp; wget --no-check-certificate http://read.cba.pl/panel_extra/enigma2-plugin-extensions-imagedownloader_2.6_all.ipk')
- if fileExists('/tmp/enigma2-plugin-extensions-imagedownloader_2.6_all.ipk'):
+ if fileExists('/tmp/enigma2-plugin-extensions-imagedownloader_2.6_all.ipk'):
cmd2 = 'opkg install --force-overwrite --force-reinstall --force-downgrade /tmp/enigma2-plugin-extensions-imagedownloader_2.6_all.ipk'
system(cmd2)
self.session.open(MessageBox, _('The plug-in has been successfully installed.'), MessageBox.TYPE_INFO, 5)
self.close()
else:
self.session.open(MessageBox, _('The plugin not installed.\nAccess Fails with Error code 0x04.'), MessageBox.TYPE_INFO, 10)
- self.close()
+ self.close()
else:
mess = _('Geen internet')
self.session.open(MessageBox, mess, MessageBox.TYPE_INFO)
else:
- mess = _('Upload image files in zip formats to the ImagesUpload location.' )
- self.session.open(MessageBox, mess, MessageBox.TYPE_INFO)
+ mess = _('Upload image files in zip formats to the ImagesUpload location.')
+ self.session.open(MessageBox, mess, MessageBox.TYPE_INFO)
- def chackkernel(self):
+ def chackkernel(self):
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):
+
+ def pomoc(self):
try:
from Plugins.Extensions.NeoBoot.files.tools import Opis
self.session.open(Opis)
@@ -816,18 +820,18 @@ class NeoBootImageChoose(Screen):
loggscrash = time.localtime(time.time())
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.\nAccess Fails with Error code 0x02.')
- self.session.open(MessageBox, mess, MessageBox.TYPE_INFO)
+ self.session.open(MessageBox, mess, MessageBox.TYPE_INFO)
- def ReinstallNeoBoot(self):
+ def ReinstallNeoBoot(self):
INSTALLbox = self.session.openWithCallback(self.reinstallboot, MessageBox, _('Select Yes to reinstall the neoboot.\n NEOBOOT.'), MessageBox.TYPE_YESNO)
INSTALLbox.setTitle(_('Reinstall neoboot'))
-
- def reinstallboot(self, answer):
+
+ def reinstallboot(self, answer):
if answer is True:
try:
cmd = "echo -e '\n\n%s '" % _('NEOBOOT - Please reinstall NeoBoot....\nPlease wait, done...\nrestart systemu...')
- cmd1 = 'cd ' + LinkNeoBoot + '/; rm ./bin/install; rm ./.location; rm ./files/mountpoint.sh; rm ./files/neo.sh; sleep 5; PATH=/sbin:/bin:/usr/sbin:/usr/bin; echo -n "Restarting E2... "; init 4; sleep 1; init 3 '
- except:
+ cmd1 = 'cd ' + LinkNeoBoot + '/; rm ./bin/install; rm ./.location; rm ./files/mountpoint.sh; rm ./files/neo.sh; sleep 5; PATH=/sbin:/bin:/usr/sbin:/usr/bin; echo -n "Restarting E2... "; init 4; sleep 1; init 3 '
+ except:
False
self.session.open(Console, _('NeoBoot ARM....'), [cmd, cmd1])
self.close()
@@ -837,48 +841,48 @@ class NeoBootImageChoose(Screen):
self.close()
except:
False
-
- def close_exit(self):
+
+ def close_exit(self):
system('touch /tmp/.init_reboot')
- if fileExists('/tmp/error_neo'):
+ if fileExists('/tmp/error_neo'):
try:
cmd = 'cat /tmp/error_neo'
cmd1 = ''
self.session.openWithCallback(self.close, Console, _('NeoBoot....'), [cmd,
- cmd1])
+ cmd1])
self.close()
except:
False
- if not fileExists('/tmp/.finishdate') or not fileExists('/tmp/.nkod') or fileExists('/.multinfo') :
- if checkInternet():
+ if not fileExists('/tmp/.finishdate') or not fileExists('/tmp/.nkod') or fileExists('/.multinfo'):
+ if checkInternet():
pass
else:
mess = _('Geen internet')
self.session.open(MessageBox, mess, MessageBox.TYPE_INFO)
-
- if not fileExists('/.multinfo'):
- out = open('%sImageBoot/.neonextboot' % getNeoLocation(), 'w' )
+
+ if not fileExists('/.multinfo'):
+ out = open('%sImageBoot/.neonextboot' % getNeoLocation(), 'w')
out.write('Flash')
out.close()
self.close()
-
- elif fileExists('/.multinfo'):
- with open('/.multinfo', 'r' ) as f:
+
+ elif fileExists('/.multinfo'):
+ with open('/.multinfo', 'r') as f:
imagefile = f.readline().strip()
f.close()
- out = open('%sImageBoot/.neonextboot'% getNeoLocation(), 'w' )
+ out = open('%sImageBoot/.neonextboot' % getNeoLocation(), 'w')
out.write(imagefile)
out.close()
else:
system('touch /tmp/.init_reboot')
- out = open('%sImageBoot/.neonextboot' % getNeoLocation() , 'w')
+ out = open('%sImageBoot/.neonextboot' % getNeoLocation(), 'w')
out.write('Flash')
out.close()
self.close()
-
- def ReinstallKernel(self):
+
+ def ReinstallKernel(self):
try:
from Plugins.Extensions.NeoBoot.files.tools import ReinstallKernel
self.session.open(ReinstallKernel)
@@ -886,9 +890,9 @@ class NeoBootImageChoose(Screen):
loggscrash = time.localtime(time.time())
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 Reinstall Kernel.\nAccess Fails with Error code 0x03.')
- self.session.open(MessageBox, mess, MessageBox.TYPE_INFO)
-
- def touch5(self):
+ self.session.open(MessageBox, mess, MessageBox.TYPE_INFO)
+
+ def touch5(self):
if fileExists('/usr/lib/periodon/.kodn'):
if getTestIn() == getTestOut():
pass
@@ -896,60 +900,66 @@ class NeoBootImageChoose(Screen):
system('touch /tmp/guto')
else:
system('touch /tmp/guto')
+
def touch4(self):
if fileExists('/usr/lib/periodon/.kodn'):
pass
else:
- if not fileExists('/tmp/guto'):
+ if not fileExists('/tmp/guto'):
pass
else:
system('touch /tmp/gutos')
+
def touch7(self):
if fileExists('/usr/lib/periodon/.kodn'):
pass
else:
- if not fileExists('/tmp/gutos'):
+ if not fileExists('/tmp/gutos'):
pass
else:
system('touch /tmp/gutosi')
+
def touch6(self):
if fileExists('/usr/lib/periodon/.kodn'):
pass
else:
if not fileExists('/tmp/gutosi'):
- pass
+ pass
else:
if not fileExists('/usr/lib/periodon'):
system('mkdir /usr/lib/periodon')
else:
if getButtonPin() == 'pinok':
- os.system('sleep 2; rm -f /tmp/gut*; date %s > /usr/lib/periodon/.accessdate' % UPDATEDATE )
- if fileExists('/usr/lib/periodon/.accessdate') and fileExists('/usr/lib/periodon/.kodn'):
+ os.system('sleep 2; rm -f /tmp/gut*; date %s > /usr/lib/periodon/.accessdate' % UPDATEDATE)
+ if fileExists('/usr/lib/periodon/.accessdate') and fileExists('/usr/lib/periodon/.kodn'):
mess = _('Bravo! Neoboot vip full version activated OK!\nPlease restart your system E2.')
self.session.open(MessageBox, mess, MessageBox.TYPE_INFO)
elif not fileExists('/usr/lib/periodon/.accessdate'):
mess = _('VIP Access Activation Fails with Error code 0x10.')
- self.session.open(MessageBox, mess, MessageBox.TYPE_INFO)
- elif not fileExists('/usr/lib/periodon/.kodn'):
+ self.session.open(MessageBox, mess, MessageBox.TYPE_INFO)
+ 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')
else:
- if not fileExists('/tmp/gutosie'):
+ if not fileExists('/tmp/gutosie'):
pass
else:
system('touch /tmp/gutosiep')
+
def touch8(self):
if fileExists('/usr/lib/periodon/.kodn'):
system('touch /tmp/gut2')
else:
- if not fileExists('/tmp/gutosiep'):
+ if not fileExists('/tmp/gutosiep'):
pass
else:
system('touch /tmp/gutosiepi')
- def touch0(self):
+
+ def touch0(self):
if fileExists('/usr/lib/periodon/.kodn'):
if not fileExists('/tmp/gut3'):
system('touch /tmp/gut3')
@@ -960,20 +970,21 @@ class NeoBootImageChoose(Screen):
else:
pass
else:
- if not fileExists('/tmp/gutosiepi'):
+ if not fileExists('/tmp/gutosiepi'):
pass
else:
system('touch /tmp/gutosiepin')
-# def neoboot_update(self):
+# def neoboot_update(self):
# mess = _('Updated unnecessary, you have the latest version. Please try again later.')
# self.session.open(MessageBox, mess, MessageBox.TYPE_INFO)
- #Zablokowanie aktualizacji przez zmiane nazwy neoboot_update na neoboot_update2 i likwidacja 3 lini hastagu wyzej
+ #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():
+ if checkInternet():
+ #if getTestInTime() == getTestOutTime() or getTestIn() != getTestOut():
#myerror = _('Sorry, this is not neoboot vip version.\nGet NEO-VIP version, more info press blue button.')
#self.session.open(MessageBox, myerror, MessageBox.TYPE_INFO)
#else:
@@ -981,7 +992,7 @@ class NeoBootImageChoose(Screen):
mess = _('Downloading available only from the image Flash.')
self.session.open(MessageBox, mess, MessageBox.TYPE_INFO)
else:
- out = open('%sImageBoot/.neonextboot' % getNeoLocation() , 'w')
+ out = open('%sImageBoot/.neonextboot' % getNeoLocation(), 'w')
out.write('Flash')
out.close()
message = _('\n\n\n')
@@ -995,21 +1006,21 @@ class NeoBootImageChoose(Screen):
mess = _('Geen internet')
self.session.open(MessageBox, mess, MessageBox.TYPE_INFO)
- def chackupdate2(self, yesno):
+ def chackupdate2(self, yesno):
if yesno:
self.chackupdate3()
else:
self.session.open(MessageBox, _('Canceled update.'), MessageBox.TYPE_INFO, 7)
-
- def chackupdate3(self):
- if fileExists('/usr/bin/fullwget'):
- os.system('cd ' + LinkNeoBoot + ';fullwget --no-check-certificate https://raw.githubusercontent.com/gutosie/neoboot/master/ver.txt; sleep 3;cd /')
+
+ def chackupdate3(self):
+ if fileExists('/usr/bin/fullwget'):
+ os.system('cd ' + LinkNeoBoot + ';fullwget --no-check-certificate https://raw.githubusercontent.com/gutosie/neoboot/master/ver.txt; sleep 3;cd /')
if not fileExists('' + LinkNeoBoot + '/ver.txt'):
- if fileExists('/usr/bin/curl'):
+ if fileExists('/usr/bin/curl'):
os.system('cd ' + LinkNeoBoot + ';curl -O --ftp-ssl https://raw.githubusercontent.com/gutosie/neoboot/master/ver.txt;sleep 3;cd /')
if not fileExists('' + LinkNeoBoot + '/ver.txt'):
- if fileExists('/usr/bin/wget'):
- os.system('cd ' + LinkNeoBoot + ';wget --no-check-certificate https://raw.githubusercontent.com/gutosie/neoboot/master/ver.txt; sleep 3;cd /')
+ if fileExists('/usr/bin/wget'):
+ os.system('cd ' + LinkNeoBoot + ';wget --no-check-certificate https://raw.githubusercontent.com/gutosie/neoboot/master/ver.txt; sleep 3;cd /')
if fileExists('' + LinkNeoBoot + '/ver.txt'):
mypath = ''
version = open('' + LinkNeoBoot + '/ver.txt', 'r')
@@ -1020,9 +1031,9 @@ class NeoBootImageChoose(Screen):
ybox = self.session.openWithCallback(self.aktualizacjamboot, MessageBox, message, MessageBox.TYPE_YESNO)
ybox.setTitle(_('Updating ... '))
elif fileExists('' + LinkNeoBoot + '/ver.txt'):
- os.system('rm ' + LinkNeoBoot + '/ver.txt')
+ os.system('rm ' + LinkNeoBoot + '/ver.txt')
if fileExists('' + LinkNeoBoot + '/wget-log'):
- os.system('rm ' + LinkNeoBoot + '/wget-log')
+ os.system('rm ' + LinkNeoBoot + '/wget-log')
self.session.open(MessageBox, _('Updated unnecessary, you have the latest version. Please try again later.'), MessageBox.TYPE_INFO)
else:
self.session.open(MessageBox, _('Unfortunately, at the moment not found an update, try again later.'), MessageBox.TYPE_INFO, 10)
@@ -1030,7 +1041,7 @@ class NeoBootImageChoose(Screen):
if not fileExists('' + LinkNeoBoot + '/ver.txt'):
self.session.open(MessageBox, _('Unfortunately, at the moment not found an update, try again later.'), MessageBox.TYPE_INFO, 10)
- def aktualizacjamboot(self, yesno):
+ def aktualizacjamboot(self, yesno):
if yesno:
if fileExists('/tmp/*.zip'):
os.system('rm /tmp/*.zip')
@@ -1038,14 +1049,14 @@ class NeoBootImageChoose(Screen):
os.system('cd /tmp; curl -O --ftp-ssl https://github.com/gutosie/neoboot/archive/main.zip; unzip -qn ./main.zip; sleep 2;cd /')
if not fileExists('/tmp/neoboot-main/NeoBoot'):
if fileExists('/tmp/main.zip'):
- os.system('rm -r /tmp/main.zip')
- if fileExists('/usr/bin/fullwget'):
- os.system('cd /tmp; fullwget --no-check-certificate https://github.com/gutosie/neoboot/archive/main.zip; unzip -qn ./main.zip; sleep 2;cd /')
+ os.system('rm -r /tmp/main.zip')
+ if fileExists('/usr/bin/fullwget'):
+ os.system('cd /tmp; fullwget --no-check-certificate https://github.com/gutosie/neoboot/archive/main.zip; unzip -qn ./main.zip; sleep 2;cd /')
if not fileExists('/tmp/neoboot-main/NeoBoot'):
if fileExists('/tmp/main.zip'):
- os.system('rm -r /tmp/main.zip')
- if fileExists('/usr/bin/wget'):
- os.system('cd /tmp; rm ./*.zip; wget --no-check-certificate https://github.com/gutosie/neoboot/archive/main.zip; unzip -qn ./main.zip; sleep 2;cd / ')
+ os.system('rm -r /tmp/main.zip')
+ if fileExists('/usr/bin/wget'):
+ os.system('cd /tmp; rm ./*.zip; wget --no-check-certificate https://github.com/gutosie/neoboot/archive/main.zip; unzip -qn ./main.zip; sleep 2;cd / ')
if not fileExists('/tmp/neoboot-main/NeoBoot'):
self.session.open(MessageBox, _('Unfortunately, at the moment not found an update, try again later.'), MessageBox.TYPE_INFO, 10)
else:
@@ -1054,25 +1065,24 @@ class NeoBootImageChoose(Screen):
os.system('rm -f ' + LinkNeoBoot + '/ver.txt')
self.session.open(MessageBox, _('The update has been canceled.'), MessageBox.TYPE_INFO, 8)
- def goUpdateNEO(self):
+ def goUpdateNEO(self):
if fileExists('' + LinkNeoBoot + '/wget-log'):
- os.system('rm ' + LinkNeoBoot + '/wget-log')
- os.system('cd /tmp/; cp -rf ./neoboot-main/NeoBoot /usr/lib/enigma2/python/Plugins/Extensions; rm -rf /tmp/neoboot*; rm ' + LinkNeoBoot + '/ver.txt; cd ' + LinkNeoBoot + '/; chmod 0755 ./bin/neoini*; chmod 0755 ./ex_init.py; chmod 0755 ./tmpfiles/target/*; chmod 0755 ./files/userscript.sh; cd /; date %s > /usr/lib/periodon/.accessdate' % UPDATEDATE)
+ os.system('rm ' + LinkNeoBoot + '/wget-log')
+ os.system('cd /tmp/; cp -rf ./neoboot-main/NeoBoot /usr/lib/enigma2/python/Plugins/Extensions; rm -rf /tmp/neoboot*; rm ' + LinkNeoBoot + '/ver.txt; cd ' + LinkNeoBoot + '/; chmod 0755 ./bin/neoini*; chmod 0755 ./ex_init.py; chmod 0755 ./tmpfiles/target/*; chmod 0755 ./files/userscript.sh; cd /; date %s > /usr/lib/periodon/.accessdate' % UPDATEDATE)
if getCPUtype() == 'MIPS':
- os.system('cd ' + LinkNeoBoot + '/; cp -rf ./bin/neoinitmipsvu /sbin; chmod 755 /sbin/neoinitmipsvu; cp -rf ./bin/neoinitmips /sbin; chmod 755 /sbin/neoinitmips; cd')
+ os.system('cd ' + LinkNeoBoot + '/; cp -rf ./bin/neoinitmipsvu /sbin; chmod 755 /sbin/neoinitmipsvu; cp -rf ./bin/neoinitmips /sbin; chmod 755 /sbin/neoinitmips; cd')
os.system('cd ' + LinkNeoBoot + '/; rm ./bin/install; rm -f ./files/testinout; rm ./files/mountpoint.sh; rm ./files/neo.sh; rm -f /usr/lib/periodon/.kodn; rm -f /tmp/.nkod; rm -rf /tmp/main.zip')
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')
+ def restartGUI(self, answer):
+ if answer is True:
+ os.system('rm -f ' + LinkNeoBoot + '/.location; rm -r ' + LinkNeoBoot + '/ubi_reader')
self.session.open(TryQuitMainloop, 3)
else:
self.close()
- def MBBackup(self):
+ def MBBackup(self):
try:
from Plugins.Extensions.NeoBoot.files.tools import MBBackup
self.session.open(MBBackup)
@@ -1080,8 +1090,9 @@ class NeoBootImageChoose(Screen):
loggscrash = time.localtime(time.time())
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):
+ self.session.open(MessageBox, mess, MessageBox.TYPE_INFO)
+
+ def MBRestore(self):
try:
from Plugins.Extensions.NeoBoot.files.tools import MBRestore
self.session.open(MBRestore)
@@ -1089,9 +1100,9 @@ class NeoBootImageChoose(Screen):
loggscrash = time.localtime(time.time())
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 Restore.\nAccess Fails with Error code 0x61.')
- self.session.open(MessageBox, mess, MessageBox.TYPE_INFO)
-
- def updateList(self):
+ self.session.open(MessageBox, mess, MessageBox.TYPE_INFO)
+
+ def updateList(self):
self.list = []
pluginpath = '' + LinkNeoBoot + ''
f = open(pluginpath + '/.location', 'r')
@@ -1108,10 +1119,10 @@ class NeoBootImageChoose(Screen):
icon = 'dev_cf.png'
elif 'ssd' in mypath:
icon = 'dev_ssd.png'
-
+
icon = pluginpath + '/images/' + icon
png = LoadPixmap(icon)
- self['device_icon'].instance.setPixmap(png)
+ self['device_icon'].instance.setPixmap(png)
linesdevice = open('' + LinkNeoBoot + '/.location', 'r').readlines()
deviceneo = linesdevice[0][0:-1]
device = deviceneo
@@ -1124,7 +1135,7 @@ class NeoBootImageChoose(Screen):
line = line.replace('part1', ' ')
parts = line.strip().split()
totsp = len(parts) - 1
- if parts[totsp] == device:
+ if parts[totsp] == device:
if totsp == 5:
ustot = parts[1]
usfree = parts[3]
@@ -1139,7 +1150,7 @@ class NeoBootImageChoose(Screen):
os.remove('/tmp/memoryinfo.tmp')
perc = int(usperc[0:-1])
-# perc = int() # jak czasami robi error to odhaszowac i zahaszowac wyzej
+# perc = int() # jak czasami robi error to odhaszowac i zahaszowac wyzej
self['progreso'].setValue(perc)
green = '#00389416'
red = '#00ff2525'
@@ -1162,14 +1173,14 @@ class NeoBootImageChoose(Screen):
pass
self.availablespace = usfree[0:-3]
-
+
strview = _('Used: ') + usperc + _(' \n Available: ') + usfree[0:-3] + ' MB'
self['label3'].setText(strview)
strview2 = _('Free Space : ') + usfree[0:-3] + ' MB'
self['label11'].setText(strview2)
- strview1 = _('Capacity : ') + usperc + _(' Full')
+ strview1 = _('Capacity : ') + usperc + _(' Full')
self['label18'].setText(strview1)
try:
@@ -1200,7 +1211,7 @@ class NeoBootImageChoose(Screen):
f2.close()
self['label6'].setText(mypath3)
else:
- f2 = open('%sImageBoot/.neonextboot' % getNeoLocation() , 'r' )
+ f2 = open('%sImageBoot/.neonextboot' % getNeoLocation(), 'r')
mypath3 = f2.readline().strip()
f2.close()
self['label6'].setText(mypath3)
@@ -1213,27 +1224,27 @@ class NeoBootImageChoose(Screen):
self['label7'].setText(str(len(self.list) - 1))
self['config'].setList(self.list)
- strview = PLUGINVERSION
+ strview = PLUGINVERSION
self['label9'].setText(strview)
KERNELVERSION = getKernelImageVersion()
- strview = KERNELVERSION
+ strview = KERNELVERSION
self['label20'].setText(strview)
- self['label17'].setText(readline('/etc/hostname'))
- self['label19'].setText(readline('%sImagesUpload/.kernel/used_flash_kernel' % getNeoLocation() ))
+ self['label17'].setText(readline('/etc/hostname'))
+ self['label19'].setText(readline('%sImagesUpload/.kernel/used_flash_kernel' % getNeoLocation()))
strview = UPDATEVERSION
self['label10'].setText(strview)
- def mytools(self):
+ def mytools(self):
if not fileExists('/.multinfo'):
if getTestIn() == getTestOut():
if getAccessN() == '1234':
- if (getSupportedTuners()) == (getBoxHostName()):
- try:
- from Plugins.Extensions.NeoBoot.files.tools import MBTools
- self.session.open(MBTools)
+ if (getSupportedTuners()) == (getBoxHostName()):
+ try:
+ from Plugins.Extensions.NeoBoot.files.tools import MBTools
+ self.session.open(MBTools)
#except:
except Exception as e:
loggscrash = time.localtime(time.time())
@@ -1245,7 +1256,7 @@ class NeoBootImageChoose(Screen):
self.session.open(MessageBox, mess, MessageBox.TYPE_INFO)
else:
myerror = _('Sorry, this is not neoboot vip version.\nGet NEO-VIP version, more info press blue button.')
- self.session.open(MessageBox, myerror, MessageBox.TYPE_INFO)
+ self.session.open(MessageBox, myerror, MessageBox.TYPE_INFO)
else:
myerror = _('Sorry, this is not neoboot vip version.\nGet NEO-VIP version, more info press blue button or try to update.')
@@ -1259,8 +1270,8 @@ 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. Access Fails with Error code 0x50.')
self.session.open(MessageBox, mess, MessageBox.TYPE_INFO)
-
- def removeIMG(self):
+
+ def removeIMG(self):
self.mysel = self['config'].getCurrent()
if 'Flash' in self.mysel:
self.mysel = 'Flash'
@@ -1277,32 +1288,32 @@ class NeoBootImageChoose(Screen):
self.session.open(MessageBox, _('Sorry you cannot delete the image currently booted from.'), MessageBox.TYPE_INFO, 5)
else:
- out = open('%sImageBoot/.neonextboot' % getNeoLocation(), 'w' )
+ out = open('%sImageBoot/.neonextboot' % getNeoLocation(), 'w')
out.write('Flash')
out.close()
message = _('Delete the selected image - ') + self.mysel + _('\nDelete ?')
ybox = self.session.openWithCallback(self.RemoveIMAGE, MessageBox, message, MessageBox.TYPE_YESNO)
ybox.setTitle(_('Delete Confirmation'))
except:
- print ("no image to remove")
+ print("no image to remove")
else:
self.mysel
- def up(self):
+ def up(self):
self.list = []
self['config'].setList(self.list)
self.updateList()
- def up2(self):
+ def up2(self):
try:
self.list = []
self['config'].setList(self.list)
self.updateList()
except:
- print (" ")
+ print(" ")
- def RemoveIMAGE(self, yesno):
+ def RemoveIMAGE(self, yesno):
if yesno:
cmd = _("echo -e 'Deleting in progress...\n'")
cmd1 = 'chattr -i %sImageBoot/' % getNeoLocation() + self.mysel
@@ -1311,8 +1322,7 @@ class NeoBootImageChoose(Screen):
else:
self.session.open(MessageBox, _('Removing canceled!'), MessageBox.TYPE_INFO)
-
- def ImageInstall(self):
+ def ImageInstall(self):
if not fileExists('/.multinfo'):
if getAccessN() != '1234': #%s' % UPDATEVERSION
count = 0
@@ -1324,7 +1334,7 @@ class NeoBootImageChoose(Screen):
if count > 1:
myerror = _('Sorry, you can install up to 2 images, this is not neoboot vip version.\nGet unlimited image installations in VIP version')
self.session.open(MessageBox, myerror, MessageBox.TYPE_INFO)
- elif int(self.availablespace) < 500:
+ elif int(self.availablespace) < 500:
myerror = _('Not enough free space on /media/ !!\nYou need at least 500Mb free space.\n\nExit plugin.')
self.session.open(MessageBox, myerror, MessageBox.TYPE_INFO)
else:
@@ -1336,7 +1346,7 @@ class NeoBootImageChoose(Screen):
myerror = _('Sorry, this is not neoboot vip version.\nGet NEO-VIP version, more info press blue button or try to update.')
self.session.open(MessageBox, myerror, MessageBox.TYPE_INFO)
else:
- self.ImageInstallTestOK()
+ self.ImageInstallTestOK()
def ImageInstallTestOK(self):
if int(self.availablespace) < 500:
@@ -1355,7 +1365,7 @@ class NeoBootImageChoose(Screen):
mess = _('Your receiver is not on the list of supported tuners.\nAccess error with error code 0x71.')
self.session.open(MessageBox, mess, MessageBox.TYPE_INFO)
- def GOImageInstall(self):
+ def GOImageInstall(self):
if fileExists('/.multinfo'):
message = _('Installing new neoboot software, only recommended from Flash!!!\n---Continue ?---')
ybox = self.session.openWithCallback(self.installation_image, MessageBox, message, MessageBox.TYPE_YESNO)
@@ -1367,11 +1377,11 @@ class NeoBootImageChoose(Screen):
def installation_image(self, yesno):
if yesno:
- self.extractImage()
+ self.extractImage()
else:
self.messagebox = self.session.open(MessageBox, _('It is recommended to install new software only from a flash system.\n---NEOBOOT EXIT---'), MessageBox.TYPE_INFO, 10)
self.close()
-
+
def extractImage(self):
if fileExists('%sImageBoot/.without_copying' % getNeoLocation()):
system('rm -f %sImageBoot/.without_copying' % getNeoLocation())
@@ -1380,26 +1390,26 @@ class NeoBootImageChoose(Screen):
system('mkdir %sImagesUpload' % getNeoLocation())
images = False
- myimages=listdir('%sImagesUpload' % getNeoLocation())
- print (myimages)
+ myimages = listdir('%sImagesUpload' % getNeoLocation())
+ print(myimages)
for fil in myimages:
if fil.endswith(".zip"):
- images=True
+ images = True
break
if os.path.exists('%sImagesUpload/*zip' % getNeoLocation()):
- images=True
+ images = True
break
if os.path.exists('%sImagesUpload/*.tar.bz2' % getNeoLocation()):
- images=True
+ images = True
break
if fil.endswith(".tar.xz"):
- images=True
+ images = True
break
if fil.endswith(".nfi"):
- images=True
+ images = True
break
else:
- images=False
+ images = False
if images is True:
self.ImageTrue()
else:
@@ -1413,32 +1423,32 @@ class NeoBootImageChoose(Screen):
loggscrash = time.localtime(time.time())
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 instalation menu.\nAccess error with error code 0x72.')
- self.session.open(MessageBox, mess, MessageBox.TYPE_INFO)
-
+ self.session.open(MessageBox, mess, MessageBox.TYPE_INFO)
+
def DownloaderImage(self):
if not os.path.exists('/usr/lib/enigma2/python/Plugins/Extensions/ImageDownloader/download.py'):
- message = (_('The %sImagesUpload directory is EMPTY!!!\nInstall the plugin to download new image online ?\n --- Continue? ---') % getNeoLocation() )
+ message = (_('The %sImagesUpload directory is EMPTY!!!\nInstall the plugin to download new image online ?\n --- Continue? ---') % getNeoLocation())
ybox = self.session.openWithCallback(self.ImageDownloader, MessageBox, message, MessageBox.TYPE_YESNO)
ybox.setTitle(_('Installation'))
elif fileExists('/usr/lib/python3.8') and fileExists('/.multinfo'):
- self.session.open(MessageBox, _('Sorry, cannot open neo menu install image.'), type=MessageBox.TYPE_ERROR)
+ self.session.open(MessageBox, _('Sorry, cannot open neo menu install image.'), type=MessageBox.TYPE_ERROR)
else:
- message = (_('Catalog %sImagesUpload directory is empty\nPlease upload the image files in zip or nfi formats to install') % getNeoLocation() )
+ message = (_('Catalog %sImagesUpload directory is empty\nPlease upload the image files in zip or nfi formats to install') % getNeoLocation())
self.session.open(MessageBox, message, MessageBox.TYPE_INFO)
-
- def ImageDownloader(self, yesno):
- if checkInternet():
+
+ def ImageDownloader(self, yesno):
+ if checkInternet():
if yesno:
cmd = 'mkdir /tmp/install; touch /tmp/install/plugin.txt; rm -rf /tmp/*.ipk'
system(cmd)
- if fileExists('/usr/bin/fullwget'):
- os.system('cd /tmp; wget http://read.cba.pl/panel_extra/enigma2-plugin-extensions-imagedownloader_2.6_all.ipk')
+ if fileExists('/usr/bin/fullwget'):
+ os.system('cd /tmp; wget http://read.cba.pl/panel_extra/enigma2-plugin-extensions-imagedownloader_2.6_all.ipk')
if not fileExists('/tmp/enigma2-plugin-extensions-imagedownloader_2.6_all.ipk'):
- if fileExists('/usr/bin/curl'):
+ if fileExists('/usr/bin/curl'):
os.system('sync; cd /tmp; curl -O --ftp-ssl http://read.cba.pl/panel_extra/enigma2-plugin-extensions-imagedownloader_2.6_all.ipk')
if not fileExists('/tmp/enigma2-plugin-extensions-imagedownloader_2.6_all.ipk'):
- if fileExists('/usr/bin/wget'):
- os.system('cd /tmp;rm ./*.zip; wget --no-check-certificate http://read.cba.pl/panel_extra/enigma2-plugin-extensions-imagedownloader_2.6_all.ipk')
+ if fileExists('/usr/bin/wget'):
+ os.system('cd /tmp;rm ./*.zip; wget --no-check-certificate http://read.cba.pl/panel_extra/enigma2-plugin-extensions-imagedownloader_2.6_all.ipk')
if not fileExists('/tmp/enigma2-plugin-extensions-imagedownloader_2.6_all.ipk'):
self.session.open(MessageBox, _('Unfortunately, at the moment not found an update, try again later.'), MessageBox.TYPE_INFO, 10)
else:
@@ -1447,8 +1457,8 @@ class NeoBootImageChoose(Screen):
self.session.open(MessageBox, _('The plug-in has been successfully installed.'), MessageBox.TYPE_INFO, 5)
self.close()
else:
- mess = (_('Directory %sImagesUpload is empty\nPlease upload the image files in zip or nfi formats to install') % getNeoLocation() )
- self.session.open(MessageBox, mess, MessageBox.TYPE_INFO)
+ mess = (_('Directory %sImagesUpload is empty\nPlease upload the image files in zip or nfi formats to install') % getNeoLocation())
+ self.session.open(MessageBox, mess, MessageBox.TYPE_INFO)
else:
mess = _('Geen internet')
self.session.open(MessageBox, mess, MessageBox.TYPE_INFO)
@@ -1461,20 +1471,20 @@ class NeoBootImageChoose(Screen):
myerror = _('Sorry, this is not neoboot vip version.\nGet NEO-VIP version, more info press blue button.')
self.session.open(MessageBox, myerror, MessageBox.TYPE_INFO)
else:
- self.bootIMG2()
-
- def bootIMG2(self):
+ self.bootIMG2()
+
+ def bootIMG2(self):
self.mysel = self['config'].getCurrent()
if 'Flash' in self.mysel:
self.mysel = 'Flash'
if self.mysel:
- out = open('' + getNeoLocation() + 'ImageBoot/.neonextboot', 'w' )
+ out = open('' + getNeoLocation() + 'ImageBoot/.neonextboot', 'w')
out.write(self.mysel)
out.close()
-
+
if getImageNeoBoot() != "Flash":
- if not fileExists('%sImageBoot/%s/.control_ok' % ( getNeoLocation(), getImageNeoBoot())):
- message = _('After successful launch of the selected software\nyou must run the neoboot plugin\nif the software does not start or neoboot is not confirmed\nthe system will return to the internal flash memory\n\nPress OK or exit on the remote control to continue...' )
+ if not fileExists('%sImageBoot/%s/.control_ok' % (getNeoLocation(), getImageNeoBoot())):
+ message = _('After successful launch of the selected software\nyou must run the neoboot plugin\nif the software does not start or neoboot is not confirmed\nthe system will return to the internal flash memory\n\nPress OK or exit on the remote control to continue...')
ybox = self.session.openWithCallback(self.StartReboot, MessageBox, message, MessageBox.TYPE_YESNO)
ybox.setTitle(_('First start of software'))
else:
@@ -1494,9 +1504,9 @@ class NeoBootImageChoose(Screen):
loggscrash = time.localtime(time.time())
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 run file - Access Fails with Error code 0x40.')
- self.session.open(MessageBox, mess, MessageBox.TYPE_INFO)
-
- def StartReboot(self, yesno):
+ self.session.open(MessageBox, mess, MessageBox.TYPE_INFO)
+
+ def StartReboot(self, yesno):
if yesno:
try:
from Plugins.Extensions.NeoBoot.run import StartImage
@@ -1505,16 +1515,16 @@ class NeoBootImageChoose(Screen):
loggscrash = time.localtime(time.time())
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. Hymmm...\nAccess Fails with Error code 0x73.')
- self.session.open(MessageBox, mess, MessageBox.TYPE_INFO)
+ self.session.open(MessageBox, mess, MessageBox.TYPE_INFO)
else:
self.close()
- def myClose(self, message):
+ def myClose(self, message):
self.session.open(MessageBox, message, MessageBox.TYPE_INFO)
self.close()
-def readline(filename, iferror = ''):
+def readline(filename, iferror=''):
if iferror[:3] == 'or:':
data = iferror[3:]
else:
@@ -1528,11 +1538,13 @@ def readline(filename, iferror = ''):
PrintException()
return data
+
def checkInternet():
- if fileExists('/usr/lib/python3.8'):
+ if fileExists('/usr/lib/python3.8'):
return True
else:
- import urllib2, urllib
+ import urllib2
+ import urllib
try:
response = urllib2.urlopen("http://google.com", None, 5)
response.close()
@@ -1543,14 +1555,16 @@ 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'):
+ 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'):
mycheck = False
else:
mycheck = True
return mycheck
+
def main(session, **kwargs):
vip = checkimage()
if vip == 1:
@@ -1566,22 +1580,22 @@ def main(session, **kwargs):
os.system('date "+%Y%m%d" > /tmp/.finishdate')
if fileExists('/tmp/.nkod'):
pass
- else:
+ else:
if not fileExists('/tmp/ver.txt'):
- if fileExists('/usr/bin/curl'):
+ if fileExists('/usr/bin/curl'):
os.system('cd /tmp; curl -O --ftp-ssl https://raw.githubusercontent.com/gutosie/neoboot/master/ver.txt; cd /')
if not fileExists('/tmp/ver.txt'):
- if fileExists('/usr/bin/wget'):
- os.system('cd /tmp; wget --no-check-certificate https://raw.githubusercontent.com/gutosie/neoboot/master/ver.txt; cd /')
+ if fileExists('/usr/bin/wget'):
+ os.system('cd /tmp; wget --no-check-certificate https://raw.githubusercontent.com/gutosie/neoboot/master/ver.txt; cd /')
if not fileExists('/tmp/ver.txt'):
- if fileExists('/usr/bin/fullwget'):
- os.system('cd /tmp; fullwget --no-check-certificate https://raw.githubusercontent.com/gutosie/neoboot/master/ver.txt; cd /')
+ if fileExists('/usr/bin/fullwget'):
+ os.system('cd /tmp; fullwget --no-check-certificate https://raw.githubusercontent.com/gutosie/neoboot/master/ver.txt; cd /')
if fileExists('/tmp/ver.txt'):
os.system('mv /tmp/ver.txt /tmp/.nkod ;cd /')
else:
os.system(_('echo %s > /tmp/.nkod') % UPDATEVERSION)
from Plugins.Extensions.NeoBoot.files.stbbranding import getCheckInstal1, getCheckInstal2, getCheckInstal3
- if fileExists('/tmp/error_neo') :
+ if fileExists('/tmp/error_neo'):
if fileExists('/tmp/error_neo'):
os.system('rm -f /tmp/error_neo')
if getCheckInstal1() == '1':
@@ -1596,7 +1610,7 @@ def main(session, **kwargs):
if not fileExists('/usr/lib/periodon/.kodn'):
session.open(MessageBox, _('Get a free test to the full vip version.'), type=MessageBox.TYPE_ERROR)
elif fileExists('/usr/lib/periodon/.kodn') and fileExists('/tmp/.nkod'):
- if checkInternet():
+ if checkInternet():
if getTestToTest() != UPDATEVERSION:
session.open(MessageBox, _('New version update neoboot is available!\nPlease upgrade your flash plugin.'), type=MessageBox.TYPE_ERROR)
else:
@@ -1605,7 +1619,7 @@ def main(session, **kwargs):
session.open(MessageBox, _('VIP access error. Reinstall the plugin.'), type=MessageBox.TYPE_ERROR)
if getAccesDate() == 'timeoff': #timeoff
session.open(MessageBox, _('Neoboot vip version has expired, please re-access.'), type=MessageBox.TYPE_ERROR)
-
+
version = 0
if fileExists('%sImageBoot/.version' % getNeoLocation()):
f = open('%sImageBoot/.version' % getNeoLocation())
@@ -1613,14 +1627,14 @@ def main(session, **kwargs):
f.close()
if fileExists('' + LinkNeoBoot + '/.location') and fileExists('%sImageBoot/.neonextboot' % getNeoLocation()):
- f2 = open('%sImageBoot/.neonextboot' % getNeoLocation(), 'r' )
+ f2 = open('%sImageBoot/.neonextboot' % getNeoLocation(), 'r')
mypath2 = f2.readline().strip()
- f2.close()
+ f2.close()
if mypath2 != 'Flash' or mypath2 == 'Flash' and checkimage():
-
+
if fileExists('/.multinfo'):
- session.open(NeoBootImageChoose)
- else:
+ session.open(NeoBootImageChoose)
+ else:
if float(PLUGINVERSION) != version:
session.open(MyUpgrade)
else:
@@ -1634,7 +1648,8 @@ def main(session, **kwargs):
session.open(MessageBox, _('Sorry cannot open neo menu. Not supported tuners. '), type=MessageBox.TYPE_ERROR)
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'),
@@ -1643,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)]
diff --git a/NeoBoot/tmpfiles/runpy/arm_run.py b/NeoBoot/tmpfiles/runpy/arm_run.py
index b14fe04..17e9d79 100644
--- a/NeoBoot/tmpfiles/runpy/arm_run.py
+++ b/NeoBoot/tmpfiles/runpy/arm_run.py
@@ -2,7 +2,7 @@
#from __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 eTimer
from Screens.Screen import Screen
@@ -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 """
__module__ = __name__
+
def __init__(self, session):
Screen.__init__(self, session)
self.list = []
@@ -84,10 +86,10 @@ class StartImage(Screen):
def KeyOk(self):
if getImageNeoBoot() != 'Flash':
- os.system('rm -rf %sImageBoot/%s/usr/bin/enigma2_pre_start.sh' % ( getNeoLocation(), getImageNeoBoot()))
+ os.system('rm -rf %sImageBoot/%s/usr/bin/enigma2_pre_start.sh' % (getNeoLocation(), getImageNeoBoot()))
self.StartImageInNeoBoot()
else:
- os.system('rm -rf %sImageBoot/%s/usr/bin/enigma2_pre_start.sh' % ( getNeoLocation(), getImageNeoBoot()))
+ os.system('rm -rf %sImageBoot/%s/usr/bin/enigma2_pre_start.sh' % (getNeoLocation(), getImageNeoBoot()))
self.StartImageInNeoBoot()
#---------------------------------------------
@@ -96,12 +98,12 @@ class StartImage(Screen):
def StartImageInNeoBoot(self):
if getImageNeoBoot() != 'Flash':
- if fileExists('%sImageBoot/%s/.control_ok' % ( getNeoLocation(), getImageNeoBoot())):
+ if fileExists('%sImageBoot/%s/.control_ok' % (getNeoLocation(), getImageNeoBoot())):
system('touch /tmp/.control_ok ')
else:
- system('touch %sImageBoot/%s/.control_boot_new_image ' % ( getNeoLocation(), getImageNeoBoot() ))
+ system('touch %sImageBoot/%s/.control_boot_new_image ' % (getNeoLocation(), getImageNeoBoot()))
if fileExists('/.multinfo') and getCPUtype() == 'ARMv7':
- os.system(' ' +LinkNeoBoot+ '/files/findsk.sh; mkdir -p /media/InternalFlash; mount /tmp/root /media/InternalFlash')
+ os.system(' ' + LinkNeoBoot + '/files/findsk.sh; mkdir -p /media/InternalFlash; mount /tmp/root /media/InternalFlash')
self.sel = self['list'].getCurrent()
if self.sel:
@@ -119,61 +121,61 @@ class StartImage(Screen):
os.system('rm -f /media/InternalFlash/linuxrootfs3/etc/init.d/neobootmount.sh;')
elif fileExists('/media/InternalFlash/linuxrootfs4/etc/init.d/neobootmount.sh'):
os.system('rm -f /media/InternalFlash/linuxrootfs4/etc/init.d/neobootmount.sh;')
-# else:
-# pass
+# else:
+# pass
#_____ARM procesor____
- if (getSupportedTuners()):
+ if (getSupportedTuners()):
if getImageNeoBoot() == 'Flash':
if fileExists('/.multinfo'):
if fileExists('/media/InternalFlash/linuxrootfs1/sbin/neoinitarm'):
cmd = "echo -e '\n\n%s '" % _('...............NEOBOOT - REBOOT...............\nPlease wait, in a moment the decoder will be restarted...')
- cmd1 = 'cd /media/InternalFlash/linuxrootfs1; ln -sfn /sbin/init.sysvinit /media/InternalFlash/linuxrootfs1/sbin/init; sleep 5; reboot -d -f '
+ cmd1 = 'cd /media/InternalFlash/linuxrootfs1; ln -sfn /sbin/init.sysvinit /media/InternalFlash/linuxrootfs1/sbin/init; sleep 5; reboot -d -f '
self.session.open(Console, _('NeoBoot-Reboot ....'), [cmd, cmd1])
elif fileExists('/media/InternalFlash/linuxrootfs2/sbin/neoinitarm'):
cmd = "echo -e '\n\n%s '" % _('...............NEOBOOT - REBOOT...............\nPlease wait, in a moment the decoder will be restarted...')
- cmd1 = 'cd /media/InternalFlash/linuxrootfs2; ln -sfn /sbin/init.sysvinit /media/InternalFlash/linuxrootfs2/sbin/init; sleep 5; reboot -d -f '
+ cmd1 = 'cd /media/InternalFlash/linuxrootfs2; ln -sfn /sbin/init.sysvinit /media/InternalFlash/linuxrootfs2/sbin/init; sleep 5; reboot -d -f '
self.session.open(Console, _('NeoBoot-Reboot ....'), [cmd, cmd1])
elif fileExists('/media/InternalFlash/linuxrootfs3/sbin/neoinitarm'):
cmd = "echo -e '\n\n%s '" % _('...............NEOBOOT - REBOOT...............\nPlease wait, in a moment the decoder will be restarted...')
- cmd1 = 'cd /media/InternalFlash/linuxrootfs3; ln -sfn /sbin/init.sysvinit /media/InternalFlash/linuxrootfs3/sbin/init; sleep 5; reboot -d -f '
+ cmd1 = 'cd /media/InternalFlash/linuxrootfs3; ln -sfn /sbin/init.sysvinit /media/InternalFlash/linuxrootfs3/sbin/init; sleep 5; reboot -d -f '
self.session.open(Console, _('NeoBoot-Reboot ....'), [cmd, cmd1])
- elif fileExists('/media/InternalFlash/linuxrootfs4/sbin/neoinitarm') :
+ elif fileExists('/media/InternalFlash/linuxrootfs4/sbin/neoinitarm'):
cmd = "echo -e '\n\n%s '" % _('...............NEOBOOT - REBOOT...............\nPlease wait, in a moment the decoder will be restarted...')
- cmd1 = 'cd /media/InternalFlash/linuxrootfs4; ln -sfn /sbin/init.sysvinit /media/InternalFlash/linuxrootfs4/sbin/init; sleep 5; reboot -d -f '
+ cmd1 = 'cd /media/InternalFlash/linuxrootfs4; ln -sfn /sbin/init.sysvinit /media/InternalFlash/linuxrootfs4/sbin/init; sleep 5; reboot -d -f '
self.session.open(Console, _('NeoBoot-Reboot ....'), [cmd, cmd1])
elif fileExists('/media/InternalFlash/sbin/init'):
cmd = "echo -e '\n\n%s '" % _('...............NEOBOOT - REBOOT...............\nPlease wait, in a moment the decoder will be restarted...')
- cmd1 = 'cd /media/InternalFlash; ln -sfn /sbin/init.sysvinit /media/InternalFlash/sbin/init; sleep 5; reboot -d -f '
- self.session.open(Console, _('NeoBoot-Reboot ....'), [cmd, cmd1])
+ cmd1 = 'cd /media/InternalFlash; ln -sfn /sbin/init.sysvinit /media/InternalFlash/sbin/init; sleep 5; reboot -d -f '
+ self.session.open(Console, _('NeoBoot-Reboot ....'), [cmd, cmd1])
else:
cmd = "echo -e '\n\n%s '" % _('...............NEOBOOT - REBOOT...............\nPlease wait, in a moment the decoder will be restarted...')
- cmd1 = 'sleep 5; reboot -d -f '
- self.session.open(Console, _('NeoBoot-Reboot ....'), [cmd, cmd1])
+ cmd1 = 'sleep 5; reboot -d -f '
+ self.session.open(Console, _('NeoBoot-Reboot ....'), [cmd, cmd1])
elif not fileExists('/.multinfo'):
cmd = "echo -e '\n\n%s '" % _('NEOBOOT - Restart image flash....\nPlease wait, in a moment the decoder will be restarted...\n')
- cmd1='sleep 5; ln -sfn /sbin/init.sysvinit /sbin/init; reboot -d -f '
+ cmd1 = 'sleep 5; ln -sfn /sbin/init.sysvinit /sbin/init; reboot -d -f '
self.session.open(Console, _('NeoBoot ....'), [cmd, cmd1])
else:
cmd = "echo -e '\n\n%s '" % _('NEOBOOT - Restart image flash....\nPlease wait, in a moment the decoder will be restarted...\n')
- cmd1='sleep 5; ln -sfn /sbin/init.sysvinit /sbin/init; reboot -d -f '
+ cmd1 = 'sleep 5; ln -sfn /sbin/init.sysvinit /sbin/init; reboot -d -f '
self.session.open(Console, _('NeoBoot-ERROR!!! ....'), [cmd, cmd1])
elif getImageNeoBoot() != 'Flash':
if fileExists('/.multinfo'):
cmd = "echo -e '\n\n%s '" % _('NEOBOOT - Restart image flash....\nPlease wait, in a moment the decoder will be restarted...\n')
- cmd1='sleep 5; reboot -d -f '
+ cmd1 = 'sleep 5; reboot -d -f '
self.session.open(Console, _('NeoBoot ....'), [cmd, cmd1])
elif not fileExists('/.multinfo'):
cmd = "echo -e '\n\n%s '" % _('NEOBOOT - Restart image flash....\nPlease wait, in a moment the decoder will be restarted...\n')
- cmd1='sleep 5; ln -sfn /sbin/neoinitarm /sbin/init; reboot -d -f '
+ cmd1 = 'sleep 5; ln -sfn /sbin/neoinitarm /sbin/init; reboot -d -f '
self.session.open(Console, _('NeoBoot ....'), [cmd, cmd1])
else:
cmd = "echo -e '\n\n%s '" % _('NEOBOOT - Restart image flash....\nPlease wait, in a moment the decoder will be restarted...\n')
- cmd1='sleep 5; ln -sfn /sbin/init.sysvinit /sbin/init; reboot -d -f '
+ cmd1 = 'sleep 5; ln -sfn /sbin/init.sysvinit /sbin/init; reboot -d -f '
self.session.open(Console, _('NeoBoot-ERROR!!! ....'), [cmd, cmd1])
else:
os.system('echo "Flash " >> ' + getNeoLocation() + 'ImageBoot/.neonextboot')
self.messagebox = self.session.open(MessageBox, _('It looks like it that multiboot does not support this STB.'), MessageBox.TYPE_INFO, 8)
- self.close()
+ self.close()
else:
os.system('echo "Flash " >> ' + getNeoLocation() + 'ImageBoot/.neonextboot')
diff --git a/NeoBoot/tmpfiles/runpy/duo4k_run.py b/NeoBoot/tmpfiles/runpy/duo4k_run.py
index 7cc7d4a..2605b9c 100644
--- a/NeoBoot/tmpfiles/runpy/duo4k_run.py
+++ b/NeoBoot/tmpfiles/runpy/duo4k_run.py
@@ -1,11 +1,11 @@
# -*- coding: utf-8 -*-
-
-#from __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 __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 enigma import getDesktop
from enigma import eTimer
-from Screens.Screen import Screen
+from Screens.Screen import Screen
from Screens.MessageBox import MessageBox
from Screens.ChoiceBox import ChoiceBox
from Screens.VirtualKeyBoard import VirtualKeyBoard
@@ -30,7 +30,7 @@ from os import system, listdir, mkdir, chdir, getcwd, rename as os_rename, remov
from os.path import dirname, isdir, isdir as os_isdir
import os
import time
-LinkNeoBoot = '/usr/lib/enigma2/python/Plugins/Extensions/NeoBoot'
+LinkNeoBoot = '/usr/lib/enigma2/python/Plugins/Extensions/NeoBoot'
class StartImage(Screen):
@@ -63,6 +63,7 @@ class StartImage(Screen):
\n\t\t """
__module__ = __name__
+
def __init__(self, session):
Screen.__init__(self, session)
self.list = []
@@ -72,7 +73,7 @@ class StartImage(Screen):
'back': self.close})
self['label1'] = Label(_('Start the chosen system now ?'))
self['label2'] = Label(_('Select OK to run the image.'))
-
+
def select(self):
self.list = []
mypath = '' + LinkNeoBoot + ''
@@ -83,77 +84,76 @@ class StartImage(Screen):
self.list.append(res)
self['list'].list = self.list
- def KeyOk(self):
- if getImageNeoBoot() != 'Flash':
- os.system('rm -rf %sImageBoot/%s/usr/bin/enigma2_pre_start.sh' % ( getNeoLocation(), getImageNeoBoot()))
+ def KeyOk(self):
+ if getImageNeoBoot() != 'Flash':
+ os.system('rm -rf %sImageBoot/%s/usr/bin/enigma2_pre_start.sh' % (getNeoLocation(), getImageNeoBoot()))
self.StartImageInNeoBoot()
else:
- os.system('rm -rf %sImageBoot/%s/usr/bin/enigma2_pre_start.sh' % ( getNeoLocation(), getImageNeoBoot()))
+ os.system('rm -rf %sImageBoot/%s/usr/bin/enigma2_pre_start.sh' % (getNeoLocation(), getImageNeoBoot()))
self.StartImageInNeoBoot()
#---------------------------------------------
getMountPointNeo2()
#---------------------------------------------
- def StartImageInNeoBoot(self):
+ def StartImageInNeoBoot(self):
if getImageNeoBoot() != 'Flash':
- if fileExists('%sImageBoot/%s/.control_ok' % ( getNeoLocation(), getImageNeoBoot())):
- system('touch /tmp/.control_ok ')
+ if fileExists('%sImageBoot/%s/.control_ok' % (getNeoLocation(), getImageNeoBoot())):
+ system('touch /tmp/.control_ok ')
else:
- system('touch %sImageBoot/%s/.control_boot_new_image ' % ( getNeoLocation(), getImageNeoBoot() ))
+ system('touch %sImageBoot/%s/.control_boot_new_image ' % (getNeoLocation(), getImageNeoBoot()))
- if fileExists('/.multinfo') and getCPUtype() == 'ARMv7':
- if getBoxVuModel() == 'duo4k':
+ if fileExists('/.multinfo') and getCPUtype() == 'ARMv7':
+ if getBoxVuModel() == 'duo4k':
os.system('mkdir -p /media/InternalFlash; mount /dev/mmcblk0p9 /media/InternalFlash')
-
- system('chmod 755 ' + LinkNeoBoot + '/files/kernel.sh')
+ system('chmod 755 ' + LinkNeoBoot + '/files/kernel.sh')
self.sel = self['list'].getCurrent()
if self.sel:
- self.sel = self.sel[2]
- if self.sel == 0:
+ self.sel = self.sel[2]
+ if self.sel == 0:
if fileExists('/media/InternalFlash/etc/init.d/neobootmount.sh'):
os.system('rm -f /media/InternalFlash/etc/init.d/neobootmount.sh;')
if not fileExists('/bin/busybox.nosuid'):
os.system('ln -sf "busybox" "/bin/busybox.nosuid" ')
-#################_____ARM____##########################
-
- #VUPLUS ARM - Duo4k vu_mmcblk0p6.sh
- if getCPUSoC() == '7278' or getBoxHostName() == 'vuduo4k' :
- if not fileExists('%sImagesUpload/.kernel/flash-kernel-%s.bin' % (getNeoLocation(), getBoxHostName()) ):
- mess = (_('Error - in the location %sImagesUpload/.kernel/ \nkernel file not found flash-kernel-%s.bin') % (getNeoLocation(), getBoxHostName()) )
- self.session.open(MessageBox, mess, MessageBox.TYPE_INFO)
+#################_____ARM____##########################
+
+ #VUPLUS ARM - Duo4k vu_mmcblk0p6.sh
+ if getCPUSoC() == '7278' or getBoxHostName() == 'vuduo4k':
+ if not fileExists('%sImagesUpload/.kernel/flash-kernel-%s.bin' % (getNeoLocation(), getBoxHostName())):
+ mess = (_('Error - in the location %sImagesUpload/.kernel/ \nkernel file not found flash-kernel-%s.bin') % (getNeoLocation(), getBoxHostName()))
+ self.session.open(MessageBox, mess, MessageBox.TYPE_INFO)
else:
- if getImageNeoBoot() == 'Flash':
- if fileExists('/.multinfo'):
- cmd = "echo -e '\n\n%s '" % _('...............NEOBOOT - REBOOT...............\nPlease wait, in a moment the decoder will be restarted...')
- cmd1 = 'cd /media/InternalFlash; ln -sf "init.sysvinit" "/media/InternalFlash/sbin/init"; ' + LinkNeoBoot + '/files/kernel.sh '
+ if getImageNeoBoot() == 'Flash':
+ if fileExists('/.multinfo'):
+ cmd = "echo -e '\n\n%s '" % _('...............NEOBOOT - REBOOT...............\nPlease wait, in a moment the decoder will be restarted...')
+ cmd1 = 'cd /media/InternalFlash; ln -sf "init.sysvinit" "/media/InternalFlash/sbin/init"; ' + LinkNeoBoot + '/files/kernel.sh '
- elif not fileExists('/.multinfo'):
- cmd = "echo -e '\n\n%s '" % _('...............NEOBOOT - REBOOT...............\nPlease wait, in a moment the decoder will be restarted...')
- cmd1 = 'sleep 5; ln -sf "init.sysvinit" "/sbin/init"; reboot -dfhi'
+ elif not fileExists('/.multinfo'):
+ cmd = "echo -e '\n\n%s '" % _('...............NEOBOOT - REBOOT...............\nPlease wait, in a moment the decoder will be restarted...')
+ cmd1 = 'sleep 5; ln -sf "init.sysvinit" "/sbin/init"; reboot -dfhi'
- elif getImageNeoBoot() != 'Flash':
- if not fileExists('/.multinfo'):
- if not fileExists('%sImageBoot/%s/boot/zImage.%s' % ( getNeoLocation(), getImageNeoBoot(), getBoxHostName())):
- cmd = "echo -e '\n\n%s '" % _('...............NEOBOOT - REBOOT...............\nPlease wait, in a moment the decoder will be restarted...')
+ elif getImageNeoBoot() != 'Flash':
+ if not fileExists('/.multinfo'):
+ if not fileExists('%sImageBoot/%s/boot/zImage.%s' % (getNeoLocation(), getImageNeoBoot(), getBoxHostName())):
+ cmd = "echo -e '\n\n%s '" % _('...............NEOBOOT - REBOOT...............\nPlease wait, in a moment the decoder will be restarted...')
cmd1 = 'sleep 5; ln -sfn /sbin/neoinitarm /sbin/init; /etc/init.d/reboot'
-
- elif fileExists('%sImageBoot/%s/boot/zImage.%s' % ( getNeoLocation(), getImageNeoBoot(), getBoxHostName())):
- cmd = "echo -e '\n\n%s '" % _('...............NEOBOOT - REBOOT...............\nPlease wait, in a moment the decoder will be restarted...')
- cmd1 = 'ln -sfn /sbin/neoinitarmvu /sbin/init; ' + LinkNeoBoot + '/files/kernel.sh '
-
- elif fileExists('/.multinfo'):
- if not fileExists('%sImageBoot/%s/boot/zImage.%s' % ( getNeoLocation(), getImageNeoBoot(), getBoxHostName())):
- cmd = "echo -e '\n\n%s '" % _('...............NEOBOOT - REBOOT...............\nPlease wait, in a moment the decoder will be restarted...')
- cmd1 = 'dd if=' + getNeoLocation() + 'ImagesUpload/.kernel/flash-kernel-' + getBoxHostName() + '.bin of=/dev/mmcblk0p6; cd /media/InternalFlash; ln -sf "neoinitarm" "/media/InternalFlash/sbin/init" ; sleep 2; reboot -dfhi '
-
- elif fileExists('%sImageBoot/%s/boot/zImage.%s' % ( getNeoLocation(), getImageNeoBoot(), getBoxHostName())):
- cmd = "echo -e '\n\n%s '" % _('...............NEOBOOT - REBOOT...............\nPlease wait, in a moment the decoder will be restarted...')
- cmd1 = 'cd /media/InternalFlash; ln -sf "neoinitarmvu" "/media/InternalFlash/sbin/init"; ' + LinkNeoBoot + '/files/kernel.sh '
-
+
+ elif fileExists('%sImageBoot/%s/boot/zImage.%s' % (getNeoLocation(), getImageNeoBoot(), getBoxHostName())):
+ cmd = "echo -e '\n\n%s '" % _('...............NEOBOOT - REBOOT...............\nPlease wait, in a moment the decoder will be restarted...')
+ cmd1 = 'ln -sfn /sbin/neoinitarmvu /sbin/init; ' + LinkNeoBoot + '/files/kernel.sh '
+
+ elif fileExists('/.multinfo'):
+ if not fileExists('%sImageBoot/%s/boot/zImage.%s' % (getNeoLocation(), getImageNeoBoot(), getBoxHostName())):
+ cmd = "echo -e '\n\n%s '" % _('...............NEOBOOT - REBOOT...............\nPlease wait, in a moment the decoder will be restarted...')
+ cmd1 = 'dd if=' + getNeoLocation() + 'ImagesUpload/.kernel/flash-kernel-' + getBoxHostName() + '.bin of=/dev/mmcblk0p6; cd /media/InternalFlash; ln -sf "neoinitarm" "/media/InternalFlash/sbin/init" ; sleep 2; reboot -dfhi '
+
+ elif fileExists('%sImageBoot/%s/boot/zImage.%s' % (getNeoLocation(), getImageNeoBoot(), getBoxHostName())):
+ cmd = "echo -e '\n\n%s '" % _('...............NEOBOOT - REBOOT...............\nPlease wait, in a moment the decoder will be restarted...')
+ cmd1 = 'cd /media/InternalFlash; ln -sf "neoinitarmvu" "/media/InternalFlash/sbin/init"; ' + LinkNeoBoot + '/files/kernel.sh '
+
self.session.open(Console, _('NeoBoot ARM '), [cmd, cmd1])
- self.close()
-
+ self.close()
+
else:
os.system('echo "Flash " >> ' + getNeoLocation() + 'ImageBoot/.neonextboot')
self.messagebox = self.session.open(MessageBox, _('It looks like it that multiboot does not support this STB.'), MessageBox.TYPE_INFO, 8)
diff --git a/NeoBoot/tmpfiles/runpy/duo4kse_run.py b/NeoBoot/tmpfiles/runpy/duo4kse_run.py
index bdca149..30f7b20 100644
--- a/NeoBoot/tmpfiles/runpy/duo4kse_run.py
+++ b/NeoBoot/tmpfiles/runpy/duo4kse_run.py
@@ -1,11 +1,11 @@
# -*- coding: utf-8 -*-
-
-#from __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 __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 enigma import getDesktop
from enigma import eTimer
-from Screens.Screen import Screen
+from Screens.Screen import Screen
from Screens.MessageBox import MessageBox
from Screens.ChoiceBox import ChoiceBox
from Screens.VirtualKeyBoard import VirtualKeyBoard
@@ -30,7 +30,7 @@ from os import system, listdir, mkdir, chdir, getcwd, rename as os_rename, remov
from os.path import dirname, isdir, isdir as os_isdir
import os
import time
-LinkNeoBoot = '/usr/lib/enigma2/python/Plugins/Extensions/NeoBoot'
+LinkNeoBoot = '/usr/lib/enigma2/python/Plugins/Extensions/NeoBoot'
class StartImage(Screen):
@@ -63,6 +63,7 @@ class StartImage(Screen):
\n\t\t """
__module__ = __name__
+
def __init__(self, session):
Screen.__init__(self, session)
self.list = []
@@ -72,7 +73,7 @@ class StartImage(Screen):
'back': self.close})
self['label1'] = Label(_('Start the chosen system now ?'))
self['label2'] = Label(_('Select OK to run the image.'))
-
+
def select(self):
self.list = []
mypath = '' + LinkNeoBoot + ''
@@ -83,77 +84,76 @@ class StartImage(Screen):
self.list.append(res)
self['list'].list = self.list
- def KeyOk(self):
- if getImageNeoBoot() != 'Flash':
- os.system('rm -rf %sImageBoot/%s/usr/bin/enigma2_pre_start.sh' % ( getNeoLocation(), getImageNeoBoot()))
+ def KeyOk(self):
+ if getImageNeoBoot() != 'Flash':
+ os.system('rm -rf %sImageBoot/%s/usr/bin/enigma2_pre_start.sh' % (getNeoLocation(), getImageNeoBoot()))
self.StartImageInNeoBoot()
else:
- os.system('rm -rf %sImageBoot/%s/usr/bin/enigma2_pre_start.sh' % ( getNeoLocation(), getImageNeoBoot()))
+ os.system('rm -rf %sImageBoot/%s/usr/bin/enigma2_pre_start.sh' % (getNeoLocation(), getImageNeoBoot()))
self.StartImageInNeoBoot()
#---------------------------------------------
getMountPointNeo2()
#---------------------------------------------')
- def StartImageInNeoBoot(self):
+ def StartImageInNeoBoot(self):
if getImageNeoBoot() != 'Flash':
- if fileExists('%sImageBoot/%s/.control_ok' % ( getNeoLocation(), getImageNeoBoot())):
- system('touch /tmp/.control_ok ')
+ if fileExists('%sImageBoot/%s/.control_ok' % (getNeoLocation(), getImageNeoBoot())):
+ system('touch /tmp/.control_ok ')
else:
- system('touch %sImageBoot/%s/.control_boot_new_image ' % ( getNeoLocation(), getImageNeoBoot() ))
+ system('touch %sImageBoot/%s/.control_boot_new_image ' % (getNeoLocation(), getImageNeoBoot()))
- if fileExists('/.multinfo') and getCPUtype() == 'ARMv7':
- if getBoxVuModel() == 'duo4kse':
+ if fileExists('/.multinfo') and getCPUtype() == 'ARMv7':
+ if getBoxVuModel() == 'duo4kse':
os.system('mkdir -p /media/InternalFlash; mount /dev/mmcblk0p9 /media/InternalFlash')
-
- system('chmod 755 ' + LinkNeoBoot + '/files/kernel.sh')
+ system('chmod 755 ' + LinkNeoBoot + '/files/kernel.sh')
self.sel = self['list'].getCurrent()
if self.sel:
- self.sel = self.sel[2]
- if self.sel == 0:
+ self.sel = self.sel[2]
+ if self.sel == 0:
if fileExists('/media/InternalFlash/etc/init.d/neobootmount.sh'):
os.system('rm -f /media/InternalFlash/etc/init.d/neobootmount.sh;')
if not fileExists('/bin/busybox.nosuid'):
os.system('ln -sf "busybox" "/bin/busybox.nosuid" ')
-#################_____ARM____##########################
-
- #VUPLUS ARM - Duo4kse vu_mmcblk0p6.sh
- if getCPUSoC() == '7444s' or getBoxHostName() == 'vuduo4kse' and getBoxHostName() != 'vuultimo4k' :
- if not fileExists('%sImagesUpload/.kernel/flash-kernel-%s.bin' % (getNeoLocation(), getBoxHostName()) ):
- mess = (_('Error - in the location %sImagesUpload/.kernel/ \nkernel file not found flash-kernel-%s.bin') % (getNeoLocation(), getBoxHostName()) )
- self.session.open(MessageBox, mess, MessageBox.TYPE_INFO)
+#################_____ARM____##########################
+
+ #VUPLUS ARM - Duo4kse vu_mmcblk0p6.sh
+ if getCPUSoC() == '7444s' or getBoxHostName() == 'vuduo4kse' and getBoxHostName() != 'vuultimo4k':
+ if not fileExists('%sImagesUpload/.kernel/flash-kernel-%s.bin' % (getNeoLocation(), getBoxHostName())):
+ mess = (_('Error - in the location %sImagesUpload/.kernel/ \nkernel file not found flash-kernel-%s.bin') % (getNeoLocation(), getBoxHostName()))
+ self.session.open(MessageBox, mess, MessageBox.TYPE_INFO)
else:
- if getImageNeoBoot() == 'Flash':
- if fileExists('/.multinfo'):
- cmd = "echo -e '\n\n%s '" % _('...............NEOBOOT - REBOOT...............\nPlease wait, in a moment the decoder will be restarted...')
- cmd1 = 'cd /media/InternalFlash; ln -sf "init.sysvinit" "/media/InternalFlash/sbin/init"; ' + LinkNeoBoot + '/files/kernel.sh '
+ if getImageNeoBoot() == 'Flash':
+ if fileExists('/.multinfo'):
+ cmd = "echo -e '\n\n%s '" % _('...............NEOBOOT - REBOOT...............\nPlease wait, in a moment the decoder will be restarted...')
+ cmd1 = 'cd /media/InternalFlash; ln -sf "init.sysvinit" "/media/InternalFlash/sbin/init"; ' + LinkNeoBoot + '/files/kernel.sh '
- elif not fileExists('/.multinfo'):
- cmd = "echo -e '\n\n%s '" % _('...............NEOBOOT - REBOOT...............\nPlease wait, in a moment the decoder will be restarted...')
- cmd1 = 'sleep 5; ln -sf "init.sysvinit" "/sbin/init"; reboot -dfhi'
+ elif not fileExists('/.multinfo'):
+ cmd = "echo -e '\n\n%s '" % _('...............NEOBOOT - REBOOT...............\nPlease wait, in a moment the decoder will be restarted...')
+ cmd1 = 'sleep 5; ln -sf "init.sysvinit" "/sbin/init"; reboot -dfhi'
- elif getImageNeoBoot() != 'Flash':
- if not fileExists('/.multinfo'):
- if not fileExists('%sImageBoot/%s/boot/zImage.%s' % ( getNeoLocation(), getImageNeoBoot(), getBoxHostName())):
- cmd = "echo -e '\n\n%s '" % _('...............NEOBOOT - REBOOT...............\nPlease wait, in a moment the decoder will be restarted...')
+ elif getImageNeoBoot() != 'Flash':
+ if not fileExists('/.multinfo'):
+ if not fileExists('%sImageBoot/%s/boot/zImage.%s' % (getNeoLocation(), getImageNeoBoot(), getBoxHostName())):
+ cmd = "echo -e '\n\n%s '" % _('...............NEOBOOT - REBOOT...............\nPlease wait, in a moment the decoder will be restarted...')
cmd1 = 'sleep 5; ln -sfn /sbin/neoinitarm /sbin/init; /etc/init.d/reboot'
-
- elif fileExists('%sImageBoot/%s/boot/zImage.%s' % ( getNeoLocation(), getImageNeoBoot(), getBoxHostName())):
- cmd = "echo -e '\n\n%s '" % _('...............NEOBOOT - REBOOT...............\nPlease wait, in a moment the decoder will be restarted...')
- cmd1 = 'ln -sfn /sbin/neoinitarmvu /sbin/init; ' + LinkNeoBoot + '/files/kernel.sh '
-
- elif fileExists('/.multinfo'):
- if not fileExists('%sImageBoot/%s/boot/zImage.%s' % ( getNeoLocation(), getImageNeoBoot(), getBoxHostName())):
- cmd = "echo -e '\n\n%s '" % _('...............NEOBOOT - REBOOT...............\nPlease wait, in a moment the decoder will be restarted...')
- cmd1 = 'dd if=' + getNeoLocation() + 'ImagesUpload/.kernel/flash-kernel-' + getBoxHostName() + '.bin of=/dev/mmcblk0p6; cd /media/InternalFlash; ln -sf "neoinitarm" "/media/InternalFlash/sbin/init" ; sleep 2; reboot -dfhi '
-
- elif fileExists('%sImageBoot/%s/boot/zImage.%s' % ( getNeoLocation(), getImageNeoBoot(), getBoxHostName())):
- cmd = "echo -e '\n\n%s '" % _('...............NEOBOOT - REBOOT...............\nPlease wait, in a moment the decoder will be restarted...')
- cmd1 = 'cd /media/InternalFlash; ln -sf "neoinitarmvu" "/media/InternalFlash/sbin/init"; ' + LinkNeoBoot + '/files/kernel.sh '
-
+
+ elif fileExists('%sImageBoot/%s/boot/zImage.%s' % (getNeoLocation(), getImageNeoBoot(), getBoxHostName())):
+ cmd = "echo -e '\n\n%s '" % _('...............NEOBOOT - REBOOT...............\nPlease wait, in a moment the decoder will be restarted...')
+ cmd1 = 'ln -sfn /sbin/neoinitarmvu /sbin/init; ' + LinkNeoBoot + '/files/kernel.sh '
+
+ elif fileExists('/.multinfo'):
+ if not fileExists('%sImageBoot/%s/boot/zImage.%s' % (getNeoLocation(), getImageNeoBoot(), getBoxHostName())):
+ cmd = "echo -e '\n\n%s '" % _('...............NEOBOOT - REBOOT...............\nPlease wait, in a moment the decoder will be restarted...')
+ cmd1 = 'dd if=' + getNeoLocation() + 'ImagesUpload/.kernel/flash-kernel-' + getBoxHostName() + '.bin of=/dev/mmcblk0p6; cd /media/InternalFlash; ln -sf "neoinitarm" "/media/InternalFlash/sbin/init" ; sleep 2; reboot -dfhi '
+
+ elif fileExists('%sImageBoot/%s/boot/zImage.%s' % (getNeoLocation(), getImageNeoBoot(), getBoxHostName())):
+ cmd = "echo -e '\n\n%s '" % _('...............NEOBOOT - REBOOT...............\nPlease wait, in a moment the decoder will be restarted...')
+ cmd1 = 'cd /media/InternalFlash; ln -sf "neoinitarmvu" "/media/InternalFlash/sbin/init"; ' + LinkNeoBoot + '/files/kernel.sh '
+
self.session.open(Console, _('NeoBoot ARM '), [cmd, cmd1])
- self.close()
-
+ self.close()
+
else:
os.system('echo "Flash " >> ' + getNeoLocation() + 'ImageBoot/.neonextboot')
self.messagebox = self.session.open(MessageBox, _('It looks like it that multiboot does not support this STB.'), MessageBox.TYPE_INFO, 8)
diff --git a/NeoBoot/tmpfiles/runpy/mips_run.py b/NeoBoot/tmpfiles/runpy/mips_run.py
index 94fb1e5..18c3280 100644
--- a/NeoBoot/tmpfiles/runpy/mips_run.py
+++ b/NeoBoot/tmpfiles/runpy/mips_run.py
@@ -1,12 +1,12 @@
# -*- coding: utf-8 -*-
-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.__init__ import _
+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 eTimer
-from Screens.Screen import Screen
+from Screens.Screen import Screen
from Screens.Console import Console
-from Screens.MessageBox import MessageBox
+from Screens.MessageBox import MessageBox
from Screens.ChoiceBox import ChoiceBox
from Screens.VirtualKeyBoard import VirtualKeyBoard
from Screens.Standby import TryQuitMainloop
@@ -28,7 +28,7 @@ from Tools.Directories import fileExists, pathExists, createDir, resolveFilename
from os import system, listdir, mkdir, chdir, getcwd, rename as os_rename, remove as os_remove, popen
from os.path import dirname, isdir, isdir as os_isdir
import os
-import time
+import time
LinkNeoBoot = '/usr/lib/enigma2/python/Plugins/Extensions/NeoBoot'
@@ -62,6 +62,7 @@ class StartImage(Screen):
\n\t\t """
__module__ = __name__
+
def __init__(self, session):
Screen.__init__(self, session)
self.list = []
@@ -71,7 +72,7 @@ class StartImage(Screen):
'back': self.close})
self['label1'] = Label(_('Start the chosen system now ?'))
self['label2'] = Label(_('Select OK to run the image.'))
-
+
def select(self):
self.list = []
mypath = '/usr/lib/enigma2/python/Plugins/Extensions/NeoBoot'
@@ -82,56 +83,55 @@ class StartImage(Screen):
self.list.append(res)
self['list'].list = self.list
- def KeyOk(self):
- if getImageNeoBoot() != 'Flash':
- os.system('rm -rf %sImageBoot/%s/usr/bin/enigma2_pre_start.sh' % ( getNeoLocation(), getImageNeoBoot()))
+ def KeyOk(self):
+ if getImageNeoBoot() != 'Flash':
+ os.system('rm -rf %sImageBoot/%s/usr/bin/enigma2_pre_start.sh' % (getNeoLocation(), getImageNeoBoot()))
self.StartImageInNeoBoot()
else:
- os.system('rm -rf %sImageBoot/%s/usr/bin/enigma2_pre_start.sh' % ( getNeoLocation(), getImageNeoBoot()))
+ os.system('rm -rf %sImageBoot/%s/usr/bin/enigma2_pre_start.sh' % (getNeoLocation(), getImageNeoBoot()))
self.StartImageInNeoBoot()
#---------------------------------------------
getMountPointNeo2()
#---------------------------------------------
- def StartImageInNeoBoot(self):
+ def StartImageInNeoBoot(self):
if getImageNeoBoot() != 'Flash':
- if fileExists('%sImageBoot/%s/.control_ok' % ( getNeoLocation(), getImageNeoBoot())):
- system('touch /tmp/.control_ok ')
+ if fileExists('%sImageBoot/%s/.control_ok' % (getNeoLocation(), getImageNeoBoot())):
+ system('touch /tmp/.control_ok ')
else:
- system('touch %sImageBoot/%s/.control_boot_new_image ' % ( getNeoLocation(), getImageNeoBoot() ))
+ system('touch %sImageBoot/%s/.control_boot_new_image ' % (getNeoLocation(), getImageNeoBoot()))
- #system('chmod 755 /usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/files/kernel.sh')
+ #system('chmod 755 /usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/files/kernel.sh')
self.sel = self['list'].getCurrent()
if self.sel:
- self.sel = self.sel[2]
- if self.sel == 0:
+ self.sel = self.sel[2]
+ if self.sel == 0:
if fileExists('/media/InternalFlash/etc/init.d/neobootmount.sh'):
os.system('rm -f /media/InternalFlash/etc/init.d/neobootmount.sh;')
- if (getSupportedTuners()):
- if getImageNeoBoot() == 'Flash':
+ if (getSupportedTuners()):
+ if getImageNeoBoot() == 'Flash':
cmd = "echo -e '\n\n%s '" % _('NEOBOOT - Restart image flash....\nPlease wait, in a moment the decoder will be restarted...\n')
- cmd1='sleep 8; ln -sfn /sbin/init.sysvinit /sbin/init; reboot -f '
+ cmd1 = 'sleep 8; ln -sfn /sbin/init.sysvinit /sbin/init; reboot -f '
self.session.open(Console, _('NeoBoot ....'), [cmd, cmd1])
elif getImageNeoBoot() != 'Flash':
if fileExists('/.multinfo'):
cmd = "echo -e '\n\n%s '" % _('NEOBOOT - Restart image flash....\nPlease wait, in a moment the decoder will be restarted...\n')
- cmd1='sleep 5; reboot -f '
+ cmd1 = 'sleep 5; reboot -f '
self.session.open(Console, _('NeoBoot ....'), [cmd, cmd1])
elif not fileExists('/.multinfo'):
cmd = "echo -e '\n\n%s '" % _('NEOBOOT - Restart image flash....\nPlease wait, in a moment the decoder will be restarted...\n')
- cmd1='sleep 8; ln -sfn /sbin/neoinitmips /sbin/init; reboot -f '
+ cmd1 = 'sleep 8; ln -sfn /sbin/neoinitmips /sbin/init; reboot -f '
self.session.open(Console, _('NeoBoot ....'), [cmd, cmd1])
else:
cmd = "echo -e '\n\n%s '" % _('NEOBOOT - Restart image flash....\nPlease wait, in a moment the decoder will be restarted...\n')
- cmd1='sleep 8; ln -sfn /sbin/init.sysvinit /sbin/init; reboot -f '
+ cmd1 = 'sleep 8; ln -sfn /sbin/init.sysvinit /sbin/init; reboot -f '
self.session.open(Console, _('NeoBoot-ERROR!!! ....'), [cmd, cmd1])
else:
os.system('echo "Flash " >> ' + getNeoLocation() + 'ImageBoot/.neonextboot')
self.messagebox = self.session.open(MessageBox, _('It looks like it that multiboot does not support this STB.'), MessageBox.TYPE_INFO, 8)
- self.close()
+ self.close()
else:
os.system('echo "Flash " >> ' + getNeoLocation() + 'ImageBoot/.neonextboot')
self.messagebox = self.session.open(MessageBox, _('It looks like it that multiboot does not support this STB.'), MessageBox.TYPE_INFO, 8)
self.close()
-
\ No newline at end of file
diff --git a/NeoBoot/tmpfiles/runpy/vu4k_run.py b/NeoBoot/tmpfiles/runpy/vu4k_run.py
index 767a61e..928a283 100644
--- a/NeoBoot/tmpfiles/runpy/vu4k_run.py
+++ b/NeoBoot/tmpfiles/runpy/vu4k_run.py
@@ -1,12 +1,12 @@
# -*- coding: utf-8 -*-
#from __init__ import _
-from Plugins.Extensions.NeoBoot.__init__ import _
+from Plugins.Extensions.NeoBoot.__init__ import _
#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 eTimer
-from Screens.Screen import Screen
+from Screens.Screen import Screen
from Screens.MessageBox import MessageBox
from Screens.ChoiceBox import ChoiceBox
from Screens.VirtualKeyBoard import VirtualKeyBoard
@@ -30,9 +30,10 @@ from Tools.Directories import fileExists, pathExists, createDir, resolveFilename
from os import system, listdir, mkdir, chdir, getcwd, rename as os_rename, remove as os_remove, popen
from os.path import dirname, isdir, isdir as os_isdir
import os
-import time
+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 """
__module__ = __name__
+
def __init__(self, session):
Screen.__init__(self, session)
self.list = []
@@ -85,10 +87,10 @@ class StartImage(Screen):
def KeyOk(self):
if getImageNeoBoot() != "Flash":
- os.system('rm -rf %sImageBoot/%s/usr/bin/enigma2_pre_start.sh' % ( getNeoLocation(), getImageNeoBoot()))
+ os.system('rm -rf %sImageBoot/%s/usr/bin/enigma2_pre_start.sh' % (getNeoLocation(), getImageNeoBoot()))
self.StartImageInNeoBoot()
else:
- os.system('rm -rf %sImageBoot/%s/usr/bin/enigma2_pre_start.sh' % ( getNeoLocation(), getImageNeoBoot()))
+ os.system('rm -rf %sImageBoot/%s/usr/bin/enigma2_pre_start.sh' % (getNeoLocation(), getImageNeoBoot()))
self.StartImageInNeoBoot()
#---------------------------------------------
getMountPointNeo2()
@@ -96,13 +98,13 @@ class StartImage(Screen):
def StartImageInNeoBoot(self):
if getImageNeoBoot() != "Flash":
- if fileExists('%sImageBoot/%s/.control_ok' % ( getNeoLocation(), getImageNeoBoot())):
+ if fileExists('%sImageBoot/%s/.control_ok' % (getNeoLocation(), getImageNeoBoot())):
system('touch /tmp/.control_ok ')
else:
- system('touch %sImageBoot/%s/.control_boot_new_image ' % ( getNeoLocation(), getImageNeoBoot() ))
+ system('touch %sImageBoot/%s/.control_boot_new_image ' % (getNeoLocation(), getImageNeoBoot()))
if fileExists('/.multinfo') and getCPUtype() == "ARMv7":
- if getBoxVuModel() == "uno4kse" or getBoxVuModel() == "uno4k" or getBoxVuModel() == "ultimo4k" or getBoxVuModel() == "solo4k":
+ if getBoxVuModel() == "uno4kse" or getBoxVuModel() == "uno4k" or getBoxVuModel() == "ultimo4k" or getBoxVuModel() == "solo4k":
os.system('mkdir -p /media/InternalFlash; mount /dev/mmcblk0p4 /media/InternalFlash')
system('chmod 755 ' + LinkNeoBoot + '/files/kernel.sh')
@@ -115,9 +117,9 @@ class StartImage(Screen):
if not fileExists('/bin/busybox.nosuid'):
os.system('ln -sf "busybox" "/bin/busybox.nosuid" ')
#VUPLUS ARM ultimo4k, solo4k, uno4k, uno4kse - mmcblk0p1.sh
- if getCPUtype() == "ARMv7" and getBoxHostName() == "vuultimo4k" or getBoxHostName() == "vusolo4k" or getBoxHostName() == "vuuno4k" or getBoxHostName() == "vuuno4kse" :
- if not fileExists('%sImagesUpload/.kernel/flash-kernel-%s.bin' % (getNeoLocation(), getBoxHostName()) ):
- mess = (_('Error - in the location %sImagesUpload/.kernel/ \nkernel file not found flash-kernel-%s.bin') % (getNeoLocation(), getBoxHostName()) )
+ if getCPUtype() == "ARMv7" and getBoxHostName() == "vuultimo4k" or getBoxHostName() == "vusolo4k" or getBoxHostName() == "vuuno4k" or getBoxHostName() == "vuuno4kse":
+ if not fileExists('%sImagesUpload/.kernel/flash-kernel-%s.bin' % (getNeoLocation(), getBoxHostName())):
+ mess = (_('Error - in the location %sImagesUpload/.kernel/ \nkernel file not found flash-kernel-%s.bin') % (getNeoLocation(), getBoxHostName()))
self.session.open(MessageBox, mess, MessageBox.TYPE_INFO)
else:
if getImageNeoBoot() == "Flash":
@@ -129,21 +131,21 @@ class StartImage(Screen):
cmd = "echo -e '\n\n%s '" % _('...............NEOBOOT - REBOOT...............\nPlease wait, in a moment the decoder will be restarted...')
cmd1 = 'sleep 5; ln -sf "init.sysvinit" "/sbin/init"; reboot -dfhi'
- elif getImageNeoBoot() != "Flash":
+ elif getImageNeoBoot() != "Flash":
if not fileExists("/.multinfo"):
- if not fileExists('%sImageBoot/%s/boot/zImage.%s' % ( getNeoLocation(), getImageNeoBoot(), getBoxHostName())):
+ if not fileExists('%sImageBoot/%s/boot/zImage.%s' % (getNeoLocation(), getImageNeoBoot(), getBoxHostName())):
cmd = "echo -e '\n\n%s '" % _('...............NEOBOOT - REBOOT...............\nPlease wait, in a moment the decoder will be restarted...')
cmd1 = 'sleep 5; ln -sfn /sbin/neoinitarm /sbin/init; /etc/init.d/reboot'
- elif fileExists('%sImageBoot/%s/boot/zImage.%s' % ( getNeoLocation(), getImageNeoBoot(), getBoxHostName())):
+ elif fileExists('%sImageBoot/%s/boot/zImage.%s' % (getNeoLocation(), getImageNeoBoot(), getBoxHostName())):
cmd = "echo -e '\n\n%s '" % _('...............NEOBOOT - REBOOT...............\nPlease wait, in a moment the decoder will be restarted...')
cmd1 = 'ln -sfn /sbin/neoinitarmvu /sbin/init; ' + LinkNeoBoot + '/files/kernel.sh '
elif fileExists("/.multinfo"):
- if not fileExists('%sImageBoot/%s/boot/zImage.%s' % ( getNeoLocation(), getImageNeoBoot(), getBoxHostName())):
+ if not fileExists('%sImageBoot/%s/boot/zImage.%s' % (getNeoLocation(), getImageNeoBoot(), getBoxHostName())):
cmd = "echo -e '\n\n%s '" % _('...............NEOBOOT - REBOOT...............\nPlease wait, in a moment the decoder will be restarted...')
cmd1 = 'dd if=' + getNeoLocation() + 'ImagesUpload/.kernel/flash-kernel-' + getBoxHostName() + '.bin of=/dev/mmcblk0p1; cd /media/InternalFlash; ln -sf "neoinitarm" "/media/InternalFlash/sbin/init" ; sleep 2; reboot -dfhi '
- elif fileExists('%sImageBoot/%s/boot/zImage.%s' % ( getNeoLocation(), getImageNeoBoot(), getBoxHostName())):
+ elif fileExists('%sImageBoot/%s/boot/zImage.%s' % (getNeoLocation(), getImageNeoBoot(), getBoxHostName())):
cmd = "echo -e '\n\n%s '" % _('...............NEOBOOT - REBOOT...............\nPlease wait, in a moment the decoder will be restarted...')
cmd1 = 'cd /media/InternalFlash; ln -sf "neoinitarmvu" "/media/InternalFlash/sbin/init"; ' + LinkNeoBoot + '/files/kernel.sh '
diff --git a/NeoBoot/tmpfiles/runpy/vu_mtd1_run.py b/NeoBoot/tmpfiles/runpy/vu_mtd1_run.py
index 6675060..db6cec2 100644
--- a/NeoBoot/tmpfiles/runpy/vu_mtd1_run.py
+++ b/NeoBoot/tmpfiles/runpy/vu_mtd1_run.py
@@ -1,10 +1,10 @@
# -*- coding: utf-8 -*-
-
-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.__init__ import _
+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 eTimer
-from Screens.Screen import Screen
+from Screens.Screen import Screen
from Screens.Console import Console
from Screens.MessageBox import MessageBox
from Screens.ChoiceBox import ChoiceBox
@@ -28,7 +28,7 @@ from Tools.Directories import fileExists, pathExists, createDir, resolveFilename
from os import system, listdir, mkdir, chdir, getcwd, rename as os_rename, remove as os_remove, popen
from os.path import dirname, isdir, isdir as os_isdir
import os
-import time
+import time
LinkNeoBoot = '/usr/lib/enigma2/python/Plugins/Extensions/NeoBoot'
@@ -62,6 +62,7 @@ class StartImage(Screen):
\n\t\t """
__module__ = __name__
+
def __init__(self, session):
Screen.__init__(self, session)
self.list = []
@@ -71,7 +72,7 @@ class StartImage(Screen):
'back': self.close})
self['label1'] = Label(_('Start the chosen system now ?'))
self['label2'] = Label(_('Select OK to run the image.'))
-
+
def select(self):
self.list = []
mypath = '/usr/lib/enigma2/python/Plugins/Extensions/NeoBoot'
@@ -82,66 +83,66 @@ class StartImage(Screen):
self.list.append(res)
self['list'].list = self.list
- def KeyOk(self):
- if getImageNeoBoot() != 'Flash':
- os.system('rm -rf %sImageBoot/%s/usr/bin/enigma2_pre_start.sh' % ( getNeoLocation(), getImageNeoBoot()))
+ def KeyOk(self):
+ if getImageNeoBoot() != 'Flash':
+ os.system('rm -rf %sImageBoot/%s/usr/bin/enigma2_pre_start.sh' % (getNeoLocation(), getImageNeoBoot()))
self.StartImageInNeoBoot()
else:
- os.system('rm -rf %sImageBoot/%s/usr/bin/enigma2_pre_start.sh' % ( getNeoLocation(), getImageNeoBoot()))
+ os.system('rm -rf %sImageBoot/%s/usr/bin/enigma2_pre_start.sh' % (getNeoLocation(), getImageNeoBoot()))
self.StartImageInNeoBoot()
#---------------------------------------------
getMountPointNeo2()
#---------------------------------------------
- def StartImageInNeoBoot(self):
+ def StartImageInNeoBoot(self):
if getImageNeoBoot() != 'Flash':
- if fileExists('%sImageBoot/%s/.control_ok' % ( getNeoLocation(), getImageNeoBoot())):
- system('touch /tmp/.control_ok ')
+ if fileExists('%sImageBoot/%s/.control_ok' % (getNeoLocation(), getImageNeoBoot())):
+ system('touch /tmp/.control_ok ')
else:
- system('touch %sImageBoot/%s/.control_boot_new_image ' % ( getNeoLocation(), getImageNeoBoot() ))
+ system('touch %sImageBoot/%s/.control_boot_new_image ' % (getNeoLocation(), getImageNeoBoot()))
- system('chmod 755 /usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/files/kernel.sh')
+ system('chmod 755 /usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/files/kernel.sh')
self.sel = self['list'].getCurrent()
if self.sel:
- self.sel = self.sel[2]
- if self.sel == 0:
+ self.sel = self.sel[2]
+ if self.sel == 0:
if fileExists('/media/InternalFlash/etc/init.d/neobootmount.sh'):
os.system('rm -f /media/InternalFlash/etc/init.d/neobootmount.sh;')
if not fileExists('/bin/busybox.nosuid'):
os.system('ln -sf "busybox" "/bin/busybox.nosuid" ')
-#################_____mips___##########################
-
- #VUPLUS MIPS vu_dev_mtd1.sh
- if getBoxHostName() == 'vuultimo' or getBoxHostName() == 'bm750' or getBoxHostName() == 'vuduo' or getBoxHostName() == 'vuuno' or getBoxHostName() == 'vusolo' or getBoxHostName() == 'vuduo':
- if not fileExists('%sImagesUpload/.kernel/%s.vmlinux.gz' % (getNeoLocation(), getBoxHostName()) ):
- self.myclose2(_('Error - in the location %sImagesUpload/.kernel/ \nkernel file not found flash kernel vmlinux.gz ' % getNeoLocation() ))
- else:
- if getImageNeoBoot() == 'Flash':
- if fileExists('/.multinfo'):
- cmd = "echo -e '\n\n%s '" % _('...............NeoBoot REBOOT...............\nPlease wait, in a moment the decoder will be restarted...')
- cmd1 = '/usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/files/kernel.sh'
+#################_____mips___##########################
+
+ #VUPLUS MIPS vu_dev_mtd1.sh
+ if getBoxHostName() == 'vuultimo' or getBoxHostName() == 'bm750' or getBoxHostName() == 'vuduo' or getBoxHostName() == 'vuuno' or getBoxHostName() == 'vusolo' or getBoxHostName() == 'vuduo':
+ if not fileExists('%sImagesUpload/.kernel/%s.vmlinux.gz' % (getNeoLocation(), getBoxHostName())):
+ self.myclose2(_('Error - in the location %sImagesUpload/.kernel/ \nkernel file not found flash kernel vmlinux.gz ' % getNeoLocation()))
+ else:
+ if getImageNeoBoot() == 'Flash':
+ if fileExists('/.multinfo'):
+ cmd = "echo -e '\n\n%s '" % _('...............NeoBoot REBOOT...............\nPlease wait, in a moment the decoder will be restarted...')
+ cmd1 = '/usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/files/kernel.sh'
elif not fileExists('/.multinfo'):
- cmd = "echo -e '\n\n%s '" % _('...............NEOBOOT >> Reboot...............\nPlease wait, in a moment the decoder will be restarted...')
+ cmd = "echo -e '\n\n%s '" % _('...............NEOBOOT >> Reboot...............\nPlease wait, in a moment the decoder will be restarted...')
cmd1 = 'ln -sfn /sbin/init.sysvinit /sbin/init; /etc/init.d/reboot'
- elif getImageNeoBoot() != 'Flash':
- if not fileExists('/.multinfo'):
+ elif getImageNeoBoot() != 'Flash':
+ if not fileExists('/.multinfo'):
if fileExists('' + getNeoLocation() + 'ImageBoot/' + getImageNeoBoot() + '/boot/' + getBoxHostName() + '.vmlinux.gz'):
- cmd = "echo -e '\n\n%s '" % _('...............NEOBOOT-REBOOT...............\nPlease wait, in a moment the decoder will be restarted...')
- cmd1 = 'ln -sfn /sbin/neoinitmipsvu /sbin/init; /usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/files/kernel.sh'
+ cmd = "echo -e '\n\n%s '" % _('...............NEOBOOT-REBOOT...............\nPlease wait, in a moment the decoder will be restarted...')
+ cmd1 = 'ln -sfn /sbin/neoinitmipsvu /sbin/init; /usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/files/kernel.sh'
- elif not fileExists('%sImageBoot/%s/boot/%s.vmlinux.gz' % ( getNeoLocation(), getImageNeoBoot(), getBoxHostName())):
- cmd = "echo -e '\n\n%s '" % _('...............NEOBOOT > REBOOT...............\nPlease wait, in a moment the decoder will be restarted...')
- cmd1 = 'ln -sfn /sbin/neoinitmipsvu /sbin/init; /etc/init.d/reboot'
+ elif not fileExists('%sImageBoot/%s/boot/%s.vmlinux.gz' % (getNeoLocation(), getImageNeoBoot(), getBoxHostName())):
+ cmd = "echo -e '\n\n%s '" % _('...............NEOBOOT > REBOOT...............\nPlease wait, in a moment the decoder will be restarted...')
+ cmd1 = 'ln -sfn /sbin/neoinitmipsvu /sbin/init; /etc/init.d/reboot'
- elif fileExists('/.multinfo'):
- if not fileExists('%sImageBoot/%s/boot/%s.vmlinux.gz' % ( getNeoLocation(), getImageNeoBoot(), getBoxHostName())):
- cmd = "echo -e '\n\n%s '" % _('...............NEOBOOT_REBOOT...............\nPlease wait, in a moment the decoder will be restarted...')
- cmd1 = 'flash_eraseall /dev/mtd1; sleep 2; ' + LinkNeoBoot + '/bin/nandwrite -p /dev/mtd1 %sImagesUpload/.kernel/%s.vmlinux.gz; /etc/init.d/reboot' % ( getNeoLocation(), getBoxHostName())
+ elif fileExists('/.multinfo'):
+ if not fileExists('%sImageBoot/%s/boot/%s.vmlinux.gz' % (getNeoLocation(), getImageNeoBoot(), getBoxHostName())):
+ cmd = "echo -e '\n\n%s '" % _('...............NEOBOOT_REBOOT...............\nPlease wait, in a moment the decoder will be restarted...')
+ cmd1 = 'flash_eraseall /dev/mtd1; sleep 2; ' + LinkNeoBoot + '/bin/nandwrite -p /dev/mtd1 %sImagesUpload/.kernel/%s.vmlinux.gz; /etc/init.d/reboot' % (getNeoLocation(), getBoxHostName())
- elif fileExists('%sImageBoot/%s/boot/%s.vmlinux.gz' % ( getNeoLocation(), getImageNeoBoot(), getBoxHostName())):
- cmd = "echo -e '\n\n%s '" % _('...............REBOOT now...............\nPlease wait, in a moment the decoder will be restarted...')
+ elif fileExists('%sImageBoot/%s/boot/%s.vmlinux.gz' % (getNeoLocation(), getImageNeoBoot(), getBoxHostName())):
+ cmd = "echo -e '\n\n%s '" % _('...............REBOOT now...............\nPlease wait, in a moment the decoder will be restarted...')
cmd1 = '/usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/files/kernel.sh'
self.session.open(Console, _('NeoBoot MIPS....'), [cmd, cmd1])
diff --git a/NeoBoot/tmpfiles/runpy/vu_mtd2_run.py b/NeoBoot/tmpfiles/runpy/vu_mtd2_run.py
index 2593c9e..f4d6a83 100644
--- a/NeoBoot/tmpfiles/runpy/vu_mtd2_run.py
+++ b/NeoBoot/tmpfiles/runpy/vu_mtd2_run.py
@@ -1,10 +1,10 @@
# -*- coding: utf-8 -*-
-
-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.__init__ import _
+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 eTimer
-from Screens.Screen import Screen
+from Screens.Screen import Screen
from Screens.Console import Console
from Screens.MessageBox import MessageBox
from Screens.ChoiceBox import ChoiceBox
@@ -28,7 +28,7 @@ from Tools.Directories import fileExists, pathExists, createDir, resolveFilename
from os import system, listdir, mkdir, chdir, getcwd, rename as os_rename, remove as os_remove, popen
from os.path import dirname, isdir, isdir as os_isdir
import os
-import time
+import time
LinkNeoBoot = '/usr/lib/enigma2/python/Plugins/Extensions/NeoBoot'
@@ -62,6 +62,7 @@ class StartImage(Screen):
\n\t\t """
__module__ = __name__
+
def __init__(self, session):
Screen.__init__(self, session)
self.list = []
@@ -71,7 +72,7 @@ class StartImage(Screen):
'back': self.close})
self['label1'] = Label(_('Start the chosen system now ?'))
self['label2'] = Label(_('Select OK to run the image.'))
-
+
def select(self):
self.list = []
mypath = '/usr/lib/enigma2/python/Plugins/Extensions/NeoBoot'
@@ -82,66 +83,66 @@ class StartImage(Screen):
self.list.append(res)
self['list'].list = self.list
- def KeyOk(self):
- if getImageNeoBoot() != 'Flash':
- os.system('rm -rf %sImageBoot/%s/usr/bin/enigma2_pre_start.sh' % ( getNeoLocation(), getImageNeoBoot()))
+ def KeyOk(self):
+ if getImageNeoBoot() != 'Flash':
+ os.system('rm -rf %sImageBoot/%s/usr/bin/enigma2_pre_start.sh' % (getNeoLocation(), getImageNeoBoot()))
self.StartImageInNeoBoot()
else:
- os.system('rm -rf %sImageBoot/%s/usr/bin/enigma2_pre_start.sh' % ( getNeoLocation(), getImageNeoBoot()))
+ os.system('rm -rf %sImageBoot/%s/usr/bin/enigma2_pre_start.sh' % (getNeoLocation(), getImageNeoBoot()))
self.StartImageInNeoBoot()
#---------------------------------------------
getMountPointNeo2()
#---------------------------------------------
- def StartImageInNeoBoot(self):
+ def StartImageInNeoBoot(self):
if getImageNeoBoot() != 'Flash':
- if fileExists('%sImageBoot/%s/.control_ok' % ( getNeoLocation(), getImageNeoBoot())):
- system('touch /tmp/.control_ok ')
+ if fileExists('%sImageBoot/%s/.control_ok' % (getNeoLocation(), getImageNeoBoot())):
+ system('touch /tmp/.control_ok ')
else:
- system('touch %sImageBoot/%s/.control_boot_new_image ' % ( getNeoLocation(), getImageNeoBoot() ))
+ system('touch %sImageBoot/%s/.control_boot_new_image ' % (getNeoLocation(), getImageNeoBoot()))
- system('chmod 755 /usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/files/kernel.sh')
+ system('chmod 755 /usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/files/kernel.sh')
self.sel = self['list'].getCurrent()
if self.sel:
- self.sel = self.sel[2]
- if self.sel == 0:
+ self.sel = self.sel[2]
+ if self.sel == 0:
if fileExists('/media/InternalFlash/etc/init.d/neobootmount.sh'):
os.system('rm -f /media/InternalFlash/etc/init.d/neobootmount.sh;')
if not fileExists('/bin/busybox.nosuid'):
os.system('ln -sf "busybox" "/bin/busybox.nosuid" ')
-#################_____mips___##########################
-
- #VUPLUS MIPS vu_dev_mtd2.sh
- if getBoxHostName() == 'vusolo2' or getBoxHostName() == 'vusolose' or getBoxHostName() == 'vuduo2' or getBoxHostName() == 'vuzero':
- if not fileExists('%sImagesUpload/.kernel/%s.vmlinux.gz' % (getNeoLocation(), getBoxHostName()) ):
- self.myclose2(_('Error - in the location %sImagesUpload/.kernel/ \nkernel file not found flash kernel vmlinux.gz ' % getNeoLocation() ))
- else:
- if getImageNeoBoot() == 'Flash':
- if fileExists('/.multinfo'):
- cmd = "echo -e '\n\n%s '" % _('...............NeoBoot REBOOT...............\nPlease wait, in a moment the decoder will be restarted...')
- cmd1 = '/usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/files/kernel.sh'
+#################_____mips___##########################
+
+ #VUPLUS MIPS vu_dev_mtd2.sh
+ if getBoxHostName() == 'vusolo2' or getBoxHostName() == 'vusolose' or getBoxHostName() == 'vuduo2' or getBoxHostName() == 'vuzero':
+ if not fileExists('%sImagesUpload/.kernel/%s.vmlinux.gz' % (getNeoLocation(), getBoxHostName())):
+ self.myclose2(_('Error - in the location %sImagesUpload/.kernel/ \nkernel file not found flash kernel vmlinux.gz ' % getNeoLocation()))
+ else:
+ if getImageNeoBoot() == 'Flash':
+ if fileExists('/.multinfo'):
+ cmd = "echo -e '\n\n%s '" % _('...............NeoBoot REBOOT...............\nPlease wait, in a moment the decoder will be restarted...')
+ cmd1 = '/usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/files/kernel.sh'
elif not fileExists('/.multinfo'):
- cmd = "echo -e '\n\n%s '" % _('...............NEOBOOT >> Reboot...............\nPlease wait, in a moment the decoder will be restarted...')
+ cmd = "echo -e '\n\n%s '" % _('...............NEOBOOT >> Reboot...............\nPlease wait, in a moment the decoder will be restarted...')
cmd1 = 'ln -sfn /sbin/init.sysvinit /sbin/init; /etc/init.d/reboot'
- elif getImageNeoBoot() != 'Flash':
- if not fileExists('/.multinfo'):
+ elif getImageNeoBoot() != 'Flash':
+ if not fileExists('/.multinfo'):
if fileExists('' + getNeoLocation() + 'ImageBoot/' + getImageNeoBoot() + '/boot/' + getBoxHostName() + '.vmlinux.gz'):
- cmd = "echo -e '\n\n%s '" % _('...............NEOBOOT-REBOOT...............\nPlease wait, in a moment the decoder will be restarted...')
- cmd1 = 'ln -sfn /sbin/neoinitmipsvu /sbin/init; /usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/files/kernel.sh'
+ cmd = "echo -e '\n\n%s '" % _('...............NEOBOOT-REBOOT...............\nPlease wait, in a moment the decoder will be restarted...')
+ cmd1 = 'ln -sfn /sbin/neoinitmipsvu /sbin/init; /usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/files/kernel.sh'
- elif not fileExists('%sImageBoot/%s/boot/%s.vmlinux.gz' % ( getNeoLocation(), getImageNeoBoot(), getBoxHostName())):
- cmd = "echo -e '\n\n%s '" % _('...............NEOBOOT > REBOOT...............\nPlease wait, in a moment the decoder will be restarted...')
- cmd1 = 'ln -sfn /sbin/neoinitmipsvu /sbin/init; /etc/init.d/reboot'
+ elif not fileExists('%sImageBoot/%s/boot/%s.vmlinux.gz' % (getNeoLocation(), getImageNeoBoot(), getBoxHostName())):
+ cmd = "echo -e '\n\n%s '" % _('...............NEOBOOT > REBOOT...............\nPlease wait, in a moment the decoder will be restarted...')
+ cmd1 = 'ln -sfn /sbin/neoinitmipsvu /sbin/init; /etc/init.d/reboot'
- elif fileExists('/.multinfo'):
- if not fileExists('%sImageBoot/%s/boot/%s.vmlinux.gz' % ( getNeoLocation(), getImageNeoBoot(), getBoxHostName())):
- cmd = "echo -e '\n\n%s '" % _('...............NEOBOOT_REBOOT...............\nPlease wait, in a moment the decoder will be restarted...')
- cmd1 = 'flash_eraseall /dev/mtd2; sleep 2; ' + LinkNeoBoot + '/bin/nandwrite -p /dev/mtd2 %sImagesUpload/.kernel/%s.vmlinux.gz; /etc/init.d/reboot' % ( getNeoLocation(), getBoxHostName())
+ elif fileExists('/.multinfo'):
+ if not fileExists('%sImageBoot/%s/boot/%s.vmlinux.gz' % (getNeoLocation(), getImageNeoBoot(), getBoxHostName())):
+ cmd = "echo -e '\n\n%s '" % _('...............NEOBOOT_REBOOT...............\nPlease wait, in a moment the decoder will be restarted...')
+ cmd1 = 'flash_eraseall /dev/mtd2; sleep 2; ' + LinkNeoBoot + '/bin/nandwrite -p /dev/mtd2 %sImagesUpload/.kernel/%s.vmlinux.gz; /etc/init.d/reboot' % (getNeoLocation(), getBoxHostName())
- elif fileExists('%sImageBoot/%s/boot/%s.vmlinux.gz' % ( getNeoLocation(), getImageNeoBoot(), getBoxHostName())):
- cmd = "echo -e '\n\n%s '" % _('...............REBOOT now...............\nPlease wait, in a moment the decoder will be restarted...')
+ elif fileExists('%sImageBoot/%s/boot/%s.vmlinux.gz' % (getNeoLocation(), getImageNeoBoot(), getBoxHostName())):
+ cmd = "echo -e '\n\n%s '" % _('...............REBOOT now...............\nPlease wait, in a moment the decoder will be restarted...')
cmd1 = '/usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/files/kernel.sh'
self.session.open(Console, _('NeoBoot MIPS....'), [cmd, cmd1])
@@ -154,4 +155,4 @@ class StartImage(Screen):
def myclose2(self, message):
self.session.open(MessageBox, message, MessageBox.TYPE_INFO)
- self.close()
\ No newline at end of file
+ self.close()
diff --git a/NeoBoot/tmpfiles/runpy/zero4k_run.py b/NeoBoot/tmpfiles/runpy/zero4k_run.py
index 53fa941..a7f3954 100644
--- a/NeoBoot/tmpfiles/runpy/zero4k_run.py
+++ b/NeoBoot/tmpfiles/runpy/zero4k_run.py
@@ -1,10 +1,10 @@
# -*- coding: utf-8 -*-
-
-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.__init__ import _
+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 eTimer
-from Screens.Screen import Screen
+from Screens.Screen import Screen
from Screens.MessageBox import MessageBox
from Screens.ChoiceBox import ChoiceBox
from Screens.VirtualKeyBoard import VirtualKeyBoard
@@ -28,8 +28,8 @@ from Tools.Directories import fileExists, pathExists, createDir, resolveFilename
from os import system, listdir, mkdir, chdir, getcwd, rename as os_rename, remove as os_remove, popen
from os.path import dirname, isdir, isdir as os_isdir
import os
-import time
-LinkNeoBoot = '/usr/lib/enigma2/python/Plugins/Extensions/NeoBoot'
+import time
+LinkNeoBoot = '/usr/lib/enigma2/python/Plugins/Extensions/NeoBoot'
class StartImage(Screen):
@@ -62,6 +62,7 @@ class StartImage(Screen):
\n\t\t """
__module__ = __name__
+
def __init__(self, session):
Screen.__init__(self, session)
self.list = []
@@ -71,7 +72,7 @@ class StartImage(Screen):
'back': self.close})
self['label1'] = Label(_('Start the chosen system now ?'))
self['label2'] = Label(_('Select OK to run the image.'))
-
+
def select(self):
self.list = []
mypath = '/usr/lib/enigma2/python/Plugins/Extensions/NeoBoot'
@@ -82,75 +83,75 @@ class StartImage(Screen):
self.list.append(res)
self['list'].list = self.list
- def KeyOk(self):
- if getImageNeoBoot() != 'Flash':
- os.system('rm -rf %sImageBoot/%s/usr/bin/enigma2_pre_start.sh' % ( getNeoLocation(), getImageNeoBoot()))
+ def KeyOk(self):
+ if getImageNeoBoot() != 'Flash':
+ os.system('rm -rf %sImageBoot/%s/usr/bin/enigma2_pre_start.sh' % (getNeoLocation(), getImageNeoBoot()))
self.StartImageInNeoBoot()
else:
- os.system('rm -rf %sImageBoot/%s/usr/bin/enigma2_pre_start.sh' % ( getNeoLocation(), getImageNeoBoot()))
+ os.system('rm -rf %sImageBoot/%s/usr/bin/enigma2_pre_start.sh' % (getNeoLocation(), getImageNeoBoot()))
self.StartImageInNeoBoot()
#---------------------------------------------
getMountPointNeo2()
#---------------------------------------------
- def StartImageInNeoBoot(self):
+ def StartImageInNeoBoot(self):
if getImageNeoBoot() != 'Flash':
- if fileExists('%sImageBoot/%s/.control_ok' % ( getNeoLocation(), getImageNeoBoot())):
- system('touch /tmp/.control_ok ')
+ if fileExists('%sImageBoot/%s/.control_ok' % (getNeoLocation(), getImageNeoBoot())):
+ system('touch /tmp/.control_ok ')
else:
- system('touch %sImageBoot/%s/.control_boot_new_image ' % ( getNeoLocation(), getImageNeoBoot() ))
+ system('touch %sImageBoot/%s/.control_boot_new_image ' % (getNeoLocation(), getImageNeoBoot()))
- if fileExists('/.multinfo') and getCPUtype() == 'ARMv7':
- if getBoxVuModel() == 'zero4k':
+ if fileExists('/.multinfo') and getCPUtype() == 'ARMv7':
+ if getBoxVuModel() == 'zero4k':
os.system('mkdir -p /media/InternalFlash; mount /dev/mmcblk0p7 /media/InternalFlash')
- system('chmod 755 ' + LinkNeoBoot + '/files/kernel.sh')
+ system('chmod 755 ' + LinkNeoBoot + '/files/kernel.sh')
self.sel = self['list'].getCurrent()
if self.sel:
- self.sel = self.sel[2]
- if self.sel == 0:
+ self.sel = self.sel[2]
+ if self.sel == 0:
if fileExists('/media/InternalFlash/etc/init.d/neobootmount.sh'):
os.system('rm -f /media/InternalFlash/etc/init.d/neobootmount.sh;')
if not fileExists('/bin/busybox.nosuid'):
os.system('ln -sf "busybox" "/bin/busybox.nosuid" ')
-#################_____ARM____##########################
- #VUPLUS ARM - Zero4k vu_mmcblk0p4.sh
- if getBoxHostName() == 'vuzero4k' or getCPUSoC() == '72604':
- if not fileExists('%sImagesUpload/.kernel/flash-kernel-%s.bin' % (getNeoLocation(), getBoxHostName()) ):
- mess = (_('Error - in the location %sImagesUpload/.kernel/ \nkernel file not found flash-kernel-%s.bin') % (getNeoLocation(), getBoxHostName()) )
- self.session.open(MessageBox, mess, MessageBox.TYPE_INFO)
+#################_____ARM____##########################
+ #VUPLUS ARM - Zero4k vu_mmcblk0p4.sh
+ if getBoxHostName() == 'vuzero4k' or getCPUSoC() == '72604':
+ if not fileExists('%sImagesUpload/.kernel/flash-kernel-%s.bin' % (getNeoLocation(), getBoxHostName())):
+ mess = (_('Error - in the location %sImagesUpload/.kernel/ \nkernel file not found flash-kernel-%s.bin') % (getNeoLocation(), getBoxHostName()))
+ self.session.open(MessageBox, mess, MessageBox.TYPE_INFO)
else:
- if getImageNeoBoot() == 'Flash':
- if fileExists('/.multinfo'):
- cmd = "echo -e '\n\n%s '" % _('...............NEOBOOT - REBOOT...............\nPlease wait, in a moment the decoder will be restarted...')
- cmd1 = 'cd /media/InternalFlash; ln -sf "init.sysvinit" "/media/InternalFlash/sbin/init"; /usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/files/kernel.sh '
+ if getImageNeoBoot() == 'Flash':
+ if fileExists('/.multinfo'):
+ cmd = "echo -e '\n\n%s '" % _('...............NEOBOOT - REBOOT...............\nPlease wait, in a moment the decoder will be restarted...')
+ cmd1 = 'cd /media/InternalFlash; ln -sf "init.sysvinit" "/media/InternalFlash/sbin/init"; /usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/files/kernel.sh '
- elif not fileExists('/.multinfo'):
- cmd = "echo -e '\n\n%s '" % _('...............NEOBOOT - REBOOT...............\nPlease wait, in a moment the decoder will be restarted...')
- cmd1 = 'sleep 5; ln -sf "init.sysvinit" "/sbin/init"; reboot -dfhi'
+ elif not fileExists('/.multinfo'):
+ cmd = "echo -e '\n\n%s '" % _('...............NEOBOOT - REBOOT...............\nPlease wait, in a moment the decoder will be restarted...')
+ cmd1 = 'sleep 5; ln -sf "init.sysvinit" "/sbin/init"; reboot -dfhi'
- elif getImageNeoBoot() != 'Flash':
- if not fileExists('/.multinfo'):
- if not fileExists('%sImageBoot/%s/boot/zImage.%s' % ( getNeoLocation(), getImageNeoBoot(), getBoxHostName())):
- cmd = "echo -e '\n\n%s '" % _('...............NEOBOOT - REBOOT...............\nPlease wait, in a moment the decoder will be restarted...')
+ elif getImageNeoBoot() != 'Flash':
+ if not fileExists('/.multinfo'):
+ if not fileExists('%sImageBoot/%s/boot/zImage.%s' % (getNeoLocation(), getImageNeoBoot(), getBoxHostName())):
+ cmd = "echo -e '\n\n%s '" % _('...............NEOBOOT - REBOOT...............\nPlease wait, in a moment the decoder will be restarted...')
cmd1 = 'sleep 5; ln -sfn /sbin/neoinitarm /sbin/init; /etc/init.d/reboot'
-
- elif fileExists('%sImageBoot/%s/boot/zImage.%s' % ( getNeoLocation(), getImageNeoBoot(), getBoxHostName())):
- cmd = "echo -e '\n\n%s '" % _('...............NEOBOOT - REBOOT...............\nPlease wait, in a moment the decoder will be restarted...')
- cmd1 = 'ln -sfn /sbin/neoinitarmvu /sbin/init; /usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/files/kernel.sh '
-
- elif fileExists('/.multinfo'):
- if not fileExists('%sImageBoot/%s/boot/zImage.%s' % ( getNeoLocation(), getImageNeoBoot(), getBoxHostName())):
- cmd = "echo -e '\n\n%s '" % _('...............NEOBOOT - REBOOT...............\nPlease wait, in a moment the decoder will be restarted...')
- cmd1 = 'dd if=' + getNeoLocation() + 'ImagesUpload/.kernel/flash-kernel-' + getBoxHostName() + '.bin of=/dev/mmcblk0p1; cd /media/InternalFlash; ln -sf "neoinitarm" "/media/InternalFlash/sbin/init" ; sleep 2; reboot -dfhi '
-
- elif fileExists('%sImageBoot/%s/boot/zImage.%s' % ( getNeoLocation(), getImageNeoBoot(), getBoxHostName())):
- cmd = "echo -e '\n\n%s '" % _('...............NEOBOOT - REBOOT...............\nPlease wait, in a moment the decoder will be restarted...')
- cmd1 = 'cd /media/InternalFlash; ln -sf "neoinitarmvu" "/media/InternalFlash/sbin/init"; /usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/files/kernel.sh '
-
+
+ elif fileExists('%sImageBoot/%s/boot/zImage.%s' % (getNeoLocation(), getImageNeoBoot(), getBoxHostName())):
+ cmd = "echo -e '\n\n%s '" % _('...............NEOBOOT - REBOOT...............\nPlease wait, in a moment the decoder will be restarted...')
+ cmd1 = 'ln -sfn /sbin/neoinitarmvu /sbin/init; /usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/files/kernel.sh '
+
+ elif fileExists('/.multinfo'):
+ if not fileExists('%sImageBoot/%s/boot/zImage.%s' % (getNeoLocation(), getImageNeoBoot(), getBoxHostName())):
+ cmd = "echo -e '\n\n%s '" % _('...............NEOBOOT - REBOOT...............\nPlease wait, in a moment the decoder will be restarted...')
+ cmd1 = 'dd if=' + getNeoLocation() + 'ImagesUpload/.kernel/flash-kernel-' + getBoxHostName() + '.bin of=/dev/mmcblk0p1; cd /media/InternalFlash; ln -sf "neoinitarm" "/media/InternalFlash/sbin/init" ; sleep 2; reboot -dfhi '
+
+ elif fileExists('%sImageBoot/%s/boot/zImage.%s' % (getNeoLocation(), getImageNeoBoot(), getBoxHostName())):
+ cmd = "echo -e '\n\n%s '" % _('...............NEOBOOT - REBOOT...............\nPlease wait, in a moment the decoder will be restarted...')
+ cmd1 = 'cd /media/InternalFlash; ln -sf "neoinitarmvu" "/media/InternalFlash/sbin/init"; /usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/files/kernel.sh '
+
self.session.open(Console, _('NeoBoot ARM VU'), [cmd, cmd1])
- self.close()
-
+ self.close()
+
else:
os.system('echo "Flash " >> ' + getNeoLocation() + 'ImageBoot/.neonextboot')
self.messagebox = self.session.open(MessageBox, _('It looks like it that multiboot does not support this STB.'), MessageBox.TYPE_INFO, 8)
diff --git a/NeoBoot/ubi_reader_arm/argparse_neo.py b/NeoBoot/ubi_reader_arm/argparse_neo.py
index 43ee10a..696480d 100644
--- a/NeoBoot/ubi_reader_arm/argparse_neo.py
+++ b/NeoBoot/ubi_reader_arm/argparse_neo.py
@@ -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):
@@ -64,7 +66,7 @@ def _ensure_value(namespace, name, value):
class HelpFormatter(object):
- def __init__(self, prog, indent_increment = 2, max_help_position = 24, width = None):
+ def __init__(self, prog, indent_increment=2, max_help_position=24, width=None):
if width is None:
try:
width = int(_os.environ['COLUMNS'])
@@ -95,7 +97,7 @@ class HelpFormatter(object):
class _Section(object):
- def __init__(self, formatter, parent, heading = None):
+ def __init__(self, formatter, parent, heading=None):
self.formatter = formatter
self.parent = parent
self.heading = heading
@@ -108,7 +110,7 @@ class HelpFormatter(object):
for func, args in self.items:
func(*args)
- item_help = join([ func(*args) for func, args in self.items ])
+ item_help = join([func(*args) for func, args in self.items])
if self.parent is not None:
self.formatter._dedent()
if not item_help:
@@ -143,7 +145,7 @@ class HelpFormatter(object):
self._add_item(self._format_text, [text])
return
- def add_usage(self, usage, actions, groups, prefix = None):
+ def add_usage(self, usage, actions, groups, prefix=None):
if usage is not SUPPRESS:
args = (usage,
actions,
@@ -158,7 +160,7 @@ class HelpFormatter(object):
for subaction in self._iter_indented_subactions(action):
invocations.append(get_invocation(subaction))
- invocation_length = max([ len(s) for s in invocations ])
+ invocation_length = max([len(s) for s in invocations])
action_length = invocation_length + self._current_indent
self._action_max_length = max(self._action_max_length, action_length)
self._add_item(self._format_action, [action])
@@ -175,7 +177,7 @@ class HelpFormatter(object):
return help
def _join_parts(self, part_strings):
- return ''.join([ part for part in part_strings if part and part is not SUPPRESS ])
+ return ''.join([part for part in part_strings if part and part is not SUPPRESS])
def _format_usage(self, usage, actions, groups, prefix):
if prefix is None:
@@ -196,7 +198,7 @@ class HelpFormatter(object):
format = self._format_actions_usage
action_usage = format(optionals + positionals, groups)
- usage = ' '.join([ s for s in [prog, action_usage] if s ])
+ usage = ' '.join([s for s in [prog, action_usage] if s])
text_width = self._width - self._current_indent
if len(prefix) + len(usage) > text_width:
part_regexp = '\\(.*?\\)+|\\[.*?\\]+|\\S+'
@@ -205,7 +207,7 @@ class HelpFormatter(object):
opt_parts = _re.findall(part_regexp, opt_usage)
pos_parts = _re.findall(part_regexp, pos_usage)
- def get_lines(parts, indent, prefix = None):
+ def get_lines(parts, indent, prefix=None):
lines = []
line = []
if prefix is not None:
@@ -305,7 +307,7 @@ class HelpFormatter(object):
for i in sorted(inserts, reverse=True):
parts[i:i] = [inserts[i]]
- text = ' '.join([ item for item in parts if item is not None ])
+ text = ' '.join([item for item in parts if item is not None])
open = '[\\[(]'
close = '[\\])]'
text = _re.sub('(%s) ' % open, '\\1', text)
@@ -376,7 +378,7 @@ class HelpFormatter(object):
if action.metavar is not None:
result = action.metavar
elif action.choices is not None:
- choice_strs = [ str(choice) for choice in action.choices ]
+ choice_strs = [str(choice) for choice in action.choices]
result = '{%s}' % ','.join(choice_strs)
else:
result = default_metavar
@@ -404,7 +406,7 @@ class HelpFormatter(object):
elif action.nargs == PARSER:
result = '%s ...' % get_metavar(1)
else:
- formats = [ '%s' for _ in range(action.nargs) ]
+ formats = ['%s' for _ in range(action.nargs)]
result = ' '.join(formats) % get_metavar(action.nargs)
return result
@@ -419,7 +421,7 @@ class HelpFormatter(object):
params[name] = params[name].__name__
if params.get('choices') is not None:
- choices_str = ', '.join([ str(c) for c in params['choices'] ])
+ choices_str = ', '.join([str(c) for c in params['choices']])
params['choices'] = choices_str
return self._get_help_string(action) % params
@@ -450,7 +452,7 @@ class HelpFormatter(object):
class RawDescriptionHelpFormatter(HelpFormatter):
def _fill_text(self, text, width, indent):
- return ''.join([ indent + line for line in text.splitlines(True) ])
+ return ''.join([indent + line for line in text.splitlines(True)])
class RawTextHelpFormatter(RawDescriptionHelpFormatter):
@@ -505,7 +507,7 @@ class ArgumentTypeError(Exception):
class Action(_AttributeHolder):
- def __init__(self, option_strings, dest, nargs = None, const = None, default = None, type = None, choices = None, required = False, help = None, metavar = None):
+ def __init__(self, option_strings, dest, nargs=None, const=None, default=None, type=None, choices=None, required=False, help=None, metavar=None):
self.option_strings = option_strings
self.dest = dest
self.nargs = nargs
@@ -527,15 +529,15 @@ class Action(_AttributeHolder):
'choices',
'help',
'metavar']
- return [ (name, getattr(self, name)) for name in names ]
+ return [(name, getattr(self, name)) for name in names]
- def __call__(self, parser, namespace, values, option_string = None):
+ def __call__(self, parser, namespace, values, option_string=None):
raise NotImplementedError(_('.__call__() not defined'))
class _StoreAction(Action):
- def __init__(self, option_strings, dest, nargs = None, const = None, default = None, type = None, choices = None, required = False, help = None, metavar = None):
+ def __init__(self, option_strings, dest, nargs=None, const=None, default=None, type=None, choices=None, required=False, help=None, metavar=None):
if nargs == 0:
raise ValueError('nargs for store actions must be > 0; if you have nothing to store, actions such as store true or store const may be more appropriate')
if const is not None and nargs != OPTIONAL:
@@ -543,34 +545,34 @@ class _StoreAction(Action):
super(_StoreAction, self).__init__(option_strings=option_strings, dest=dest, nargs=nargs, const=const, default=default, type=type, choices=choices, required=required, help=help, metavar=metavar)
return
- def __call__(self, parser, namespace, values, option_string = None):
+ def __call__(self, parser, namespace, values, option_string=None):
setattr(namespace, self.dest, values)
class _StoreConstAction(Action):
- def __init__(self, option_strings, dest, const, default = None, required = False, help = None, metavar = None):
+ def __init__(self, option_strings, dest, const, default=None, required=False, help=None, metavar=None):
super(_StoreConstAction, self).__init__(option_strings=option_strings, dest=dest, nargs=0, const=const, default=default, required=required, help=help)
- def __call__(self, parser, namespace, values, option_string = None):
+ def __call__(self, parser, namespace, values, option_string=None):
setattr(namespace, self.dest, self.const)
class _StoreTrueAction(_StoreConstAction):
- def __init__(self, option_strings, dest, default = False, required = False, help = None):
+ def __init__(self, option_strings, dest, default=False, required=False, help=None):
super(_StoreTrueAction, self).__init__(option_strings=option_strings, dest=dest, const=True, default=default, required=required, help=help)
class _StoreFalseAction(_StoreConstAction):
- def __init__(self, option_strings, dest, default = True, required = False, help = None):
+ def __init__(self, option_strings, dest, default=True, required=False, help=None):
super(_StoreFalseAction, self).__init__(option_strings=option_strings, dest=dest, const=False, default=default, required=required, help=help)
class _AppendAction(Action):
- def __init__(self, option_strings, dest, nargs = None, const = None, default = None, type = None, choices = None, required = False, help = None, metavar = None):
+ def __init__(self, option_strings, dest, nargs=None, const=None, default=None, type=None, choices=None, required=False, help=None, metavar=None):
if nargs == 0:
raise ValueError('nargs for append actions must be > 0; if arg strings are not supplying the value to append, the append const action may be more appropriate')
if const is not None and nargs != OPTIONAL:
@@ -578,7 +580,7 @@ class _AppendAction(Action):
super(_AppendAction, self).__init__(option_strings=option_strings, dest=dest, nargs=nargs, const=const, default=default, type=type, choices=choices, required=required, help=help, metavar=metavar)
return
- def __call__(self, parser, namespace, values, option_string = None):
+ def __call__(self, parser, namespace, values, option_string=None):
items = _copy.copy(_ensure_value(namespace, self.dest, []))
items.append(values)
setattr(namespace, self.dest, items)
@@ -586,10 +588,10 @@ class _AppendAction(Action):
class _AppendConstAction(Action):
- def __init__(self, option_strings, dest, const, default = None, required = False, help = None, metavar = None):
+ def __init__(self, option_strings, dest, const, default=None, required=False, help=None, metavar=None):
super(_AppendConstAction, self).__init__(option_strings=option_strings, dest=dest, nargs=0, const=const, default=default, required=required, help=help, metavar=metavar)
- def __call__(self, parser, namespace, values, option_string = None):
+ def __call__(self, parser, namespace, values, option_string=None):
items = _copy.copy(_ensure_value(namespace, self.dest, []))
items.append(self.const)
setattr(namespace, self.dest, items)
@@ -597,31 +599,31 @@ class _AppendConstAction(Action):
class _CountAction(Action):
- def __init__(self, option_strings, dest, default = None, required = False, help = None):
+ def __init__(self, option_strings, dest, default=None, required=False, help=None):
super(_CountAction, self).__init__(option_strings=option_strings, dest=dest, nargs=0, default=default, required=required, help=help)
- def __call__(self, parser, namespace, values, option_string = None):
+ def __call__(self, parser, namespace, values, option_string=None):
new_count = _ensure_value(namespace, self.dest, 0) + 1
setattr(namespace, self.dest, new_count)
class _HelpAction(Action):
- def __init__(self, option_strings, dest = SUPPRESS, default = SUPPRESS, help = None):
+ def __init__(self, option_strings, dest=SUPPRESS, default=SUPPRESS, help=None):
super(_HelpAction, self).__init__(option_strings=option_strings, dest=dest, default=default, nargs=0, help=help)
- def __call__(self, parser, namespace, values, option_string = None):
+ def __call__(self, parser, namespace, values, option_string=None):
parser.print_help()
parser.exit()
class _VersionAction(Action):
- def __init__(self, option_strings, version = None, dest = SUPPRESS, default = SUPPRESS, help = "show program's version number and exit"):
+ def __init__(self, option_strings, version=None, dest=SUPPRESS, default=SUPPRESS, help="show program's version number and exit"):
super(_VersionAction, self).__init__(option_strings=option_strings, dest=dest, default=default, nargs=0, help=help)
self.version = version
- def __call__(self, parser, namespace, values, option_string = None):
+ def __call__(self, parser, namespace, values, option_string=None):
version = self.version
if version is None:
version = parser.version
@@ -639,7 +641,7 @@ class _SubParsersAction(Action):
sup = super(_SubParsersAction._ChoicesPseudoAction, self)
sup.__init__(option_strings=[], dest=name, help=help)
- def __init__(self, option_strings, prog, parser_class, dest = SUPPRESS, help = None, metavar = None):
+ def __init__(self, option_strings, prog, parser_class, dest=SUPPRESS, help=None, metavar=None):
self._prog_prefix = prog
self._parser_class = parser_class
self._name_parser_map = _collections.OrderedDict()
@@ -660,7 +662,7 @@ class _SubParsersAction(Action):
def _get_subactions(self):
return self._choices_actions
- def __call__(self, parser, namespace, values, option_string = None):
+ def __call__(self, parser, namespace, values, option_string=None):
parser_name = values[0]
arg_strings = values[1:]
if self.dest is not SUPPRESS:
@@ -680,7 +682,7 @@ class _SubParsersAction(Action):
class FileType(object):
- def __init__(self, mode = 'r', bufsize = -1):
+ def __init__(self, mode='r', bufsize=-1):
self._mode = mode
self._bufsize = bufsize
@@ -756,7 +758,7 @@ class _ActionsContainer(object):
registry = self._registries.setdefault(registry_name, {})
registry[value] = object
- def _registry_get(self, registry_name, value, default = None):
+ def _registry_get(self, registry_name, value, default=None):
return self._registries[registry_name].get(value, default)
def set_defaults(self, **kwargs):
@@ -888,7 +890,7 @@ class _ActionsContainer(object):
dest = dest.replace('-', '_')
return dict(kwargs, dest=dest, option_strings=option_strings)
- def _pop_action_class(self, kwargs, default = None):
+ def _pop_action_class(self, kwargs, default=None):
action = kwargs.pop('action', default)
return self._registry_get('action', action, action)
@@ -913,7 +915,7 @@ class _ActionsContainer(object):
def _handle_conflict_error(self, action, conflicting_actions):
message = _('conflicting option string(s): %s')
- conflict_string = ', '.join([ option_string for option_string, action in conflicting_actions ])
+ conflict_string = ', '.join([option_string for option_string, action in conflicting_actions])
raise ArgumentError(action, message % conflict_string)
def _handle_conflict_resolve(self, action, conflicting_actions):
@@ -928,7 +930,7 @@ class _ActionsContainer(object):
class _ArgumentGroup(_ActionsContainer):
- def __init__(self, container, title = None, description = None, **kwargs):
+ def __init__(self, container, title=None, description=None, **kwargs):
update = kwargs.setdefault
update('conflict_handler', container.conflict_handler)
update('prefix_chars', container.prefix_chars)
@@ -956,7 +958,7 @@ class _ArgumentGroup(_ActionsContainer):
class _MutuallyExclusiveGroup(_ArgumentGroup):
- def __init__(self, container, required = False):
+ def __init__(self, container, required=False):
super(_MutuallyExclusiveGroup, self).__init__(container)
self.required = required
self._container = container
@@ -976,7 +978,7 @@ class _MutuallyExclusiveGroup(_ArgumentGroup):
class ArgumentParser(_AttributeHolder, _ActionsContainer):
- def __init__(self, prog = None, usage = None, description = None, epilog = None, version = None, parents = [], formatter_class = HelpFormatter, prefix_chars = '-', fromfile_prefix_chars = None, argument_default = None, conflict_handler = 'error', add_help = True):
+ def __init__(self, prog=None, usage=None, description=None, epilog=None, version=None, parents=[], formatter_class=HelpFormatter, prefix_chars='-', fromfile_prefix_chars=None, argument_default=None, conflict_handler='error', add_help=True):
if version is not None:
import warnings
warnings.warn('The "version" argument to ArgumentParser is deprecated. Please use "add_argument(..., action=\'version\', version="N", ...)" instead', DeprecationWarning)
@@ -1024,7 +1026,7 @@ class ArgumentParser(_AttributeHolder, _ActionsContainer):
'formatter_class',
'conflict_handler',
'add_help']
- return [ (name, getattr(self, name)) for name in names ]
+ return [(name, getattr(self, name)) for name in names]
def add_subparsers(self, **kwargs):
if self._subparsers is not None:
@@ -1055,19 +1057,19 @@ class ArgumentParser(_AttributeHolder, _ActionsContainer):
return action
def _get_optional_actions(self):
- return [ action for action in self._actions if action.option_strings ]
+ return [action for action in self._actions if action.option_strings]
def _get_positional_actions(self):
- return [ action for action in self._actions if not action.option_strings ]
+ return [action for action in self._actions if not action.option_strings]
- def parse_args(self, args = None, namespace = None):
+ def parse_args(self, args=None, namespace=None):
args, argv = self.parse_known_args(args, namespace)
if argv:
msg = _('unrecognized arguments: %s')
self.error(msg % ' '.join(argv))
return args
- def parse_known_args(self, args = None, namespace = None):
+ def parse_known_args(self, args=None, namespace=None):
if args is None:
args = _sys.argv[1:]
if namespace is None:
@@ -1130,7 +1132,7 @@ class ArgumentParser(_AttributeHolder, _ActionsContainer):
seen_actions = set()
seen_non_default_actions = set()
- def take_action(action, argument_strings, option_string = None):
+ def take_action(action, argument_strings, option_string=None):
seen_actions.add(action)
argument_values = self._get_values(action, argument_strings)
if argument_values is not action.default:
@@ -1211,7 +1213,7 @@ class ArgumentParser(_AttributeHolder, _ActionsContainer):
else:
max_option_string_index = -1
while start_index <= max_option_string_index:
- next_option_string_index = min([ index for index in option_string_indices if index >= start_index ])
+ next_option_string_index = min([index for index in option_string_indices if index >= start_index])
if start_index != next_option_string_index:
positionals_end_index = consume_positionals(start_index)
if positionals_end_index > start_index:
@@ -1241,7 +1243,7 @@ class ArgumentParser(_AttributeHolder, _ActionsContainer):
if action in seen_non_default_actions:
break
else:
- names = [ _get_action_name(action) for action in group._group_actions if action.help is not SUPPRESS ]
+ names = [_get_action_name(action) for action in group._group_actions if action.help is not SUPPRESS]
msg = _('one of the arguments %s is required')
self.error(msg % ' '.join(names))
@@ -1291,10 +1293,10 @@ class ArgumentParser(_AttributeHolder, _ActionsContainer):
result = []
for i in range(len(actions), 0, -1):
actions_slice = actions[:i]
- pattern = ''.join([ self._get_nargs_pattern(action) for action in actions_slice ])
+ pattern = ''.join([self._get_nargs_pattern(action) for action in actions_slice])
match = _re.match(pattern, arg_strings_pattern)
if match is not None:
- result.extend([ len(string) for string in match.groups() ])
+ result.extend([len(string) for string in match.groups()])
break
return result
@@ -1317,7 +1319,7 @@ class ArgumentParser(_AttributeHolder, _ActionsContainer):
return (action, option_string, explicit_arg)
option_tuples = self._get_option_tuples(arg_string)
if len(option_tuples) > 1:
- options = ', '.join([ option_string for action, option_string, explicit_arg in option_tuples ])
+ options = ', '.join([option_string for action, option_string, explicit_arg in option_tuples])
tup = (arg_string, options)
self.error(_('ambiguous option: %s could match %s') % tup)
elif len(option_tuples) == 1:
@@ -1388,7 +1390,7 @@ class ArgumentParser(_AttributeHolder, _ActionsContainer):
def _get_values(self, action, arg_strings):
if action.nargs not in [PARSER, REMAINDER]:
- arg_strings = [ s for s in arg_strings if s != '--' ]
+ arg_strings = [s for s in arg_strings if s != '--']
if not arg_strings and action.nargs == OPTIONAL:
if action.option_strings:
value = action.const
@@ -1408,12 +1410,12 @@ class ArgumentParser(_AttributeHolder, _ActionsContainer):
value = self._get_value(action, arg_string)
self._check_value(action, value)
elif action.nargs == REMAINDER:
- value = [ self._get_value(action, v) for v in arg_strings ]
+ value = [self._get_value(action, v) for v in arg_strings]
elif action.nargs == PARSER:
- value = [ self._get_value(action, v) for v in arg_strings ]
+ value = [self._get_value(action, v) for v in arg_strings]
self._check_value(action, value[0])
else:
- value = [ self._get_value(action, v) for v in arg_strings ]
+ value = [self._get_value(action, v) for v in arg_strings]
for v in value:
self._check_value(action, v)
@@ -1472,35 +1474,35 @@ class ArgumentParser(_AttributeHolder, _ActionsContainer):
def _get_formatter(self):
return self.formatter_class(prog=self.prog)
- def print_usage(self, file = None):
+ def print_usage(self, file=None):
if file is None:
file = _sys.stdout
self._print_message(self.format_usage(), file)
return
- def print_help(self, file = None):
+ def print_help(self, file=None):
if file is None:
file = _sys.stdout
self._print_message(self.format_help(), file)
return
- def print_version(self, file = None):
+ def print_version(self, file=None):
import warnings
warnings.warn('The print_version method is deprecated -- the "version" argument to ArgumentParser is no longer supported.', DeprecationWarning)
self._print_message(self.format_version(), file)
- def _print_message(self, message, file = None):
+ def _print_message(self, message, file=None):
if message:
if file is None:
file = _sys.stderr
file.write(message)
return
- def exit(self, status = 0, message = None):
+ def exit(self, status=0, message=None):
if message:
self._print_message(message, _sys.stderr)
_sys.exit(status)
def error(self, message):
self.print_usage(_sys.stderr)
- self.exit(2, _('%s: error: %s\n') % (self.prog, message))
\ No newline at end of file
+ self.exit(2, _('%s: error: %s\n') % (self.prog, message))
diff --git a/NeoBoot/ubi_reader_arm/ubi/__init__.py b/NeoBoot/ubi_reader_arm/ubi/__init__.py
index 8da31e4..2ad94bb 100644
--- a/NeoBoot/ubi_reader_arm/ubi/__init__.py
+++ b/NeoBoot/ubi_reader_arm/ubi/__init__.py
@@ -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):
@@ -93,7 +94,7 @@ class ubi:
blocks = property(_get_blocks)
- def display(self, tab = ''):
+ def display(self, tab=''):
display.ubi(self, tab)
@@ -136,4 +137,4 @@ def get_peb_size(path):
most_frequent = occurances[offset]
block_size = offset
- return block_size
\ No newline at end of file
+ return block_size
diff --git a/NeoBoot/ubi_reader_arm/ubi/block/__init__.py b/NeoBoot/ubi_reader_arm/ubi/block/__init__.py
index 7d8c1de..e6575eb 100644
--- a/NeoBoot/ubi_reader_arm/ubi/block/__init__.py
+++ b/NeoBoot/ubi_reader_arm/ubi/block/__init__.py
@@ -4,6 +4,7 @@ from ubi import display
from ubi.defines import *
from ubi.headers import *
+
class description(object):
def __init__(self, block_buf):
@@ -28,12 +29,12 @@ class description(object):
def __repr__(self):
return 'Block: PEB# %s: LEB# %s' % (self.peb_num, self.leb_num)
- def display(self, tab = ''):
+ def display(self, tab=''):
display.block(self, tab)
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):
@@ -56,4 +57,4 @@ def extract_blocks(ubi):
ubi.first_peb_num = cur_offset / ubi.file.block_size
ubi.file.start_offset = cur_offset
- return blocks
\ No newline at end of file
+ return blocks
diff --git a/NeoBoot/ubi_reader_arm/ubi/block/layout.py b/NeoBoot/ubi_reader_arm/ubi/block/layout.py
index d2f95de..065c669 100644
--- a/NeoBoot/ubi_reader_arm/ubi/block/layout.py
+++ b/NeoBoot/ubi_reader_arm/ubi/block/layout.py
@@ -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
\ No newline at end of file
+ return layout_pairs
diff --git a/NeoBoot/ubi_reader_arm/ubi/block/sort.py b/NeoBoot/ubi_reader_arm/ubi/block/sort.py
index 6687f9e..3f01628 100644
--- a/NeoBoot/ubi_reader_arm/ubi/block/sort.py
+++ b/NeoBoot/ubi_reader_arm/ubi/block/sort.py
@@ -19,7 +19,7 @@ def by_image_seq(blocks, image_seq):
def by_range(blocks, block_range):
peb_range = range(block_range[0], block_range[1])
- return [ i for i in blocks if i in peb_range ]
+ return [i for i in blocks if i in peb_range]
def by_leb(blocks):
@@ -36,7 +36,7 @@ def by_leb(blocks):
return sorted(blocks.iterkeys(), key=lambda x: blocks[x].leb_num)
-def by_vol_id(blocks, slist = None):
+def by_vol_id(blocks, slist=None):
vol_blocks = {}
for i in blocks:
if slist and i not in slist:
@@ -50,7 +50,7 @@ def by_vol_id(blocks, slist = None):
return vol_blocks
-def clean_bad(blocks, slist = None):
+def clean_bad(blocks, slist=None):
clean_blocks = []
for i in range(0, len(blocks)):
if slist and i not in slist:
@@ -61,7 +61,7 @@ def clean_bad(blocks, slist = None):
return clean_blocks
-def by_type(blocks, slist = None):
+def by_type(blocks, slist=None):
layout = []
data = []
int_vol = []
@@ -81,4 +81,4 @@ def by_type(blocks, slist = None):
return (layout,
data,
int_vol,
- unknown)
\ No newline at end of file
+ unknown)
diff --git a/NeoBoot/ubi_reader_arm/ubi/display.py b/NeoBoot/ubi_reader_arm/ubi/display.py
index 8081041..5124951 100644
--- a/NeoBoot/ubi_reader_arm/ubi/display.py
+++ b/NeoBoot/ubi_reader_arm/ubi/display.py
@@ -1,7 +1,8 @@
#!/usr/bin/python
from ubi.defines import PRINT_COMPAT_LIST, PRINT_VOL_TYPE_LIST, UBI_VTBL_AUTORESIZE_FLG
-def ubi(ubi, tab = ''):
+
+def ubi(ubi, tab=''):
print '%sUBI File' % tab
print '%s---------------------' % tab
print '\t%sMin I/O: %s' % (tab, ubi.min_io_size)
@@ -15,7 +16,7 @@ def ubi(ubi, tab = ''):
print '\t%sFirst UBI PEB Number: %s' % (tab, ubi.first_peb_num)
-def image(image, tab = ''):
+def image(image, tab=''):
print '%s%s' % (tab, image)
print '%s---------------------' % tab
print '\t%sImage Sequence Num: %s' % (tab, image.image_seq)
@@ -25,7 +26,7 @@ def image(image, tab = ''):
print '\t%sPEB Range: %s - %s' % (tab, image.peb_range[0], image.peb_range[1])
-def volume(volume, tab = ''):
+def volume(volume, tab=''):
print '%s%s' % (tab, volume)
print '%s---------------------' % tab
print '\t%sVol ID: %s' % (tab, volume.vol_id)
@@ -38,7 +39,7 @@ def volume(volume, tab = ''):
print '\n'
-def block(block, tab = '\t'):
+def block(block, tab='\t'):
print '%s%s' % (tab, block)
print '%s---------------------' % tab
print '\t%sFile Offset: %s' % (tab, block.file_offset)
@@ -68,14 +69,14 @@ def block(block, tab = '\t'):
print '\n'
-def ec_hdr(ec_hdr, tab = ''):
+def ec_hdr(ec_hdr, tab=''):
for key, value in ec_hdr:
if key == 'errors':
value = ','.join(value)
print '%s%s: %r' % (tab, key, value)
-def vid_hdr(vid_hdr, tab = ''):
+def vid_hdr(vid_hdr, tab=''):
for key, value in vid_hdr:
if key == 'errors':
value = ','.join(value)
@@ -92,7 +93,7 @@ def vid_hdr(vid_hdr, tab = ''):
print '%s%s: %s' % (tab, key, value)
-def vol_rec(vol_rec, tab = ''):
+def vol_rec(vol_rec, tab=''):
for key, value in vol_rec:
if key == 'errors':
value = ','.join(value)
@@ -105,4 +106,4 @@ def vol_rec(vol_rec, tab = ''):
value = 'autoresize'
elif key == 'name':
value = value.strip('\x00')
- print '%s%s: %s' % (tab, key, value)
\ No newline at end of file
+ print '%s%s: %s' % (tab, key, value)
diff --git a/NeoBoot/ubi_reader_arm/ubi/headers/__init__.py b/NeoBoot/ubi_reader_arm/ubi/headers/__init__.py
index 474a369..5641b23 100644
--- a/NeoBoot/ubi_reader_arm/ubi/headers/__init__.py
+++ b/NeoBoot/ubi_reader_arm/ubi/headers/__init__.py
@@ -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
\ No newline at end of file
+ return vtbl_recs
diff --git a/NeoBoot/ubi_reader_arm/ubi/headers/errors.py b/NeoBoot/ubi_reader_arm/ubi/headers/errors.py
index eee0ebd..04b3d46 100644
--- a/NeoBoot/ubi_reader_arm/ubi/headers/errors.py
+++ b/NeoBoot/ubi_reader_arm/ubi/headers/errors.py
@@ -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
\ No newline at end of file
+ return vtbl_rec
diff --git a/NeoBoot/ubi_reader_arm/ubi/image.py b/NeoBoot/ubi_reader_arm/ubi/image.py
index b613ce4..77c0539 100644
--- a/NeoBoot/ubi_reader_arm/ubi/image.py
+++ b/NeoBoot/ubi_reader_arm/ubi/image.py
@@ -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):
@@ -34,5 +35,5 @@ class description(object):
volumes = property(_get_volumes)
- def display(self, tab = ''):
- display.image(self, tab)
\ No newline at end of file
+ def display(self, tab=''):
+ display.image(self, tab)
diff --git a/NeoBoot/ubi_reader_arm/ubi/volume/__init__.py b/NeoBoot/ubi_reader_arm/ubi/volume/__init__.py
index 70d3e76..b9d96e8 100644
--- a/NeoBoot/ubi_reader_arm/ubi/volume/__init__.py
+++ b/NeoBoot/ubi_reader_arm/ubi/volume/__init__.py
@@ -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):
@@ -41,7 +42,7 @@ class description(object):
def get_blocks(self, blocks):
return get_blocks_in_list(blocks, self._block_list)
- def display(self, tab = ''):
+ def display(self, tab=''):
display.volume(self, tab)
def reader(self, ubi):
@@ -64,4 +65,4 @@ def get_volumes(blocks, layout_info):
vol_blocks_lists[vol_rec.rec_index] = []
volumes[vol_name] = description(vol_rec.rec_index, vol_rec, vol_blocks_lists[vol_rec.rec_index])
- return volumes
\ No newline at end of file
+ return volumes
diff --git a/NeoBoot/ubi_reader_arm/ubi_extract_files.py b/NeoBoot/ubi_reader_arm/ubi_extract_files.py
index c4e0384..1ca8137 100644
--- a/NeoBoot/ubi_reader_arm/ubi_extract_files.py
+++ b/NeoBoot/ubi_reader_arm/ubi_extract_files.py
@@ -5,7 +5,7 @@ import sys
#import argparse_neo
try:
import argparse
-except:
+except:
import argparse_neo
from ubi import ubi, get_peb_size
from ubifs import ubifs
@@ -18,7 +18,7 @@ if __name__ == '__main__':
# parser = argparse_neo.ArgumentParser(usage=usage, description=description)
try:
parser = argparse.ArgumentParser(usage=usage, description=description)
- except:
+ except:
parser = argparse_neo.ArgumentParser(usage=usage, description=description)
parser.add_argument('-l', '--log-file', dest='logpath', help='Log output to file output/LOGPATH. (default: ubifs_output.log)')
parser.add_argument('-k', '--keep-permissions', action='store_true', dest='permissions', help='Maintain file permissions, requires running as root. (default: False)')
@@ -70,4 +70,4 @@ if __name__ == '__main__':
print 'Wait almost over ...\nLoading the image to: %s' % vol_out_path
extract_files(uubifs, vol_out_path, perms)
- sys.exit(0)
\ No newline at end of file
+ sys.exit(0)
diff --git a/NeoBoot/ubi_reader_arm/ubi_io/__init__.py b/NeoBoot/ubi_reader_arm/ubi_io/__init__.py
index 9f3bd62..a7aec6b 100644
--- a/NeoBoot/ubi_reader_arm/ubi_io/__init__.py
+++ b/NeoBoot/ubi_reader_arm/ubi_io/__init__.py
@@ -1,9 +1,10 @@
#!/usr/bin/python
from ubi.block import sort
+
class ubi_file(object):
- def __init__(self, path, block_size, start_offset = 0, end_offset = None):
+ def __init__(self, path, block_size, start_offset=0, end_offset=None):
self._fhandle = open(path, 'rb')
self._start_offset = start_offset
if end_offset:
@@ -113,4 +114,4 @@ class leb_virtual_file:
yield '\xff' * self._ubi.leb_size
last_leb += 1
- yield self._ubi.file.read_block_data(self._ubi.blocks[block])
\ No newline at end of file
+ yield self._ubi.file.read_block_data(self._ubi.blocks[block])
diff --git a/NeoBoot/ubi_reader_arm/ubifs/__init__.py b/NeoBoot/ubi_reader_arm/ubifs/__init__.py
index 05774c3..0ad47ca 100644
--- a/NeoBoot/ubi_reader_arm/ubifs/__init__.py
+++ b/NeoBoot/ubi_reader_arm/ubifs/__init__.py
@@ -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
\ No newline at end of file
+ return block_size
diff --git a/NeoBoot/ubi_reader_arm/ubifs/log.py b/NeoBoot/ubi_reader_arm/ubifs/log.py
index 1c2d15b..9709a86 100644
--- a/NeoBoot/ubi_reader_arm/ubifs/log.py
+++ b/NeoBoot/ubi_reader_arm/ubifs/log.py
@@ -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)
\ No newline at end of file
+ self._out(buf)
diff --git a/NeoBoot/ubi_reader_arm/ubifs/misc.py b/NeoBoot/ubi_reader_arm/ubifs/misc.py
index 658068b..9a4cf74 100644
--- a/NeoBoot/ubi_reader_arm/ubifs/misc.py
+++ b/NeoBoot/ubi_reader_arm/ubifs/misc.py
@@ -27,6 +27,7 @@ key_types = ['ino',
'dent',
'xent']
+
def parse_key(key):
hkey, lkey = struct.unpack(' len(buf):
buf += '\x00' * (inode['ino'].size - len(buf))
- return buf
\ No newline at end of file
+ return buf
diff --git a/NeoBoot/ubi_reader_arm/ubifs/walk.py b/NeoBoot/ubi_reader_arm/ubifs/walk.py
index d8b8020..4c65114 100644
--- a/NeoBoot/ubi_reader_arm/ubifs/walk.py
+++ b/NeoBoot/ubi_reader_arm/ubifs/walk.py
@@ -2,7 +2,8 @@
from ubifs import extract
from ubifs.defines import *
-def index(ubifs, lnum, offset, inodes = {}):
+
+def index(ubifs, lnum, offset, inodes={}):
chdr = extract.common_hdr(ubifs, lnum, offset)
if chdr.node_type == UBIFS_IDX_NODE:
idxn = extract.idx_node(ubifs, lnum, offset + UBIFS_COMMON_HDR_SZ)
@@ -30,4 +31,4 @@ def index(ubifs, lnum, offset, inodes = {}):
inodes[ino_num] = {}
if 'dent' not in inodes[ino_num]:
inodes[ino_num]['dent'] = []
- inodes[ino_num]['dent'].append(dn)
\ No newline at end of file
+ inodes[ino_num]['dent'].append(dn)
diff --git a/NeoBoot/ubi_reader_arm/ui/common.py b/NeoBoot/ubi_reader_arm/ui/common.py
index c8669fd..0983692 100644
--- a/NeoBoot/ubi_reader_arm/ui/common.py
+++ b/NeoBoot/ubi_reader_arm/ui/common.py
@@ -6,7 +6,8 @@ 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):
+
+def extract_files(ubifs, out_path, perms=False):
try:
inodes = {}
walk.index(ubifs, ubifs.master_node.root_lnum, ubifs.master_node.root_offs, inodes)
@@ -85,4 +86,4 @@ def get_ubi_params(ubi):
'args': ubi_args[img_seq][volume],
'ini': ini_params[img_seq][volume]}
- return ubi_params
\ No newline at end of file
+ return ubi_params
diff --git a/NeoBoot/ubi_reader_mips/argparse_neo.py b/NeoBoot/ubi_reader_mips/argparse_neo.py
index 43ee10a..696480d 100644
--- a/NeoBoot/ubi_reader_mips/argparse_neo.py
+++ b/NeoBoot/ubi_reader_mips/argparse_neo.py
@@ -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):
@@ -64,7 +66,7 @@ def _ensure_value(namespace, name, value):
class HelpFormatter(object):
- def __init__(self, prog, indent_increment = 2, max_help_position = 24, width = None):
+ def __init__(self, prog, indent_increment=2, max_help_position=24, width=None):
if width is None:
try:
width = int(_os.environ['COLUMNS'])
@@ -95,7 +97,7 @@ class HelpFormatter(object):
class _Section(object):
- def __init__(self, formatter, parent, heading = None):
+ def __init__(self, formatter, parent, heading=None):
self.formatter = formatter
self.parent = parent
self.heading = heading
@@ -108,7 +110,7 @@ class HelpFormatter(object):
for func, args in self.items:
func(*args)
- item_help = join([ func(*args) for func, args in self.items ])
+ item_help = join([func(*args) for func, args in self.items])
if self.parent is not None:
self.formatter._dedent()
if not item_help:
@@ -143,7 +145,7 @@ class HelpFormatter(object):
self._add_item(self._format_text, [text])
return
- def add_usage(self, usage, actions, groups, prefix = None):
+ def add_usage(self, usage, actions, groups, prefix=None):
if usage is not SUPPRESS:
args = (usage,
actions,
@@ -158,7 +160,7 @@ class HelpFormatter(object):
for subaction in self._iter_indented_subactions(action):
invocations.append(get_invocation(subaction))
- invocation_length = max([ len(s) for s in invocations ])
+ invocation_length = max([len(s) for s in invocations])
action_length = invocation_length + self._current_indent
self._action_max_length = max(self._action_max_length, action_length)
self._add_item(self._format_action, [action])
@@ -175,7 +177,7 @@ class HelpFormatter(object):
return help
def _join_parts(self, part_strings):
- return ''.join([ part for part in part_strings if part and part is not SUPPRESS ])
+ return ''.join([part for part in part_strings if part and part is not SUPPRESS])
def _format_usage(self, usage, actions, groups, prefix):
if prefix is None:
@@ -196,7 +198,7 @@ class HelpFormatter(object):
format = self._format_actions_usage
action_usage = format(optionals + positionals, groups)
- usage = ' '.join([ s for s in [prog, action_usage] if s ])
+ usage = ' '.join([s for s in [prog, action_usage] if s])
text_width = self._width - self._current_indent
if len(prefix) + len(usage) > text_width:
part_regexp = '\\(.*?\\)+|\\[.*?\\]+|\\S+'
@@ -205,7 +207,7 @@ class HelpFormatter(object):
opt_parts = _re.findall(part_regexp, opt_usage)
pos_parts = _re.findall(part_regexp, pos_usage)
- def get_lines(parts, indent, prefix = None):
+ def get_lines(parts, indent, prefix=None):
lines = []
line = []
if prefix is not None:
@@ -305,7 +307,7 @@ class HelpFormatter(object):
for i in sorted(inserts, reverse=True):
parts[i:i] = [inserts[i]]
- text = ' '.join([ item for item in parts if item is not None ])
+ text = ' '.join([item for item in parts if item is not None])
open = '[\\[(]'
close = '[\\])]'
text = _re.sub('(%s) ' % open, '\\1', text)
@@ -376,7 +378,7 @@ class HelpFormatter(object):
if action.metavar is not None:
result = action.metavar
elif action.choices is not None:
- choice_strs = [ str(choice) for choice in action.choices ]
+ choice_strs = [str(choice) for choice in action.choices]
result = '{%s}' % ','.join(choice_strs)
else:
result = default_metavar
@@ -404,7 +406,7 @@ class HelpFormatter(object):
elif action.nargs == PARSER:
result = '%s ...' % get_metavar(1)
else:
- formats = [ '%s' for _ in range(action.nargs) ]
+ formats = ['%s' for _ in range(action.nargs)]
result = ' '.join(formats) % get_metavar(action.nargs)
return result
@@ -419,7 +421,7 @@ class HelpFormatter(object):
params[name] = params[name].__name__
if params.get('choices') is not None:
- choices_str = ', '.join([ str(c) for c in params['choices'] ])
+ choices_str = ', '.join([str(c) for c in params['choices']])
params['choices'] = choices_str
return self._get_help_string(action) % params
@@ -450,7 +452,7 @@ class HelpFormatter(object):
class RawDescriptionHelpFormatter(HelpFormatter):
def _fill_text(self, text, width, indent):
- return ''.join([ indent + line for line in text.splitlines(True) ])
+ return ''.join([indent + line for line in text.splitlines(True)])
class RawTextHelpFormatter(RawDescriptionHelpFormatter):
@@ -505,7 +507,7 @@ class ArgumentTypeError(Exception):
class Action(_AttributeHolder):
- def __init__(self, option_strings, dest, nargs = None, const = None, default = None, type = None, choices = None, required = False, help = None, metavar = None):
+ def __init__(self, option_strings, dest, nargs=None, const=None, default=None, type=None, choices=None, required=False, help=None, metavar=None):
self.option_strings = option_strings
self.dest = dest
self.nargs = nargs
@@ -527,15 +529,15 @@ class Action(_AttributeHolder):
'choices',
'help',
'metavar']
- return [ (name, getattr(self, name)) for name in names ]
+ return [(name, getattr(self, name)) for name in names]
- def __call__(self, parser, namespace, values, option_string = None):
+ def __call__(self, parser, namespace, values, option_string=None):
raise NotImplementedError(_('.__call__() not defined'))
class _StoreAction(Action):
- def __init__(self, option_strings, dest, nargs = None, const = None, default = None, type = None, choices = None, required = False, help = None, metavar = None):
+ def __init__(self, option_strings, dest, nargs=None, const=None, default=None, type=None, choices=None, required=False, help=None, metavar=None):
if nargs == 0:
raise ValueError('nargs for store actions must be > 0; if you have nothing to store, actions such as store true or store const may be more appropriate')
if const is not None and nargs != OPTIONAL:
@@ -543,34 +545,34 @@ class _StoreAction(Action):
super(_StoreAction, self).__init__(option_strings=option_strings, dest=dest, nargs=nargs, const=const, default=default, type=type, choices=choices, required=required, help=help, metavar=metavar)
return
- def __call__(self, parser, namespace, values, option_string = None):
+ def __call__(self, parser, namespace, values, option_string=None):
setattr(namespace, self.dest, values)
class _StoreConstAction(Action):
- def __init__(self, option_strings, dest, const, default = None, required = False, help = None, metavar = None):
+ def __init__(self, option_strings, dest, const, default=None, required=False, help=None, metavar=None):
super(_StoreConstAction, self).__init__(option_strings=option_strings, dest=dest, nargs=0, const=const, default=default, required=required, help=help)
- def __call__(self, parser, namespace, values, option_string = None):
+ def __call__(self, parser, namespace, values, option_string=None):
setattr(namespace, self.dest, self.const)
class _StoreTrueAction(_StoreConstAction):
- def __init__(self, option_strings, dest, default = False, required = False, help = None):
+ def __init__(self, option_strings, dest, default=False, required=False, help=None):
super(_StoreTrueAction, self).__init__(option_strings=option_strings, dest=dest, const=True, default=default, required=required, help=help)
class _StoreFalseAction(_StoreConstAction):
- def __init__(self, option_strings, dest, default = True, required = False, help = None):
+ def __init__(self, option_strings, dest, default=True, required=False, help=None):
super(_StoreFalseAction, self).__init__(option_strings=option_strings, dest=dest, const=False, default=default, required=required, help=help)
class _AppendAction(Action):
- def __init__(self, option_strings, dest, nargs = None, const = None, default = None, type = None, choices = None, required = False, help = None, metavar = None):
+ def __init__(self, option_strings, dest, nargs=None, const=None, default=None, type=None, choices=None, required=False, help=None, metavar=None):
if nargs == 0:
raise ValueError('nargs for append actions must be > 0; if arg strings are not supplying the value to append, the append const action may be more appropriate')
if const is not None and nargs != OPTIONAL:
@@ -578,7 +580,7 @@ class _AppendAction(Action):
super(_AppendAction, self).__init__(option_strings=option_strings, dest=dest, nargs=nargs, const=const, default=default, type=type, choices=choices, required=required, help=help, metavar=metavar)
return
- def __call__(self, parser, namespace, values, option_string = None):
+ def __call__(self, parser, namespace, values, option_string=None):
items = _copy.copy(_ensure_value(namespace, self.dest, []))
items.append(values)
setattr(namespace, self.dest, items)
@@ -586,10 +588,10 @@ class _AppendAction(Action):
class _AppendConstAction(Action):
- def __init__(self, option_strings, dest, const, default = None, required = False, help = None, metavar = None):
+ def __init__(self, option_strings, dest, const, default=None, required=False, help=None, metavar=None):
super(_AppendConstAction, self).__init__(option_strings=option_strings, dest=dest, nargs=0, const=const, default=default, required=required, help=help, metavar=metavar)
- def __call__(self, parser, namespace, values, option_string = None):
+ def __call__(self, parser, namespace, values, option_string=None):
items = _copy.copy(_ensure_value(namespace, self.dest, []))
items.append(self.const)
setattr(namespace, self.dest, items)
@@ -597,31 +599,31 @@ class _AppendConstAction(Action):
class _CountAction(Action):
- def __init__(self, option_strings, dest, default = None, required = False, help = None):
+ def __init__(self, option_strings, dest, default=None, required=False, help=None):
super(_CountAction, self).__init__(option_strings=option_strings, dest=dest, nargs=0, default=default, required=required, help=help)
- def __call__(self, parser, namespace, values, option_string = None):
+ def __call__(self, parser, namespace, values, option_string=None):
new_count = _ensure_value(namespace, self.dest, 0) + 1
setattr(namespace, self.dest, new_count)
class _HelpAction(Action):
- def __init__(self, option_strings, dest = SUPPRESS, default = SUPPRESS, help = None):
+ def __init__(self, option_strings, dest=SUPPRESS, default=SUPPRESS, help=None):
super(_HelpAction, self).__init__(option_strings=option_strings, dest=dest, default=default, nargs=0, help=help)
- def __call__(self, parser, namespace, values, option_string = None):
+ def __call__(self, parser, namespace, values, option_string=None):
parser.print_help()
parser.exit()
class _VersionAction(Action):
- def __init__(self, option_strings, version = None, dest = SUPPRESS, default = SUPPRESS, help = "show program's version number and exit"):
+ def __init__(self, option_strings, version=None, dest=SUPPRESS, default=SUPPRESS, help="show program's version number and exit"):
super(_VersionAction, self).__init__(option_strings=option_strings, dest=dest, default=default, nargs=0, help=help)
self.version = version
- def __call__(self, parser, namespace, values, option_string = None):
+ def __call__(self, parser, namespace, values, option_string=None):
version = self.version
if version is None:
version = parser.version
@@ -639,7 +641,7 @@ class _SubParsersAction(Action):
sup = super(_SubParsersAction._ChoicesPseudoAction, self)
sup.__init__(option_strings=[], dest=name, help=help)
- def __init__(self, option_strings, prog, parser_class, dest = SUPPRESS, help = None, metavar = None):
+ def __init__(self, option_strings, prog, parser_class, dest=SUPPRESS, help=None, metavar=None):
self._prog_prefix = prog
self._parser_class = parser_class
self._name_parser_map = _collections.OrderedDict()
@@ -660,7 +662,7 @@ class _SubParsersAction(Action):
def _get_subactions(self):
return self._choices_actions
- def __call__(self, parser, namespace, values, option_string = None):
+ def __call__(self, parser, namespace, values, option_string=None):
parser_name = values[0]
arg_strings = values[1:]
if self.dest is not SUPPRESS:
@@ -680,7 +682,7 @@ class _SubParsersAction(Action):
class FileType(object):
- def __init__(self, mode = 'r', bufsize = -1):
+ def __init__(self, mode='r', bufsize=-1):
self._mode = mode
self._bufsize = bufsize
@@ -756,7 +758,7 @@ class _ActionsContainer(object):
registry = self._registries.setdefault(registry_name, {})
registry[value] = object
- def _registry_get(self, registry_name, value, default = None):
+ def _registry_get(self, registry_name, value, default=None):
return self._registries[registry_name].get(value, default)
def set_defaults(self, **kwargs):
@@ -888,7 +890,7 @@ class _ActionsContainer(object):
dest = dest.replace('-', '_')
return dict(kwargs, dest=dest, option_strings=option_strings)
- def _pop_action_class(self, kwargs, default = None):
+ def _pop_action_class(self, kwargs, default=None):
action = kwargs.pop('action', default)
return self._registry_get('action', action, action)
@@ -913,7 +915,7 @@ class _ActionsContainer(object):
def _handle_conflict_error(self, action, conflicting_actions):
message = _('conflicting option string(s): %s')
- conflict_string = ', '.join([ option_string for option_string, action in conflicting_actions ])
+ conflict_string = ', '.join([option_string for option_string, action in conflicting_actions])
raise ArgumentError(action, message % conflict_string)
def _handle_conflict_resolve(self, action, conflicting_actions):
@@ -928,7 +930,7 @@ class _ActionsContainer(object):
class _ArgumentGroup(_ActionsContainer):
- def __init__(self, container, title = None, description = None, **kwargs):
+ def __init__(self, container, title=None, description=None, **kwargs):
update = kwargs.setdefault
update('conflict_handler', container.conflict_handler)
update('prefix_chars', container.prefix_chars)
@@ -956,7 +958,7 @@ class _ArgumentGroup(_ActionsContainer):
class _MutuallyExclusiveGroup(_ArgumentGroup):
- def __init__(self, container, required = False):
+ def __init__(self, container, required=False):
super(_MutuallyExclusiveGroup, self).__init__(container)
self.required = required
self._container = container
@@ -976,7 +978,7 @@ class _MutuallyExclusiveGroup(_ArgumentGroup):
class ArgumentParser(_AttributeHolder, _ActionsContainer):
- def __init__(self, prog = None, usage = None, description = None, epilog = None, version = None, parents = [], formatter_class = HelpFormatter, prefix_chars = '-', fromfile_prefix_chars = None, argument_default = None, conflict_handler = 'error', add_help = True):
+ def __init__(self, prog=None, usage=None, description=None, epilog=None, version=None, parents=[], formatter_class=HelpFormatter, prefix_chars='-', fromfile_prefix_chars=None, argument_default=None, conflict_handler='error', add_help=True):
if version is not None:
import warnings
warnings.warn('The "version" argument to ArgumentParser is deprecated. Please use "add_argument(..., action=\'version\', version="N", ...)" instead', DeprecationWarning)
@@ -1024,7 +1026,7 @@ class ArgumentParser(_AttributeHolder, _ActionsContainer):
'formatter_class',
'conflict_handler',
'add_help']
- return [ (name, getattr(self, name)) for name in names ]
+ return [(name, getattr(self, name)) for name in names]
def add_subparsers(self, **kwargs):
if self._subparsers is not None:
@@ -1055,19 +1057,19 @@ class ArgumentParser(_AttributeHolder, _ActionsContainer):
return action
def _get_optional_actions(self):
- return [ action for action in self._actions if action.option_strings ]
+ return [action for action in self._actions if action.option_strings]
def _get_positional_actions(self):
- return [ action for action in self._actions if not action.option_strings ]
+ return [action for action in self._actions if not action.option_strings]
- def parse_args(self, args = None, namespace = None):
+ def parse_args(self, args=None, namespace=None):
args, argv = self.parse_known_args(args, namespace)
if argv:
msg = _('unrecognized arguments: %s')
self.error(msg % ' '.join(argv))
return args
- def parse_known_args(self, args = None, namespace = None):
+ def parse_known_args(self, args=None, namespace=None):
if args is None:
args = _sys.argv[1:]
if namespace is None:
@@ -1130,7 +1132,7 @@ class ArgumentParser(_AttributeHolder, _ActionsContainer):
seen_actions = set()
seen_non_default_actions = set()
- def take_action(action, argument_strings, option_string = None):
+ def take_action(action, argument_strings, option_string=None):
seen_actions.add(action)
argument_values = self._get_values(action, argument_strings)
if argument_values is not action.default:
@@ -1211,7 +1213,7 @@ class ArgumentParser(_AttributeHolder, _ActionsContainer):
else:
max_option_string_index = -1
while start_index <= max_option_string_index:
- next_option_string_index = min([ index for index in option_string_indices if index >= start_index ])
+ next_option_string_index = min([index for index in option_string_indices if index >= start_index])
if start_index != next_option_string_index:
positionals_end_index = consume_positionals(start_index)
if positionals_end_index > start_index:
@@ -1241,7 +1243,7 @@ class ArgumentParser(_AttributeHolder, _ActionsContainer):
if action in seen_non_default_actions:
break
else:
- names = [ _get_action_name(action) for action in group._group_actions if action.help is not SUPPRESS ]
+ names = [_get_action_name(action) for action in group._group_actions if action.help is not SUPPRESS]
msg = _('one of the arguments %s is required')
self.error(msg % ' '.join(names))
@@ -1291,10 +1293,10 @@ class ArgumentParser(_AttributeHolder, _ActionsContainer):
result = []
for i in range(len(actions), 0, -1):
actions_slice = actions[:i]
- pattern = ''.join([ self._get_nargs_pattern(action) for action in actions_slice ])
+ pattern = ''.join([self._get_nargs_pattern(action) for action in actions_slice])
match = _re.match(pattern, arg_strings_pattern)
if match is not None:
- result.extend([ len(string) for string in match.groups() ])
+ result.extend([len(string) for string in match.groups()])
break
return result
@@ -1317,7 +1319,7 @@ class ArgumentParser(_AttributeHolder, _ActionsContainer):
return (action, option_string, explicit_arg)
option_tuples = self._get_option_tuples(arg_string)
if len(option_tuples) > 1:
- options = ', '.join([ option_string for action, option_string, explicit_arg in option_tuples ])
+ options = ', '.join([option_string for action, option_string, explicit_arg in option_tuples])
tup = (arg_string, options)
self.error(_('ambiguous option: %s could match %s') % tup)
elif len(option_tuples) == 1:
@@ -1388,7 +1390,7 @@ class ArgumentParser(_AttributeHolder, _ActionsContainer):
def _get_values(self, action, arg_strings):
if action.nargs not in [PARSER, REMAINDER]:
- arg_strings = [ s for s in arg_strings if s != '--' ]
+ arg_strings = [s for s in arg_strings if s != '--']
if not arg_strings and action.nargs == OPTIONAL:
if action.option_strings:
value = action.const
@@ -1408,12 +1410,12 @@ class ArgumentParser(_AttributeHolder, _ActionsContainer):
value = self._get_value(action, arg_string)
self._check_value(action, value)
elif action.nargs == REMAINDER:
- value = [ self._get_value(action, v) for v in arg_strings ]
+ value = [self._get_value(action, v) for v in arg_strings]
elif action.nargs == PARSER:
- value = [ self._get_value(action, v) for v in arg_strings ]
+ value = [self._get_value(action, v) for v in arg_strings]
self._check_value(action, value[0])
else:
- value = [ self._get_value(action, v) for v in arg_strings ]
+ value = [self._get_value(action, v) for v in arg_strings]
for v in value:
self._check_value(action, v)
@@ -1472,35 +1474,35 @@ class ArgumentParser(_AttributeHolder, _ActionsContainer):
def _get_formatter(self):
return self.formatter_class(prog=self.prog)
- def print_usage(self, file = None):
+ def print_usage(self, file=None):
if file is None:
file = _sys.stdout
self._print_message(self.format_usage(), file)
return
- def print_help(self, file = None):
+ def print_help(self, file=None):
if file is None:
file = _sys.stdout
self._print_message(self.format_help(), file)
return
- def print_version(self, file = None):
+ def print_version(self, file=None):
import warnings
warnings.warn('The print_version method is deprecated -- the "version" argument to ArgumentParser is no longer supported.', DeprecationWarning)
self._print_message(self.format_version(), file)
- def _print_message(self, message, file = None):
+ def _print_message(self, message, file=None):
if message:
if file is None:
file = _sys.stderr
file.write(message)
return
- def exit(self, status = 0, message = None):
+ def exit(self, status=0, message=None):
if message:
self._print_message(message, _sys.stderr)
_sys.exit(status)
def error(self, message):
self.print_usage(_sys.stderr)
- self.exit(2, _('%s: error: %s\n') % (self.prog, message))
\ No newline at end of file
+ self.exit(2, _('%s: error: %s\n') % (self.prog, message))
diff --git a/NeoBoot/ubi_reader_mips/ubi/__init__.py b/NeoBoot/ubi_reader_mips/ubi/__init__.py
index 8da31e4..2ad94bb 100644
--- a/NeoBoot/ubi_reader_mips/ubi/__init__.py
+++ b/NeoBoot/ubi_reader_mips/ubi/__init__.py
@@ -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):
@@ -93,7 +94,7 @@ class ubi:
blocks = property(_get_blocks)
- def display(self, tab = ''):
+ def display(self, tab=''):
display.ubi(self, tab)
@@ -136,4 +137,4 @@ def get_peb_size(path):
most_frequent = occurances[offset]
block_size = offset
- return block_size
\ No newline at end of file
+ return block_size
diff --git a/NeoBoot/ubi_reader_mips/ubi/block/__init__.py b/NeoBoot/ubi_reader_mips/ubi/block/__init__.py
index 7d8c1de..e6575eb 100644
--- a/NeoBoot/ubi_reader_mips/ubi/block/__init__.py
+++ b/NeoBoot/ubi_reader_mips/ubi/block/__init__.py
@@ -4,6 +4,7 @@ from ubi import display
from ubi.defines import *
from ubi.headers import *
+
class description(object):
def __init__(self, block_buf):
@@ -28,12 +29,12 @@ class description(object):
def __repr__(self):
return 'Block: PEB# %s: LEB# %s' % (self.peb_num, self.leb_num)
- def display(self, tab = ''):
+ def display(self, tab=''):
display.block(self, tab)
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):
@@ -56,4 +57,4 @@ def extract_blocks(ubi):
ubi.first_peb_num = cur_offset / ubi.file.block_size
ubi.file.start_offset = cur_offset
- return blocks
\ No newline at end of file
+ return blocks
diff --git a/NeoBoot/ubi_reader_mips/ubi/block/layout.py b/NeoBoot/ubi_reader_mips/ubi/block/layout.py
index d2f95de..065c669 100644
--- a/NeoBoot/ubi_reader_mips/ubi/block/layout.py
+++ b/NeoBoot/ubi_reader_mips/ubi/block/layout.py
@@ -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
\ No newline at end of file
+ return layout_pairs
diff --git a/NeoBoot/ubi_reader_mips/ubi/block/sort.py b/NeoBoot/ubi_reader_mips/ubi/block/sort.py
index 6687f9e..3f01628 100644
--- a/NeoBoot/ubi_reader_mips/ubi/block/sort.py
+++ b/NeoBoot/ubi_reader_mips/ubi/block/sort.py
@@ -19,7 +19,7 @@ def by_image_seq(blocks, image_seq):
def by_range(blocks, block_range):
peb_range = range(block_range[0], block_range[1])
- return [ i for i in blocks if i in peb_range ]
+ return [i for i in blocks if i in peb_range]
def by_leb(blocks):
@@ -36,7 +36,7 @@ def by_leb(blocks):
return sorted(blocks.iterkeys(), key=lambda x: blocks[x].leb_num)
-def by_vol_id(blocks, slist = None):
+def by_vol_id(blocks, slist=None):
vol_blocks = {}
for i in blocks:
if slist and i not in slist:
@@ -50,7 +50,7 @@ def by_vol_id(blocks, slist = None):
return vol_blocks
-def clean_bad(blocks, slist = None):
+def clean_bad(blocks, slist=None):
clean_blocks = []
for i in range(0, len(blocks)):
if slist and i not in slist:
@@ -61,7 +61,7 @@ def clean_bad(blocks, slist = None):
return clean_blocks
-def by_type(blocks, slist = None):
+def by_type(blocks, slist=None):
layout = []
data = []
int_vol = []
@@ -81,4 +81,4 @@ def by_type(blocks, slist = None):
return (layout,
data,
int_vol,
- unknown)
\ No newline at end of file
+ unknown)
diff --git a/NeoBoot/ubi_reader_mips/ubi/display.py b/NeoBoot/ubi_reader_mips/ubi/display.py
index 8081041..5124951 100644
--- a/NeoBoot/ubi_reader_mips/ubi/display.py
+++ b/NeoBoot/ubi_reader_mips/ubi/display.py
@@ -1,7 +1,8 @@
#!/usr/bin/python
from ubi.defines import PRINT_COMPAT_LIST, PRINT_VOL_TYPE_LIST, UBI_VTBL_AUTORESIZE_FLG
-def ubi(ubi, tab = ''):
+
+def ubi(ubi, tab=''):
print '%sUBI File' % tab
print '%s---------------------' % tab
print '\t%sMin I/O: %s' % (tab, ubi.min_io_size)
@@ -15,7 +16,7 @@ def ubi(ubi, tab = ''):
print '\t%sFirst UBI PEB Number: %s' % (tab, ubi.first_peb_num)
-def image(image, tab = ''):
+def image(image, tab=''):
print '%s%s' % (tab, image)
print '%s---------------------' % tab
print '\t%sImage Sequence Num: %s' % (tab, image.image_seq)
@@ -25,7 +26,7 @@ def image(image, tab = ''):
print '\t%sPEB Range: %s - %s' % (tab, image.peb_range[0], image.peb_range[1])
-def volume(volume, tab = ''):
+def volume(volume, tab=''):
print '%s%s' % (tab, volume)
print '%s---------------------' % tab
print '\t%sVol ID: %s' % (tab, volume.vol_id)
@@ -38,7 +39,7 @@ def volume(volume, tab = ''):
print '\n'
-def block(block, tab = '\t'):
+def block(block, tab='\t'):
print '%s%s' % (tab, block)
print '%s---------------------' % tab
print '\t%sFile Offset: %s' % (tab, block.file_offset)
@@ -68,14 +69,14 @@ def block(block, tab = '\t'):
print '\n'
-def ec_hdr(ec_hdr, tab = ''):
+def ec_hdr(ec_hdr, tab=''):
for key, value in ec_hdr:
if key == 'errors':
value = ','.join(value)
print '%s%s: %r' % (tab, key, value)
-def vid_hdr(vid_hdr, tab = ''):
+def vid_hdr(vid_hdr, tab=''):
for key, value in vid_hdr:
if key == 'errors':
value = ','.join(value)
@@ -92,7 +93,7 @@ def vid_hdr(vid_hdr, tab = ''):
print '%s%s: %s' % (tab, key, value)
-def vol_rec(vol_rec, tab = ''):
+def vol_rec(vol_rec, tab=''):
for key, value in vol_rec:
if key == 'errors':
value = ','.join(value)
@@ -105,4 +106,4 @@ def vol_rec(vol_rec, tab = ''):
value = 'autoresize'
elif key == 'name':
value = value.strip('\x00')
- print '%s%s: %s' % (tab, key, value)
\ No newline at end of file
+ print '%s%s: %s' % (tab, key, value)
diff --git a/NeoBoot/ubi_reader_mips/ubi/headers/__init__.py b/NeoBoot/ubi_reader_mips/ubi/headers/__init__.py
index 474a369..5641b23 100644
--- a/NeoBoot/ubi_reader_mips/ubi/headers/__init__.py
+++ b/NeoBoot/ubi_reader_mips/ubi/headers/__init__.py
@@ -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
\ No newline at end of file
+ return vtbl_recs
diff --git a/NeoBoot/ubi_reader_mips/ubi/headers/errors.py b/NeoBoot/ubi_reader_mips/ubi/headers/errors.py
index eee0ebd..04b3d46 100644
--- a/NeoBoot/ubi_reader_mips/ubi/headers/errors.py
+++ b/NeoBoot/ubi_reader_mips/ubi/headers/errors.py
@@ -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
\ No newline at end of file
+ return vtbl_rec
diff --git a/NeoBoot/ubi_reader_mips/ubi/image.py b/NeoBoot/ubi_reader_mips/ubi/image.py
index b613ce4..77c0539 100644
--- a/NeoBoot/ubi_reader_mips/ubi/image.py
+++ b/NeoBoot/ubi_reader_mips/ubi/image.py
@@ -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):
@@ -34,5 +35,5 @@ class description(object):
volumes = property(_get_volumes)
- def display(self, tab = ''):
- display.image(self, tab)
\ No newline at end of file
+ def display(self, tab=''):
+ display.image(self, tab)
diff --git a/NeoBoot/ubi_reader_mips/ubi/volume/__init__.py b/NeoBoot/ubi_reader_mips/ubi/volume/__init__.py
index 70d3e76..b9d96e8 100644
--- a/NeoBoot/ubi_reader_mips/ubi/volume/__init__.py
+++ b/NeoBoot/ubi_reader_mips/ubi/volume/__init__.py
@@ -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):
@@ -41,7 +42,7 @@ class description(object):
def get_blocks(self, blocks):
return get_blocks_in_list(blocks, self._block_list)
- def display(self, tab = ''):
+ def display(self, tab=''):
display.volume(self, tab)
def reader(self, ubi):
@@ -64,4 +65,4 @@ def get_volumes(blocks, layout_info):
vol_blocks_lists[vol_rec.rec_index] = []
volumes[vol_name] = description(vol_rec.rec_index, vol_rec, vol_blocks_lists[vol_rec.rec_index])
- return volumes
\ No newline at end of file
+ return volumes
diff --git a/NeoBoot/ubi_reader_mips/ubi_extract_files.py b/NeoBoot/ubi_reader_mips/ubi_extract_files.py
index 283ac01..6891503 100644
--- a/NeoBoot/ubi_reader_mips/ubi_extract_files.py
+++ b/NeoBoot/ubi_reader_mips/ubi_extract_files.py
@@ -4,18 +4,18 @@ import os
import sys
try:
import argparse
-except:
- import argparse_neo
+except:
+ import argparse_neo
from ubi import ubi, get_peb_size
from ubifs import ubifs
from ubi_io import ubi_file, leb_virtual_file
from ui.common import extract_files, output_dir
-if __name__ == '__main__':
+if __name__ == '__main__':
description = 'Extract contents of UBI image.'
usage = 'ubi_extract_files.py [options] filepath'
try:
parser = argparse.ArgumentParser(usage=usage, description=description)
- except:
+ except:
parser = argparse_neo.ArgumentParser(usage=usage, description=description)
parser.add_argument('-l', '--log-file', dest='logpath', help='Log output to file output/LOGPATH. (default: ubifs_output.log)')
parser.add_argument('-k', '--keep-permissions', action='store_true', dest='permissions', help='Maintain file permissions, requires running as root. (default: False)')
@@ -67,4 +67,4 @@ if __name__ == '__main__':
print 'Writing to: %s' % vol_out_path
extract_files(uubifs, vol_out_path, perms)
- sys.exit(0)
\ No newline at end of file
+ sys.exit(0)
diff --git a/NeoBoot/ubi_reader_mips/ubi_io/__init__.py b/NeoBoot/ubi_reader_mips/ubi_io/__init__.py
index 9f3bd62..a7aec6b 100644
--- a/NeoBoot/ubi_reader_mips/ubi_io/__init__.py
+++ b/NeoBoot/ubi_reader_mips/ubi_io/__init__.py
@@ -1,9 +1,10 @@
#!/usr/bin/python
from ubi.block import sort
+
class ubi_file(object):
- def __init__(self, path, block_size, start_offset = 0, end_offset = None):
+ def __init__(self, path, block_size, start_offset=0, end_offset=None):
self._fhandle = open(path, 'rb')
self._start_offset = start_offset
if end_offset:
@@ -113,4 +114,4 @@ class leb_virtual_file:
yield '\xff' * self._ubi.leb_size
last_leb += 1
- yield self._ubi.file.read_block_data(self._ubi.blocks[block])
\ No newline at end of file
+ yield self._ubi.file.read_block_data(self._ubi.blocks[block])
diff --git a/NeoBoot/ubi_reader_mips/ubifs/__init__.py b/NeoBoot/ubi_reader_mips/ubifs/__init__.py
index 05774c3..0ad47ca 100644
--- a/NeoBoot/ubi_reader_mips/ubifs/__init__.py
+++ b/NeoBoot/ubi_reader_mips/ubifs/__init__.py
@@ -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
\ No newline at end of file
+ return block_size
diff --git a/NeoBoot/ubi_reader_mips/ubifs/log.py b/NeoBoot/ubi_reader_mips/ubifs/log.py
index 1c2d15b..9709a86 100644
--- a/NeoBoot/ubi_reader_mips/ubifs/log.py
+++ b/NeoBoot/ubi_reader_mips/ubifs/log.py
@@ -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)
\ No newline at end of file
+ self._out(buf)
diff --git a/NeoBoot/ubi_reader_mips/ubifs/misc.py b/NeoBoot/ubi_reader_mips/ubifs/misc.py
index a4127bb..32aa48b 100644
--- a/NeoBoot/ubi_reader_mips/ubifs/misc.py
+++ b/NeoBoot/ubi_reader_mips/ubifs/misc.py
@@ -27,6 +27,7 @@ key_types = ['ino',
'dent',
'xent']
+
def parse_key(key):
hkey, lkey = struct.unpack(' len(buf):
buf += '\x00' * (inode['ino'].size - len(buf))
- return buf
\ No newline at end of file
+ return buf
diff --git a/NeoBoot/ubi_reader_mips/ubifs/walk.py b/NeoBoot/ubi_reader_mips/ubifs/walk.py
index d8b8020..4c65114 100644
--- a/NeoBoot/ubi_reader_mips/ubifs/walk.py
+++ b/NeoBoot/ubi_reader_mips/ubifs/walk.py
@@ -2,7 +2,8 @@
from ubifs import extract
from ubifs.defines import *
-def index(ubifs, lnum, offset, inodes = {}):
+
+def index(ubifs, lnum, offset, inodes={}):
chdr = extract.common_hdr(ubifs, lnum, offset)
if chdr.node_type == UBIFS_IDX_NODE:
idxn = extract.idx_node(ubifs, lnum, offset + UBIFS_COMMON_HDR_SZ)
@@ -30,4 +31,4 @@ def index(ubifs, lnum, offset, inodes = {}):
inodes[ino_num] = {}
if 'dent' not in inodes[ino_num]:
inodes[ino_num]['dent'] = []
- inodes[ino_num]['dent'].append(dn)
\ No newline at end of file
+ inodes[ino_num]['dent'].append(dn)
diff --git a/NeoBoot/ubi_reader_mips/ui/__init__.py b/NeoBoot/ubi_reader_mips/ui/__init__.py
index 8b13789..e69de29 100644
--- a/NeoBoot/ubi_reader_mips/ui/__init__.py
+++ b/NeoBoot/ubi_reader_mips/ui/__init__.py
@@ -1 +0,0 @@
-
diff --git a/NeoBoot/ubi_reader_mips/ui/common.py b/NeoBoot/ubi_reader_mips/ui/common.py
index c8669fd..0983692 100644
--- a/NeoBoot/ubi_reader_mips/ui/common.py
+++ b/NeoBoot/ubi_reader_mips/ui/common.py
@@ -6,7 +6,8 @@ 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):
+
+def extract_files(ubifs, out_path, perms=False):
try:
inodes = {}
walk.index(ubifs, ubifs.master_node.root_lnum, ubifs.master_node.root_offs, inodes)
@@ -85,4 +86,4 @@ def get_ubi_params(ubi):
'args': ubi_args[img_seq][volume],
'ini': ini_params[img_seq][volume]}
- return ubi_params
\ No newline at end of file
+ return ubi_params
diff --git a/NeoBoot/unpack.py b/NeoBoot/unpack.py
index e00d6bf..76af183 100644
--- a/NeoBoot/unpack.py
+++ b/NeoBoot/unpack.py
@@ -1,11 +1,11 @@
-# -*- coding: utf-8 -*-
-
-#from __init__ import _
-from Plugins.Extensions.NeoBoot.__init__ import _
-from Plugins.Extensions.NeoBoot.files.stbbranding import getNeoLocation, getKernelVersionString, getKernelImageVersion, getCPUtype, getCPUSoC, getImageNeoBoot, getBoxVuModel, getBoxHostName, getTunerModel
+# -*- coding: utf-8 -*-
+
+#from __init__ import _
+from Plugins.Extensions.NeoBoot.__init__ import _
+from Plugins.Extensions.NeoBoot.files.stbbranding import getNeoLocation, getKernelVersionString, getKernelImageVersion, getCPUtype, getCPUSoC, getImageNeoBoot, getBoxVuModel, getBoxHostName, getTunerModel
from enigma import getDesktop
from enigma import eTimer
-from Screens.Screen import Screen
+from Screens.Screen import Screen
from Screens.Console import Console
from Screens.MessageBox import MessageBox
from Screens.ChoiceBox import ChoiceBox
@@ -29,34 +29,39 @@ from Tools.Directories import fileExists, pathExists, createDir, resolveFilename
from os import system, listdir, mkdir, chdir, getcwd, rename as os_rename, remove as os_remove, popen
from os.path import dirname, isdir, isdir as os_isdir
import os
-import time
-if fileExists('/etc/vtiversion.info') or fileExists('/etc/bhversion') or fileExists('/usr/lib/python3.8') and fileExists('/.multinfo'):
- from Screens.Console import Console
+import time
+if fileExists('/etc/vtiversion.info') or fileExists('/etc/bhversion') or fileExists('/usr/lib/python3.8') and fileExists('/.multinfo'):
+ from Screens.Console import Console
else:
try:
- from Plugins.Extensions.NeoBoot.files.neoconsole import Console
+ from Plugins.Extensions.NeoBoot.files.neoconsole import Console
except:
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():
+ if isFHD():
skin = """
@@ -93,8 +98,8 @@ class InstallImage(Screen, ConfigListScreen):
def __init__(self, session):
Screen.__init__(self, session)
fn = 'NewImage'
- sourcelist = []
- for fn in os.listdir('%sImagesUpload' % getNeoLocation() ):
+ sourcelist = []
+ for fn in os.listdir('%sImagesUpload' % getNeoLocation()):
if fn.find('.zip') != -1:
fn = fn.replace('.zip', '')
sourcelist.append((fn, fn))
@@ -102,15 +107,15 @@ class InstallImage(Screen, ConfigListScreen):
if fn.find('.rar') != -1:
fn = fn.replace('.rar', '')
sourcelist.append((fn, fn))
- continue
+ continue
if fn.find('.tar.xz') != -1:
fn = fn.replace('.tar.xz', '')
- sourcelist.append((fn, fn))
+ sourcelist.append((fn, fn))
continue
if fn.find('.tar.gz') != -1:
fn = fn.replace('.tar.gz', '')
sourcelist.append((fn, fn))
- continue
+ continue
if fn.find('.tar.bz2') != -1:
fn = fn.replace('.tar.bz2', '')
sourcelist.append((fn, fn))
@@ -118,7 +123,7 @@ class InstallImage(Screen, ConfigListScreen):
if fn.find('.mb') != -1:
fn = fn.replace('.mb', '')
sourcelist.append((fn, fn))
- continue
+ continue
if fn.find('.nfi') != -1:
fn = fn.replace('.nfi', '')
sourcelist.append((fn, fn))
@@ -127,25 +132,25 @@ class InstallImage(Screen, ConfigListScreen):
sourcelist = [('None', 'None')]
self.source = ConfigSelection(choices=sourcelist)
self.target = ConfigText(fixed_size=False)
- self.stopenigma = ConfigYesNo(default=False)
+ self.stopenigma = ConfigYesNo(default=False)
self.CopyFiles = ConfigYesNo(default=True)
- 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'):
self.CopyKernel = ConfigYesNo(default=True)
- else:
- self.CopyKernel = ConfigYesNo(default=False)
- self.TvList = ConfigYesNo(default=False)
+ else:
+ self.CopyKernel = ConfigYesNo(default=False)
+ self.TvList = ConfigYesNo(default=False)
self.LanWlan = ConfigYesNo(default=False)
if fileExists('/proc/stb/info/vumodel') and not fileExists('/proc/stb/info/boxtype'):
- self.Sterowniki = ConfigYesNo(default=False)
+ self.Sterowniki = ConfigYesNo(default=False)
else:
- self.Sterowniki = ConfigYesNo(default=True)
- self.InstallSettings = ConfigYesNo(default=False)
- self.ZipDelete = ConfigYesNo(default=False)
+ self.Sterowniki = ConfigYesNo(default=True)
+ self.InstallSettings = ConfigYesNo(default=False)
+ self.ZipDelete = ConfigYesNo(default=False)
self.RepairFTP = ConfigYesNo(default=False)
self.SoftCam = ConfigYesNo(default=False)
- self.MediaPortal = ConfigYesNo(default=False)
+ self.MediaPortal = ConfigYesNo(default=False)
self.PiconR = ConfigYesNo(default=False)
- self.Kodi = ConfigYesNo(default=False)
+ self.Kodi = ConfigYesNo(default=False)
self.BlackHole = ConfigYesNo(default=False)
self.target.value = ''
self.curselimage = ''
@@ -166,36 +171,36 @@ class InstallImage(Screen, ConfigListScreen):
'red': self.cancel,
'green': self.imageInstall,
'yellow': self.HelpInstall,
- 'blue': self.openKeyboard}, -2)
+ 'blue': self.openKeyboard}, -2)
self['key_green'] = Label(_('Install'))
self['key_red'] = Label(_('Cancel'))
self['key_yellow'] = Label(_('Help'))
- self['key_blue'] = Label(_('Keyboard'))
+ self['key_blue'] = Label(_('Keyboard'))
self['HelpWindow'] = Pixmap()
self['HelpWindow'].hide()
def createSetup(self):
self.list = []
self.list.append(getConfigListEntry(_('Source Image file'), self.source))
- self.list.append(getConfigListEntry(_('Image Name'), self.target))
- self.list.append(getConfigListEntry(_('Stop E2 processes during installation?'), self.stopenigma))
- self.list.append(getConfigListEntry(_('Copy files from Flash to the installed image ?'), self.CopyFiles ))
- self.list.append(getConfigListEntry(_('Copy the kernel of the installed system (recommended ?'), self.CopyKernel ))
- self.list.append(getConfigListEntry(_('Copy the channel list ?'), self.TvList))
- self.list.append(getConfigListEntry(_('Copy network settings LAN-WLAN ?'), self.LanWlan))
- self.list.append(getConfigListEntry(_('Copy the drivers ? (Recommended only other image.)'), self.Sterowniki))
- self.list.append(getConfigListEntry(_('Copy Settings to the new Image'), self.InstallSettings))
- self.list.append(getConfigListEntry(_('Delete Image zip after Install ?'), self.ZipDelete))
+ self.list.append(getConfigListEntry(_('Image Name'), self.target))
+ self.list.append(getConfigListEntry(_('Stop E2 processes during installation?'), self.stopenigma))
+ self.list.append(getConfigListEntry(_('Copy files from Flash to the installed image ?'), self.CopyFiles))
+ self.list.append(getConfigListEntry(_('Copy the kernel of the installed system (recommended ?'), self.CopyKernel))
+ self.list.append(getConfigListEntry(_('Copy the channel list ?'), self.TvList))
+ self.list.append(getConfigListEntry(_('Copy network settings LAN-WLAN ?'), self.LanWlan))
+ self.list.append(getConfigListEntry(_('Copy the drivers ? (Recommended only other image.)'), self.Sterowniki))
+ self.list.append(getConfigListEntry(_('Copy Settings to the new Image'), self.InstallSettings))
+ self.list.append(getConfigListEntry(_('Delete Image zip after Install ?'), self.ZipDelete))
self.list.append(getConfigListEntry(_('Repair FTP ? (Recommended only other image if it does not work.)'), self.RepairFTP))
- self.list.append(getConfigListEntry(_('Copy config SoftCam ?'), self.SoftCam))
- self.list.append(getConfigListEntry(_('Copy MediaPortal ?'), self.MediaPortal))
- self.list.append(getConfigListEntry(_('Copy picon flash to image install ?'), self.PiconR))
+ self.list.append(getConfigListEntry(_('Copy config SoftCam ?'), self.SoftCam))
+ self.list.append(getConfigListEntry(_('Copy MediaPortal ?'), self.MediaPortal))
+ self.list.append(getConfigListEntry(_('Copy picon flash to image install ?'), self.PiconR))
self.list.append(getConfigListEntry(_('Transfer kodi settings ?'), self.Kodi))
self.list.append(getConfigListEntry(_('Path BlackHole ? (Not recommended for VuPlus)'), self.BlackHole))
-
+
def HelpInstall(self):
self.session.open(HelpInstall)
-
+
def typeChange(self, value):
self.createSetup()
self['config'].l.setList(self.list)
@@ -214,7 +219,7 @@ class InstallImage(Screen, ConfigListScreen):
self.session.openWithCallback(self.VirtualKeyBoardCallback, VirtualKeyBoard, title=self['config'].getCurrent()[0], text=self['config'].getCurrent()[1].value)
return
- def VirtualKeyBoardCallback(self, callback = None):
+ def VirtualKeyBoardCallback(self, callback=None):
if callback is not None and len(callback):
self['config'].getCurrent()[1].setValue(callback)
self['config'].invalidate(self['config'].getCurrent())
@@ -247,27 +252,27 @@ class InstallImage(Screen, ConfigListScreen):
message += _('NeoBot started installing new image.\n')
message += _('The installation process may take a few minutes.\n')
message += _('Please: DO NOT reboot your STB and turn off the power.\n')
- message += _('Please, wait...\n')
+ message += _('Please, wait...\n')
message += "'"
cmd1 = 'python ' + pluginpath + '/ex_init.py'
cmd = '%s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s ' % (cmd1,
source,
target.replace(' ', '.'),
- str(self.stopenigma.value),
- str(self.CopyFiles.value),
- str(self.CopyKernel.value),
- str(self.TvList.value),
- str(self.LanWlan.value),
- str(self.Sterowniki.value),
- str(self.InstallSettings.value),
- str(self.ZipDelete.value),
- str(self.RepairFTP.value),
- str(self.SoftCam.value),
- str(self.MediaPortal.value),
- str(self.PiconR.value),
- str(self.Kodi.value),
- str(self.BlackHole.value))
- print ("[MULTI-BOOT]: "), cmd
+ str(self.stopenigma.value),
+ str(self.CopyFiles.value),
+ str(self.CopyKernel.value),
+ str(self.TvList.value),
+ str(self.LanWlan.value),
+ str(self.Sterowniki.value),
+ str(self.InstallSettings.value),
+ str(self.ZipDelete.value),
+ str(self.RepairFTP.value),
+ str(self.SoftCam.value),
+ str(self.MediaPortal.value),
+ str(self.PiconR.value),
+ str(self.Kodi.value),
+ str(self.BlackHole.value))
+ print("[MULTI-BOOT]: "), cmd
from Plugins.Extensions.NeoBoot.plugin import PLUGINVERSION
self.session.open(Console, _('NeoBoot v.%s - Install new image') % PLUGINVERSION, [message, cmd])
@@ -301,49 +306,48 @@ class HelpInstall(Screen):
self.updatetext()
def updatetext(self):
-
+
message = _('Source Image file')
- message += _(' - Select the software to be installed with the cursor (left or right).\n\n')
-
+ message += _(' - Select the software to be installed with the cursor (left or right).\n\n')
+
message += _('Image Name')
- message += _(' - to change, press blue on the remote control.\n\n')
-
+ message += _(' - to change, press blue on the remote control.\n\n')
+
message += _('Copy files from Flash to the installed image ?')
- message += _(' - this checking this option on it nothing will be copied from the image flash to the installed image in neoboot.\n\n')
-
+ message += _(' - this checking this option on it nothing will be copied from the image flash to the installed image in neoboot.\n\n')
+
message += _('Copy the kernel of the installed system (recommended ?')
message += _('- after selecting this option, the kernel of the installed image will be copied to neoboot, only recommended for STB vuplus\n\n')
-
+
message += _('Copy the channel list ?')
message += _(' - Option to copy channel list from flash to image installed in neoboot.\n\n')
-
+
message += _('Copy mounting disks ? (Recommended)')
message += _(' - the option transfers mounts to the image installed in neoboot from the flashlight, recommended only if you are installing an image from a different model than you have.\n\n')
-
+
message += _('Copy network settings LAN-WLAN ?')
message += _(' - the option moves files with the settings for lan and wlan.\n\n')
-
- message += _('Copy the drivers ? (Recommended only other image.)')
- message += _(' - Option to copy drivers to the image installed in neoboot from the flashlight, recommended only if you are installing an image from a different model than you have.\n\n')
-
+
+ message += _('Copy the drivers ? (Recommended only other image.)')
+ message += _(' - Option to copy drivers to the image installed in neoboot from the flashlight, recommended only if you are installing an image from a different model than you have.\n\n')
+
message += _('Copy Settings to the new Image')
message += _(' - the option copies the software settings from the flashlight to the system being installed in the neobot.\n\n')
-
+
message += _('Delete Image zip after Install ?')
message += _(' - po instalacji, opcja kasuje plik zip image z katalogu ImagesUpload.\n\n')
-
+
message += _('Repair FTP ? (Recommended only other image if it does not work.)')
message += _(' - the option in some cases repairs the File Transfer Protocol connection in the installed image.\n\n')
-
+
message += _('Copy config SoftCam ?')
message += _(' - the option copies oscam configi and cccam, openpli default.\n\n')
-
- message += _('Copy picon flash to image install ?')
+
+ message += _('Copy picon flash to image install ?')
message += _(' - cpuy picon from flash to image install in neoboot\n\n')
-
- message += _('Path BlackHole ? (Not recommended for VuPlus)')
+
+ message += _('Path BlackHole ? (Not recommended for VuPlus)')
message += _(' - option for image blackhole, helps to run BH in neoboot\n\n')
-
+
self['lab1'].show()
self['lab1'].setText(message)
-
diff --git a/NeoBoot/usedskin.py b/NeoBoot/usedskin.py
index e0920ff..b432ecd 100644
--- a/NeoBoot/usedskin.py
+++ b/NeoBoot/usedskin.py
@@ -4,23 +4,23 @@ from Screens.Screen import Screen
from Components.Pixmap import Pixmap
import os
-#Colors (#AARRGGBB)
+#Colors (#AARRGGBB)
#____Recommended colors - Zalecane kolory :
-#color name="white" value="#ffffff"
-#color name="darkwhite" value="#00dddddd"
-#color name="red" value="#f23d21"
-#color name="green" value="#389416"
-#color name="blue" value="#0064c7"
-#color name="yellow" value="#bab329"
-#color name="orange" value="#00ffa500"
-#color name="gray" value="#808080"
-#color name="lightgrey" value="#009b9b9b"
+#color name="white" value="#ffffff"
+#color name="darkwhite" value="#00dddddd"
+#color name="red" value="#f23d21"
+#color name="green" value="#389416"
+#color name="blue" value="#0064c7"
+#color name="yellow" value="#bab329"
+#color name="orange" value="#00ffa500"
+#color name="gray" value="#808080"
+#color name="lightgrey" value="#009b9b9b"
# green = '#00389416' lub #00389416
# red = '#00ff2525'
# yellow = '#00ffe875'
# orange = '#00ff7f50'
# seledynowy = #00FF00
-# jasny-blue = #99FFFF
+# jasny-blue = #99FFFF
# Zamiast font=Regular ktory nie rozpoznaje polskich znakow np. na VTi, mozesz zmienic na ponizsze font="*:
# font - genel
@@ -28,15 +28,15 @@ import os
# font - tasat
# font - dugme
-#
+#
###____ Skin Ultra HD - ImageChooseFULLHD ___ mod. gutosie___
-ImageChooseFULLHD ="""
+ImageChooseFULLHD = """
-
-
-
+
+
+
@@ -55,10 +55,10 @@ ImageChooseFULLHD ="""
-
-
-
-
+
+
+
+
@@ -89,61 +89,61 @@ ImageChooseFULLHD ="""
###____ Skin Ultra HD - ImageChooseULTRAHD ___ mod. gutosie___
-ImageChooseULTRAHD ="""
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+ImageChooseULTRAHD = """
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
- Default
+ Default
- Format:%A
+ Format:%A
Format:%e. %b.
-
+
"""
###____ Skin HD - ImageChoose ___mod. gutosie ___
-ImageChooseHD ="""
-
-
-
-
-
+ImageChooseHD = """
+
+
+
+
+
@@ -161,7 +161,7 @@ ImageChooseHD ="""
-
+
@@ -179,13 +179,13 @@ ImageChooseHD ="""
Format:%-H:%M
-
+
"""
###____ Skin FULLHD - MyUpgradeFULLHD ___mod. gutosie ___
-MyUpgradeFULLHD ="""
+MyUpgradeFULLHD = """
@@ -204,24 +204,24 @@ MyUpgradeFULLHD ="""
###____ Skin UltraHD - MyUpgradeUltraHD ___mod. gutosie ___
-MyUpgradeUltraHD ="""
-
-
-
-
+MyUpgradeUltraHD = """
+
+
+
+
{"template": [MultiContentEntryText(pos=(0,0), size=(1680,132), flags=RT_HALIGN_CENTER|RT_VALIGN_CENTER, text=0)], "fonts": [gFont("Regular",66)], "itemHeight":132}\n
-
-
-
-
-
-
+
+
+
+
+
+
"""
-
+
###____ Skin MyUpgradeHD - MyUpgradeHD ___mod. gutosie ___
-MyUpgradeHD ="""
+MyUpgradeHD = """
@@ -236,11 +236,11 @@ MyUpgradeHD ="""
- """
-
-
+ """
+
+
###____ Skin NeoBootInstallationFULLHD - NeoBootInstallationFULLHD ___mod. gutosie ___
-NeoBootInstallationFULLHD ="""
+NeoBootInstallationFULLHD = """
@@ -262,58 +262,51 @@ NeoBootInstallationFULLHD ="""
"""
###____ Skin NeoBootInstallationUltraHD - NeoBootInstallationUltraHD ___mod. gutosie ___
-NeoBootInstallationUltraHD ="""
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+NeoBootInstallationUltraHD = """
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Default
-
+
Format:%A
-
+
Format:%e. %b.
"""
###____ Skin NeoBootInstallationHD - NeoBootInstallationHD ___mod. gutosie ___
-NeoBootInstallationHD ="""
+NeoBootInstallationHD = """
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
"""
-
-
-
-
-
-
-
\ No newline at end of file