Add files via upload

This commit is contained in:
gutosie
2021-03-01 10:52:18 +02:00
committed by GitHub
parent 732c55834b
commit 4c7de066a0
2 changed files with 67 additions and 48 deletions

View File

@@ -47,14 +47,17 @@ import os
import time import time
from time import gmtime, strftime from time import gmtime, strftime
from Tools.Testinout import getTestIn, getTestOut, getTestInTime, getTestOutTime, getAccessN, getAccesDate, getButtonPin, getTestToTest from Tools.Testinout import getTestIn, getTestOut, getTestInTime, getTestOutTime, getAccessN, getAccesDate, getButtonPin, getTestToTest
if fileExists('/etc/vtiversion.info') or fileExists('/usr/lib/python3.8') and fileExists('/.multinfo'): if fileExists('/etc/vtiversion.info') or fileExists('/etc/bhversion') or fileExists('/usr/lib/python3.8') and fileExists('/.multinfo'):
from Screens.Console import Console from Screens.Console import Console
else: 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()) loggscrash = time.localtime(time.time())
PLUGINVERSION = '9.13' PLUGINVERSION = '9.14'
UPDATEVERSION = '9.13' UPDATEVERSION = '9.14'
UPDATEDATE = '"+%Y04%d"' UPDATEDATE = '"+%Y04%d"'
LinkNeoBoot = '/usr/lib/enigma2/python/Plugins/Extensions/NeoBoot' LinkNeoBoot = '/usr/lib/enigma2/python/Plugins/Extensions/NeoBoot'
@@ -838,6 +841,7 @@ class NeoBootImageChoose(Screen):
if fileExists('/tmp/.nkod'): if fileExists('/tmp/.nkod'):
pass pass
else: else:
if checkInternet():
if not fileExists('/tmp/ver.txt'): 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 /') os.system('cd /tmp; curl -O --ftp-ssl https://raw.githubusercontent.com/gutosie/neoboot/master/ver.txt; cd /')
@@ -851,7 +855,8 @@ class NeoBootImageChoose(Screen):
os.system('mv /tmp/ver.txt /tmp/.nkod ;cd /') os.system('mv /tmp/ver.txt /tmp/.nkod ;cd /')
else: else:
os.system(_('echo %s > /tmp/.nkod') % PLUGINVERSION) os.system(_('echo %s > /tmp/.nkod') % PLUGINVERSION)
else:
os.system(_('echo %s > /tmp/.nkod') % PLUGINVERSION)
def DownloadImageOnline(self): def DownloadImageOnline(self):
if not os.path.exists('/usr/lib/enigma2/python/Plugins/Extensions/ImageDownloader/download.py'): if not os.path.exists('/usr/lib/enigma2/python/Plugins/Extensions/ImageDownloader/download.py'):
@@ -870,6 +875,7 @@ class NeoBootImageChoose(Screen):
def InstallImageDownloader(self, yesno): def InstallImageDownloader(self, yesno):
if yesno: if yesno:
if checkInternet():
cmd = 'mkdir /tmp/install; touch /tmp/install/plugin.txt; rm -rf /tmp/*.ipk' cmd = 'mkdir /tmp/install; touch /tmp/install/plugin.txt; rm -rf /tmp/*.ipk'
system(cmd) system(cmd)
if fileExists('/usr/bin/curl'): if fileExists('/usr/bin/curl'):
@@ -889,6 +895,8 @@ class NeoBootImageChoose(Screen):
else: else:
self.session.open(MessageBox, _('The plugin not installed.\nAccess Fails with Error code 0x04.'), MessageBox.TYPE_INFO, 10) self.session.open(MessageBox, _('The plugin not installed.\nAccess Fails with Error code 0x04.'), MessageBox.TYPE_INFO, 10)
self.close() self.close()
else:
session.open(MessageBox, _('Geen internet'), type=MessageBox.TYPE_ERROR)
else: else:
mess = _('Upload image files in zip formats to the ImagesUpload location.' ) mess = _('Upload image files in zip formats to the ImagesUpload location.' )
self.session.open(MessageBox, mess, MessageBox.TYPE_INFO) self.session.open(MessageBox, mess, MessageBox.TYPE_INFO)
@@ -1060,6 +1068,7 @@ class NeoBootImageChoose(Screen):
#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): def neoboot_update(self):
if checkInternet():
#if getTestInTime() == getTestOutTime() or getTestIn() != getTestOut(): #if getTestInTime() == getTestOutTime() or getTestIn() != getTestOut():
#myerror = _('Sorry, this is not neoboot vip version.\nGet NEO-VIP version, more info press blue button.') #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)
@@ -1078,6 +1087,8 @@ class NeoBootImageChoose(Screen):
message += _('\n') message += _('\n')
ybox = self.session.openWithCallback(self.chackupdate2, MessageBox, message, MessageBox.TYPE_YESNO) ybox = self.session.openWithCallback(self.chackupdate2, MessageBox, message, MessageBox.TYPE_YESNO)
ybox.setTitle(_('The download neoboot update.')) ybox.setTitle(_('The download neoboot update.'))
else:
session.open(MessageBox, _('Geen internet'), type=MessageBox.TYPE_ERROR)
def chackupdate2(self, yesno): def chackupdate2(self, yesno):
if yesno: if yesno:
@@ -1496,6 +1507,7 @@ class NeoBootImageChoose(Screen):
self.session.open(MessageBox, message, MessageBox.TYPE_INFO) self.session.open(MessageBox, message, MessageBox.TYPE_INFO)
def ImageDownloader(self, yesno): def ImageDownloader(self, yesno):
if checkInternet():
if yesno: if yesno:
cmd = 'mkdir /tmp/install; touch /tmp/install/plugin.txt; rm -rf /tmp/*.ipk' cmd = 'mkdir /tmp/install; touch /tmp/install/plugin.txt; rm -rf /tmp/*.ipk'
system(cmd) system(cmd)
@@ -1517,6 +1529,8 @@ class NeoBootImageChoose(Screen):
else: else:
mess = (_('Directory %sImagesUpload is empty\nPlease upload the image files in zip or nfi formats to install') % getNeoLocation() ) 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) self.session.open(MessageBox, mess, MessageBox.TYPE_INFO)
else:
session.open(MessageBox, _('Geen internet'), type=MessageBox.TYPE_ERROR)
def bootIMG(self): def bootIMG(self):
if getAccessN() == '1234': if getAccessN() == '1234':
@@ -1617,17 +1631,6 @@ def main(session, **kwargs):
vip = checkimage() vip = checkimage()
if vip == 1: if vip == 1:
if fileExists('' + LinkNeoBoot + '/.location'): if fileExists('' + LinkNeoBoot + '/.location'):
os.system('date "+%Y%m%d" > /tmp/.finishdate')
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 getTestToTest() != UPDATEVERSION:
session.open(MessageBox, _('New version update neoboot is available!\nPlease upgrade your flash plugin.'), type=MessageBox.TYPE_ERROR)
if not fileExists('/usr/lib/periodon/.accessdate'): #timeoff
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)
else:
pass pass
else: else:
if not fileExists('%sImageBoot/.version' % getNeoLocation()): if not fileExists('%sImageBoot/.version' % getNeoLocation()):
@@ -1649,6 +1652,19 @@ def main(session, **kwargs):
os.system('echo "\nNeoboot installation errors 3:\nfile neo.sh is error - 3\n" >> /tmp/error_neo') os.system('echo "\nNeoboot installation errors 3:\nfile neo.sh is error - 3\n" >> /tmp/error_neo')
session.open(MessageBox, _('Neoboot plugin installed with ERRORS! Not work properly! The error number is 3'), type=MessageBox.TYPE_ERROR) session.open(MessageBox, _('Neoboot plugin installed with ERRORS! Not work properly! The error number is 3'), type=MessageBox.TYPE_ERROR)
os.system('date "+%Y%m%d" > /tmp/.finishdate')
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 getTestToTest() != UPDATEVERSION:
session.open(MessageBox, _('New version update neoboot is available!\nPlease upgrade your flash plugin.'), type=MessageBox.TYPE_ERROR)
if not fileExists('/usr/lib/periodon/.accessdate'): #timeoff
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)
else:
pass
version = 0 version = 0
if fileExists('%sImageBoot/.version' % getNeoLocation()): if fileExists('%sImageBoot/.version' % getNeoLocation()):
f = open('%sImageBoot/.version' % getNeoLocation()) f = open('%sImageBoot/.version' % getNeoLocation())

View File

@@ -30,10 +30,13 @@ from os import system, listdir, mkdir, chdir, getcwd, rename as os_rename, remov
from os.path import dirname, isdir, isdir as os_isdir from os.path import dirname, isdir, isdir as os_isdir
import os import os
import time import time
if fileExists('/etc/vtiversion.info') or fileExists('/usr/lib/python3.8') and fileExists('/.multinfo'): if fileExists('/etc/vtiversion.info') or fileExists('/etc/bhversion') or fileExists('/usr/lib/python3.8') and fileExists('/.multinfo'):
from Screens.Console import Console from Screens.Console import Console
else: 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' LinkNeoBoot = '/usr/lib/enigma2/python/Plugins/Extensions/NeoBoot'
def getDS(): def getDS():