diff --git a/NeoBoot/files/Harddisk.py b/NeoBoot/files/Harddisk.py index e0b4e91..07e72d7 100644 --- a/NeoBoot/files/Harddisk.py +++ b/NeoBoot/files/Harddisk.py @@ -7,7 +7,10 @@ from Tools.Directories import fileExists, pathExists, fileCheck from Tools.CList import CList from Components.SystemInfo import SystemInfo from Components.Console import Console -from Task import LoggingTask +try: + from Task import LoggingTask +except: + from Components.Task import LoggingTask import Task from Screens.Screen import Screen from Components.ActionMap import ActionMap @@ -973,7 +976,10 @@ class HarddiskSetup(Screen): def hddConfirmed(self, confirmed): if not confirmed: return - from Components.Task import job_manager + try: + from Task import job_manager + except: + from Components.Task import job_manager try: job = self.action() job_manager.AddJob(job, onSuccess=job_manager.popupTaskView) diff --git a/NeoBoot/files/devices.py b/NeoBoot/files/devices.py index fb0f4a5..104d53a 100644 --- a/NeoBoot/files/devices.py +++ b/NeoBoot/files/devices.py @@ -89,8 +89,14 @@ class ManagerDevice(Screen): self.onShown.append(self.setWindowTitle) def Format_ext3(self): - from Harddisk import HarddiskSelection - self.session.openWithCallback(self.updateList, HarddiskSelection) + try: + 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 + self.session.openWithCallback(self.updateList, HarddiskSelection) + except: + self.session.open(MessageBox, _("This option is available only from openpli or derivatives."), MessageBox.TYPE_INFO, timeout=10) def Format_ext4(self): from Screens.HarddiskSetup import HarddiskSelection diff --git a/NeoBoot/files/modulecheck.sh b/NeoBoot/files/modulecheck.sh new file mode 100644 index 0000000..6e33c21 --- /dev/null +++ b/NeoBoot/files/modulecheck.sh @@ -0,0 +1,16 @@ +#!/bin/sh +#DESCRIPTION=This script by gutosie + +opkg update +opkg install --force-reinstall mtd-utils +opkg install --force-reinstall mtd-utils-ubifs +opkg install --force-reinstall mtd-utils-jffs2 +opkg install --force-reinstall kernel-module-nandsim +opkg install --force-reinstall python-subprocess +opkg install --force-reinstall python-argparse +opkg install --force-reinstall curl +opkg install --force-reinstall liblzo2-2 +opkg install --force-reinstall python-imaging +opkg install --force-maintainer --force-reinstall --force-overwrite kernel-image +opkg configure update-modules +cd diff --git a/NeoBoot/files/neobackup.sh b/NeoBoot/files/neobackup.sh new file mode 100644 index 0000000..ca291ee --- /dev/null +++ b/NeoBoot/files/neobackup.sh @@ -0,0 +1,27 @@ +#!/bin/sh +#script by gutosie + +if `grep -q 'osd.language=pl_PL' /dev/null 2>&1 + /bin/tar -czf $NEOBOOTMOUNT/CopyNEOBoot/Copy_$UPDATEv$NB$TiME.tar.gz /usr/lib/enigma2/python/Plugins/Extensions/NeoBoot*/ + echo " " + [ $PL ] && echo "Kopia wtyczki neoboot o nazwie Copy_$UPDATEv$NB$TiME.tar.gz utworzono w:" $NEOBOOTMOUNT$LOCATIONBACKUP" " || echo "Copy named Copy_$UPDATEv$NB$TiME.tar.gz was created at location:" $NEOBOOTMOUNT$LOCATIONBACKUP" " + echo " " +else + /bin/tar -czf $NEOBOOTMOUNT/CopyNEOBoot/Copy_$UPDATEv$NB$TiME.tar.gz /usr/lib/enigma2/python/Plugins/Extensions/NeoBoot*/ + echo " " + [ $PL ] && echo "Kopia wtyczki o nazwie Copy_$UPDATEv$NB$TiME.tar.gz utworzono w:" $NEOBOOTMOUNT$LOCATIONBACKUP" " || echo "Copy named Copy_$UPDATEv$NB$TiME.tar.gz was created at location:" $NEOBOOTMOUNT$LOCATIONBACKUP" " + echo " " +fi +exit 0 \ No newline at end of file diff --git a/NeoBoot/files/tools.py b/NeoBoot/files/tools.py index df01e3b..082b2ac 100644 --- a/NeoBoot/files/tools.py +++ b/NeoBoot/files/tools.py @@ -95,14 +95,13 @@ class BoundFunction: self.fnc(*self.args) -# class MBTools(Screen): if isFHD(): 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 @@ -242,7 +241,7 @@ class MBTools(Screen): class MBBackup(Screen): if isFHD(): - skin = """ + skin = """ @@ -250,10 +249,18 @@ class MBBackup(Screen): - + """ else: - skin = ' \n\t\t\n \n\n \n\n \n \n \n\t\t\t\n \n\n\n\n \n\n ' + skin = """ + + + + \ + + \n + + """ def __init__(self, session): Screen.__init__(self, session) @@ -375,15 +382,15 @@ class MBBackup(Screen): class MBRestore(Screen): __module__ = __name__ - skin = """ + skin = """ - + - - - - + + + + """ def __init__(self, session): @@ -703,15 +710,15 @@ class ReinstllNeoBoot(Screen): class ReinstllNeoBoot2(Screen): __module__ = __name__ - skin = """ + skin = """ - + - - - - + + + + """ def __init__(self, session): @@ -1160,7 +1167,11 @@ class SkinChange(Screen): 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') - + 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/zgmmah7.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' @@ -1179,16 +1190,7 @@ class SkinChange(Screen): # 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() - fail = '/usr/share/enigma2/CobaltFHD/skin.xml' - f = open(fail, 'r') - content = f.read() - f.close() - localfile2 = '/usr/share/enigma2/CobaltFHD/skin.xml' - temp_file2 = open(localfile2, 'w') - temp_file2.write(content.replace('NeoBootImageChoose', '#NeoBootImageChoose')) - temp_file2.close() - +# temp_file2.close() self.restareE2() else: self.restareE2() @@ -1206,13 +1208,13 @@ class SkinChange(Screen): class BlocUnblockImageSkin(Screen): __module__ = __name__ - skin = """ + skin = """ - + - - + + """ def __init__(self, session): @@ -1237,6 +1239,14 @@ class BlocUnblockImageSkin(Screen): self['list'].list = imageslist def deleteback(self): + image = self['list'].getCurrent() + self.delimage = image.strip() + if fileExists(self.backupdir + '/' + self.delimage + '/skin.xml'): + self.deleteback2() + else: + self.myClose(_('Sorry, not find skin neoboot.')) + + def deleteback2(self): image = self['list'].getCurrent() if image: self.delimage = image.strip() @@ -1275,17 +1285,9 @@ class BlocUnblockImageSkin(Screen): else: self.close() - - -# else: -# self.myClose(_('Sorry, There is no skin for a neoboot')) - -# def myClose(self, message): -# self.session.open(MessageBox, message, MessageBox.TYPE_INFO) -# self.close() - - - + def myClose(self, message): + self.session.open(MessageBox, message, MessageBox.TYPE_INFO) + self.close() class InternalFlash(Screen): @@ -1364,6 +1366,9 @@ class InternalFlash(Screen): #if getBoxHostName == 'osmio4k': #os.system('mkdir -p /media/InternalFlash; mount /dev/mmcblk0p5 /media/InternalFlash') + else: + self.myClose(_('Your image flash cannot be mounted.')) + if fileExists('/media/InternalFlash/etc/init.d/neobootmount.sh'): os.system('rm -f /media/InternalFlash/etc/init.d/neobootmount.sh;') @@ -1377,13 +1382,13 @@ class InternalFlash(Screen): class DeletingLanguages(Screen): __module__ = __name__ - skin = """ - - + skin = """ + + - - + + """ def __init__(self, session): @@ -1489,8 +1494,6 @@ class MultiBootMyHelp(Screen): self['lab1'].setText(message) - - ###______\\\\\\----for plugin----////_____### class MyHelpNeo(Screen): diff --git a/NeoBoot/files/userscript.sh b/NeoBoot/files/userscript.sh new file mode 100644 index 0000000..8d946fe --- /dev/null +++ b/NeoBoot/files/userscript.sh @@ -0,0 +1,53 @@ +#!/bin/sh +# script gutosie +# here you can add your own command to perform +# line - Checking internet connection by @j00zek thank you + +if [ ! -e /usr/bin/enigma2_pre_start.sh ] ; then + /usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/files/mountpoint.sh +fi + +echo "_(Checking internet connection)..." +ping -c 1 github.com 1>/dev/null 2>%1 +if [ $? -gt 0 ]; then + echo -n "_(github server unavailable, update impossible)!!! \nnetwork restart... " + /etc/init.d/networking stop; + echo "stopping network connection" + sleep 1; + /etc/init.d/networking start; + echo "start network connection" + sleep 5 + + if [ $? -gt 0 ]; then + if [ -e /usr/bin/curl ]; then + cd /tmp; curl -O --ftp-ssl https://raw.githubusercontent.com/gutosie/NeoBoot8/master/ver.txt; + cd / + elif [ -e /usr/bin/wget ]; then + wget https://raw.githubusercontent.com/gutosie/NeoBoot8/master/ver.txt -O /tmp/ver.txt + cd / + + fi + if [ ! -f /tmp/ver.txt ] ; then + /etc/init.d/networking stop; + echo "stopping network connection" + sleep 2; + /etc/init.d/networking start; + echo "start network connection" + + fi + fi + + if [ -e ./%1 ] ; then + rm -f ./%1 + fi + +# echo " dns-nameservers 1.1.1.1 " >> /etc/network/interfaces +else + echo "_(github server available)!!!" +fi + +echo "file used userscript " +echo ok + +exit 0 + \ No newline at end of file