Exemplo n.º 1
0
def main(session, **kwargs):
    if not pathExists('/media/usb'):
        Console().ePopen('mkdir -p /media/usb')
    if pathExists('/usr/lib/enigma2/python/Plugins/Extensions/SH4MultiBoot'):
        try:
            mypath = open('/usr/lib/enigma2/python/Plugins/Extensions/SH4MultiBoot/.sh4multiboot_location', 'r').readline().strip()
            if not pathExists('/media/sh4multiboot'):
                os.mkdir('/media/sh4multiboot')
            cmd = 'mount ' + mypath + ' /media/sh4multiboot'
            Console().ePopen(cmd)
            f = open('/proc/mounts', 'r')
            for line in f.readlines():
                if line.find('/media/sh4multiboot') != -1:
                    line = line[0:9]
                    break

            cmd = 'mount ' + line + ' ' + mypath
            Console().ePopen(cmd)
            cmd = 'mount ' + mypath + ' /media/sh4multiboot'
            Console().ePopen(cmd)
        except:
            pass

        if fileExists('/usr/lib/enigma2/python/Plugins/Extensions/SH4MultiBoot/.sh4multiboot_location'):
            if fileExists('/media/sh4multiboot/SH4MultiBootI/.sh4multiboot'):
                session.open(SH4MultiBootImageChoose)
            else:
                session.open(SH4MultiBootInstallation)
        else:
            session.open(SH4MultiBootInstallation)
    else:
        session.open(MessageBox, _('Sorry: Wrong image in Flash found. You have to install the correct image in Flash'), MessageBox.TYPE_INFO, 3)
Exemplo n.º 2
0
    def __init__(self, session, entry):
        Screen.__init__(self, session)

        self["actions"] = ActionMap(
            ["OkCancelActions", "ColorActions"], {
                "cancel": self.Exit,
                "green": self.KeyGreen,
                "blue": self.KeyBlue,
                "red": self.KeyRed
            }, -1)

        self["list"] = List(list=[])
        self["list"].onSelectionChanged.append(self.__SetLabels)
        self["PixmapRed"] = MultiPixmap()
        self["PixmapGreen"] = MultiPixmap()
        self["PixmapBlue"] = MultiPixmap()
        self["LabelRed"] = Label()
        self["LabelGreen"] = Label()
        self["LabelBlue"] = Label()

        self.__devpath = entry[DEV_PATH]
        self.__fullsize = 0
        self.__old_part_list = []
        self.__new_part_list = []
        self.__comlist = []
        self.__unit = entry[2][len(entry[2]) - 2:]

        self.Console = Console()
        self.__getPartInfo()
Exemplo n.º 3
0
 def boot2(self, yesno):
     if yesno:
         Console().ePopen('touch /tmp/.sh4multireboot')
         Console().ePopen('reboot -p')
     else:
         Console().ePopen('touch /tmp/.sh4multireboot')
         self.session.open(MessageBox, _('Image will be booted after the next receiver reboot.'), MessageBox.TYPE_INFO)
Exemplo n.º 4
0
 def __init__(self, session):
     self.xmlfile = resolveFilename(
         SCOPE_PLUGINS, "SystemPlugins/CleanupWizard/cleanupwizard.xml")
     WizardLanguage.__init__(self,
                             session,
                             showSteps=False,
                             showStepSlider=False)
     Rc.__init__(self)
     self.session = session
     self["wizard"] = Pixmap()
     self.selectedAction = None
     self.selectedPackage = None
     self.NextStep = None
     self.Text = None
     self.buildListRef = None
     self.RemoveRef = None
     self.excluded_extensions = ('-skins', '-streamproxy',
                                 '-frontprocessorupgrade',
                                 '-crashlogautosubmit', '-hotplug',
                                 '-webinterface', '-mediascanner',
                                 '-genuinedreambox', '-mediaplayer',
                                 '-pictureplayer', '-dvdplayer', '-dvdburn',
                                 '-videotune', '-videomode',
                                 '-softwaremanager', '-skinselector',
                                 '-satfinder')
     self.Console = Console()
     self.installed_packetlist = []
     self.ipkg = IpkgComponent()
     self.ipkg.addCallback(self.ipkgCallback)
Exemplo n.º 5
0
 def addNTPcoldstart(self):
     if os.path.exists("/usr/sbin/ntpdate") or os.path.exists(
             "/usr/sbin/ntpd"):
         if os.path.exists("/usr/sbin/ntpdate"):
             cmd = "echo -e '#!/bin/sh\n\nsleep %s\n\n[ -x /usr/sbin/ntpdate ] && /usr/sbin/ntpdate -s -u %s\n\nexit 0' >> /etc/init.d/ntpdate" % (
                 str(self.ST.wifi_delay.value), self.ST.ip.value)
         elif os.path.exists("/usr/sbin/ntpd"):
             cmd = "echo -e '#!/bin/sh\n\nsleep %s\n\n[ -x usr/sbin/ntpd ] && /usr/sbin/ntpd -dnqp %s\n\nexit 0' >> /etc/init.d/ntpdate" % (
                 str(self.ST.wifi_delay.value), self.ST.ip.value)
         if fileExists("/etc/init.d/ntpdate"):
             os.chmod("/etc/init.d/ntpdate", 0755)
             Console().ePopen("update-rc.d ntpdate defaults 99")
         else:
             Console().ePopen(cmd)
             if fileExists("/etc/init.d/ntpdate"):
                 os.chmod("/etc/init.d/ntpdate", 0755)
                 Console().ePopen("update-rc.d ntpdate defaults 99")
             else:
                 self.ST.syncNTPcoldstart.value = False
     else:
         self.session.open(MessageBox,
                           "'ntpd' / " + _("'ntpdate' is not installed!"),
                           MessageBox.TYPE_ERROR,
                           timeout=3)
         self.ST.syncNTPcoldstart.value = False
Exemplo n.º 6
0
 def run11a(self):
     self.runed = "11a"
     if config.wizardsetup.UserInterfacePositioner.value is True:
         self.Console = Console()
         self.Console.ePopen('/usr/bin/showiframe /usr/share/enigma2/hd-testcard.mvi')			
         self.session.openWithCallback(self.run11b,UserInterfacePositioner)  
     else:
         self.run11b()
Exemplo n.º 7
0
 def __init__(self, session, boxtype):
     Console.__init__(self,
                      session,
                      title=_("!! Bootloader Upgrade !!"),
                      cmdlist=(self.FLASH_FSBL_BINARY, ),
                      finishedCallback=None,
                      closeOnSuccess=False)
     self.skinName = "Console"
     self._boxtype = boxtype
Exemplo n.º 8
0
	def buildList(self,action):
		if self.NextStep is not 'end':
			if not self.Console:
				self.Console = Console()
			cmd = "opkg list_installed | grep enigma2"
			self.Console.ePopen(cmd, self.buildListInstalled_Finished)
			self.buildListRef = self.session.openWithCallback(self.buildListfinishedCB, MessageBox, _("Please wait while searching for removable packages..."), type = MessageBox.TYPE_INFO, enable_input = False)
		else:
			self.buildListfinishedCB(False)
Exemplo n.º 9
0
	def runFinished(self, retval):
		Console.runFinished(self, retval)
		Log.w(retval)
		if retval != 0:
			title = _("Update failed!")
			txt = _("Don't worry your device is still ok! There are several safety mechanisms in place!\nYour device is still as fine as it was before this procedure!")
			msgtype = MessageBox.TYPE_ERROR
		else:
			title = _("Update finished!")
			txt = _("Update succeeded!\nYour Bootloader is now up-to-date!")
			msgtype = MessageBox.TYPE_INFO
		self.session.open(MessageBox, txt, type=msgtype, title=title)
Exemplo n.º 10
0
	def runFinished(self, retval):
		Console.runFinished(self, retval)
		Log.w(retval)
		if retval != 0:
			title = _("Update failed!")
			txt = _("Don't worry your device is still ok! There are several safety mechanisms in place!\nYour device is still as fine as it was before this procedure!")
			msgtype = MessageBox.TYPE_ERROR
		else:
			title = _("Update finished!")
			txt = _("Update succeeded!\nYour Bootloader is now up-to-date!")
			msgtype = MessageBox.TYPE_INFO
		self.session.open(MessageBox, txt, type=msgtype, title=title)
Exemplo n.º 11
0
	def addUseRTC(self):
		if fileExists("/etc/init.d/set-rtctime"):
			os.chmod("/etc/init.d/set-rtctime", 0755)
			Console().ePopen("update-rc.d set-rtctime defaults 40")
		else:
			Console().ePopen("cp %s /etc/init.d/set-rtctime") % resolveFilename(SCOPE_PLUGINS, "SystemPlugins/SystemTime/set-rtctime")
			if fileExists("/etc/init.d/set-rtctime"):
				os.chmod("/etc/init.d/set-rtctime", 0755)
				Console().ePopen("update-rc.d set-rtctime defaults 40")
			else:
				self.session.open(MessageBox, _("Script 'set-rtctime' not found!"), MessageBox.TYPE_ERROR, timeout=3)
				self.ST.useRTCstart.value = False
 def viewLog(self):
      cmd = 'rm -rf /tmp/.installed'
      Console().ePopen(cmd)
      cmd1 = 'cat /tmp/.log*.txt | grep Configuring | cut -d " " -f2- | cut -d. -f1 > /tmp/.installed'
      Console().ePopen(cmd1)
      cmd2 = 'rm -rf /tmp/*.ipk /tmp/.*.txt'
      Console().ePopen(cmd2)
      txt = " "
      dfile = '/tmp/.installed'
      myfile = file(dfile)
      txt = myfile.read() + '\nInstalled !'
      self.session.open(MessageBox, txt, type=1)
Exemplo n.º 13
0
    def __init__(self, session):
        Screen.__init__(self, session)

        self["actions"] = ActionMap(["OkCancelActions"], {
            "cancel": self.Exit,
            "ok": self.Ok
        }, -1)

        self["list"] = MenuList(list=[])
        self.Console = Console()
        global rereaddevices
        rereaddevices = True
        self.__readDev()
Exemplo n.º 14
0
	def cancel(self):
		nowTime = time.time()
		if nowTime > 1388534400:
			setRTCtime(nowTime)
			if config.plugins.SystemTime.choiceSystemTime.value == "0":
				eDVBLocalTimeHandler.getInstance().setUseDVBTime(True)
			else:
				eDVBLocalTimeHandler.getInstance().setUseDVBTime(False)
			try:
				eEPGCache.getInstance().timeUpdated()
			except:
				pass
		Console.cancel(self)
Exemplo n.º 15
0
class Ceparted(Screen):
    skin = """<screen position="center,center" size="600,200" title="eParted OpenLD">
			<widget name="list" position="5,5" size="590,190" />
		</screen>"""

    def __init__(self, session):
        Screen.__init__(self, session)

        self["actions"] = ActionMap(["OkCancelActions"], {
            "cancel": self.Exit,
            "ok": self.Ok
        }, -1)

        self["list"] = MenuList(list=[])
        self.Console = Console()
        global rereaddevices
        rereaddevices = True
        self.__readDev()

    def Ok(self):
        sel = self["list"].getCurrent()
        if sel and sel[1]:
            global rereaddevices
            rereaddevices = False
            self.session.openWithCallback(self.__readDev, Cpart, sel[1])

    def __readDev(self):
        global rereaddevices
        if rereaddevices:
            self.Console.ePopen("parted -m -l", self.__FinishedConsole)

    def Exit(self):
        self.Console.killAll()
        self.close()

    def __FinishedConsole(self, result, retval, extra_args=None):
        if retval == 0 and '\n' in result:
            list = []
            for x in parseCmd(result):
                if x[0][LIST_TYPE] == LIST_TYPE_DEV:
                    name = x[0][DEV_NAME]
                    if len(name) == 0:
                        name = x[0][DEV_PATH]
                    tstr = name
                    tstr += "  (%s - %d %s %s)" % (x[0][DEV_SIZE], len(x) - 1,
                                                   _("partition(s)"),
                                                   x[0][DEV_PATH])
                    list.append((tstr, (name, x[0][DEV_PATH], x[0][DEV_SIZE])))
            self["list"].setList(list)
Exemplo n.º 16
0
 def DoCommand(self, answer):
     if answer is None:
         self.skipCommand(_('answer is None'))
     if answer is False:
         self.skipCommand(_('you were not confirming'))
     else:
         title = _(
             'adding script %s to crontab with time') % self.targetname
         cmd = '%s add %s >/tmp/action.txt' % (cronmanager_script,
                                               self.targetname)
         cronroot = '/etc/cron/crontabs/root'
         f = open(cronroot, 'a')
         f.write(self.targetname + '\n')
         f.close()
         self.restartcron()
         self.session.open(MessageBox, _('Cron added successfully'),
                           MessageBox.TYPE_WARNING, 3)
         return
         Console().ePopen(cmd)
         actionpath = '/tmp/action.txt'
         if os.path.getsize(actionpath) < 200:
             self.session.open(MessageBox, _('adding cron failed'),
                               MessageBox.TYPE_WARNING, 3)
         else:
             self.session.open(MessageBox, _('Cron added successfully'),
                               MessageBox.TYPE_WARNING, 3)
     return
Exemplo n.º 17
0
	def __init__(self, session, entry):
		Screen.__init__(self, session)

		self["actions"] = ActionMap(["OkCancelActions", "ColorActions"],
		{
			"cancel": self.Exit,
			"green": self.KeyGreen,
			"blue": self.KeyBlue,
			"red": self.KeyRed
		}, -1)

		self["list"] = List(list=[])
		self["list"].onSelectionChanged.append(self.__SetLabels)
		self["PixmapRed"] = MultiPixmap()
		self["PixmapGreen"] = MultiPixmap()
		self["PixmapBlue"] = MultiPixmap()
		self["LabelRed"] = Label()
		self["LabelGreen"] = Label()
		self["LabelBlue"] = Label()

		self.__devpath=entry[DEV_PATH]
		self.__fullsize=0
		self.__old_part_list=[]
		self.__new_part_list=[]
		self.__comlist=[]
		self.__unit=entry[2][len(entry[2])-2:]

		self.Console = Console()
		self.__getPartInfo()
Exemplo n.º 18
0
 def OK(self):
     item = self["menu"].getCurrent()[1]
     if item is "one":
         self.session.openWithCallback(self.mList, InstallTarGZ)
     elif item is "two":
         self.session.openWithCallback(self.mList, InstallIpk)
     elif item is "tree":
         self.session.openWithCallback(self.mList, AdvInstallIpk)
     elif item is "seven":
         self.session.openWithCallback(self.mList, InstallZip)
     elif item is "eight":
         self.session.openWithCallback(self.mList, InstallRar)
     elif item is "four":
         self.session.openWithCallback(self.mList, RemoveIPK)
     elif item is "five":
         Console().ePopen(
             "rm -rf /tmp/*.ipk /tmp/*.gz /tmp/*.tgz /tmp/*.zip /tmp/*.rar /media/usb/*.ipk /media/usb/*.gz /media/usb/*.tgz /media/usb/*.zip /media/usb/*.rar /media/hdd/*.ipk /media/hdd/*.gz /media/hdd/*.tgz /media/hdd/*.zip /media/hdd/*.rar /media/cf/*.ipk /media/cf/*.gz /media/cf/*.tgz /media/cf/*.zip /media/cf/*.rar"
         )
         self.mbox = self.session.open(
             MessageBox,
             _("All ipk , tar.gz , bh.tgz , nab.tgz , zip , rar Files Removed From /tmp /media/usb /media/hdd /media/cf"
               ),
             MessageBox.TYPE_INFO,
             timeout=3)
     elif item is "six":
         self.session.openWithCallback(self.mList, downfeed)
Exemplo n.º 19
0
class Ceparted(Screen):
	skin = """<screen position="center,center" size="600,200" title="eParted OpenLD">
			<widget name="list" position="5,5" size="590,190" />
		</screen>"""
	def __init__(self, session):
		Screen.__init__(self, session)

		self["actions"] = ActionMap(["OkCancelActions"],
		{
			"cancel": self.Exit,
			"ok": self.Ok
		}, -1)

		self["list"] = MenuList(list=[])
		self.Console = Console()
		global rereaddevices
		rereaddevices=True
		self.__readDev()

	def Ok(self):
		sel = self["list"].getCurrent()
		if sel and sel[1]:
			global rereaddevices
			rereaddevices=False
			self.session.openWithCallback(self.__readDev, Cpart, sel[1])

	def __readDev(self):
		global rereaddevices
		if rereaddevices:
			self.Console.ePopen("parted -m -l", self.__FinishedConsole)

	def Exit(self):
		self.Console.killAll()
		self.close()

	def __FinishedConsole(self, result, retval, extra_args = None):
		if retval==0 and '\n' in result:
			list=[]
			for x in parseCmd(result):
				if x[0][LIST_TYPE]==LIST_TYPE_DEV:
					name = x[0][DEV_NAME]
					if len(name)==0:
						name = x[0][DEV_PATH]
					tstr = name
					tstr += "  (%s - %d %s %s)" %(x[0][DEV_SIZE],len(x)-1,_("partition(s)"),x[0][DEV_PATH])
					list.append((tstr,(name,x[0][DEV_PATH], x[0][DEV_SIZE])))
			self["list"].setList(list)
Exemplo n.º 20
0
 def ARemove(self):
     item = self["menu"].getCurrent()
     Console().ePopen("opkg remove --force-depends %s" % item[0])
     self.mbox = self.session.open(MessageBox,
                                   _("%s UnInstalled" % item[0]),
                                   MessageBox.TYPE_INFO,
                                   timeout=3)
     self.nList()
Exemplo n.º 21
0
    def install2(self, yesno):
        if yesno:
            cmd2 = 'mkdir -p /media/sh4multiboot;mount ' + self.mysel + ' /media/sh4multiboot'
            Console().ePopen(cmd2)
            if fileExists('/proc/mounts'):
                fileExists('/proc/mounts')
                f = open('/proc/mounts', 'r')
                for line in f.readlines():
                    if line.find(self.mysel):
		        mntdev = line.split(' ')[0]
                f.close()
                mntid = Console().ePopen('blkid -s UUID -o value %s>/usr/lib/enigma2/python/Plugins/Extensions/SH4MultiBoot/bin/install' % mntdev)

            cmd = 'mkdir -p ' + self.mysel + 'SH4MultiBootI;mkdir -p ' + self.mysel + 'SH4MultiBootUpload'
            Console().ePopen(cmd)
            Console().ePopen('cp -f /usr/lib/enigma2/python/Plugins/Extensions/SH4MultiBoot/bin/sh4multiinit /sbin/sh4multiinit')
            Console().ePopen('chmod 777 /sbin/sh4multiinit;chmod 777 /sbin/init;ln -sfn /sbin/sh4multiinit /sbin/init')
            Console().ePopen('mv -f /etc/init.d/volatile-media.sh /etc/init.d/volatile-media.sh.back')
            open('/media/sh4multiboot/SH4MultiBootI/.sh4multiboot', 'w').write('Flash')
            open('/usr/lib/enigma2/python/Plugins/Extensions/SH4MultiBoot/.sh4multiboot_location', 'w').write(self.mysel)
            Console().ePopen('cp -f /usr/lib/enigma2/python/Plugins/Extensions/SH4MultiBoot/.sh4multiboot_location /etc/sh4multi/')
            image = distro
            if fileExists('/etc/image-version'):
                if 'build' not in image:
                    f = open('/etc/image-version', 'r')
                    for line in f.readlines():
                        if 'build=' in line:
                            image = image + ' build ' + line[6:-1]
                            open('/media/sh4multiboot/SH4MultiBootI/.Flash', 'w').write(image)
                            break

                    f.close()
            self.myclose2(_('SH4MultiBoot has been installed succesfully!'))
        else:
            self.session.open(MessageBox, _('Installation aborted !'), MessageBox.TYPE_INFO)
Exemplo n.º 22
0
 def setup(self):
     item = self["menu"].getCurrent()
     name = item[0]
     Console().ePopen("opkg install %s" % name)
     msg = _("%s Installed" % name)
     self.mbox = self.session.open(MessageBox,
                                   msg,
                                   MessageBox.TYPE_INFO,
                                   timeout=3)
Exemplo n.º 23
0
 def DoChangeTimeRestart(self, answer):
     if answer is None:
         self.skipChangeTime(_('answer is None'))
     if answer is False:
         self.skipChangeTime(_('you were not confirming'))
     else:
         Console().ePopen('date %s' % self.newtime)
         quitMainloop(3)
     return
Exemplo n.º 24
0
 def restartCommand(self, answer):
     if answer is None:
         self.skipRestart(_('answer is None'))
     if answer is False:
         self.skipRestart(_('you were not confirming'))
     else:
         title = _('executing command on Dreambox')
         cmd = '%s %s' % (cronmanager_script, self.source)
         Console().ePopen([cmd])
     return
Exemplo n.º 25
0
 def boot(self):
     self.mysel = self['config'].getCurrent()
     if self.mysel:
         open('/media/sh4multiboot/SH4MultiBootI/.sh4multiboot', 'w').write(self.mysel)
         Console().ePopen('rm -f /tmp/.sh4multireboot')
         message = _('Are you sure you want to boot:\n') + self.mysel + ' now?'
         ybox = self.session.openWithCallback(self.boot2, MessageBox, message, MessageBox.TYPE_YESNO)
         ybox.setTitle(_('Boot Confirmation'))
     else:
         self.mysel
Exemplo n.º 26
0
	def __init__(self, session):
		Screen.__init__(self, session)

		self["actions"] = ActionMap(["OkCancelActions"],
		{
			"cancel": self.Exit,
			"ok": self.Ok
		}, -1)

		self["list"] = MenuList(list=[])
		self.Console = Console()
		global rereaddevices
		rereaddevices=True
		self.__readDev()
 def startSession(self):
     if os.path.isfile('/etc/ipkinstalled') is not True:
         cmd = 'opkg list-installed | cut -f1 -d" " > /etc/ipkinstalled'
         Console().ePopen(cmd)
     try:
         myfile = open('/etc/ipkinstalled', 'r+')
         for line in myfile:
             n1 = line.find("_", 0)
             line = line[:n1]
             self.data.append(line)
         myfile.close()
         self["list"].setList(self.data)
     except:
         return
 def DoLaterCommand(self, answer):
     if answer is None:
         self.skipLaterCommand(_('answer is None'))
     if answer is False:
         self.skipLaterCommand(_('you were not confirming'))
     else:
         title = _('adding script %s to crontab after time') % self.targetname
         cmd = '%s delay %s >/tmp/action.txt' % (cronmanager_script, self.targetname)
         Console().ePopen(cmd)
         self.restartcron()
         actionpath = '/tmp/action.txt'
         if os.path.getsize(actionpath) < 200:
             self.session.open(MessageBox, _('adding cron failed'), MessageBox.TYPE_WARNING, 3)
         else:
             self.session.open(MessageBox, _('Cron added successfully'), MessageBox.TYPE_WARNING, 3)
     return
Exemplo n.º 29
0
	def __init__(self, session):
		self.xmlfile = resolveFilename(SCOPE_PLUGINS, "SystemPlugins/CleanupWizard/cleanupwizard.xml")
		WizardLanguage.__init__(self, session, showSteps = False, showStepSlider = False)
		Rc.__init__(self)
		self.session = session
		self["wizard"] = Pixmap()
		self.selectedAction = None
		self.selectedPackage = None
		self.NextStep = None
		self.Text = None
		self.buildListRef = None
		self.RemoveRef = None
		self.excluded_extensions = ('-skins', '-streamproxy', '-frontprocessorupgrade', '-crashlogautosubmit', '-hotplug', '-webinterface', '-mediascanner', '-genuinedreambox', '-mediaplayer', '-pictureplayer', '-dvdplayer', '-dvdburn', '-videotune', '-videomode', '-softwaremanager', '-skinselector', '-satfinder' )
		self.Console = Console()
		self.installed_packetlist = []
		self.ipkg = IpkgComponent()
		self.ipkg.addCallback(self.ipkgCallback)
Exemplo n.º 30
0
	def nList(self):
		self.list = []
		Console().ePopen("opkg update")
		try:
			ipklist = os.popen("opkg list")
		except:
			pass
		png = LoadPixmap(cached=True, path=resolveFilename(SCOPE_PLUGINS, "Extensions/PackageManager/images/ipkmini.png"))
		for line in ipklist.readlines():
			dstring = line.split(" ")
			try:
				endstr = len(dstring[0] + dstring[1]+ dstring[2]+dstring[3]) + 4

				self.list.append((dstring[0]  + " " + dstring[1] + " " + dstring[2], line[endstr:], png))
			except:
				pass
		self["menu"].setList(self.list)
Exemplo n.º 31
0
	def DoChangeTimeRestart(self, answer):
		if answer is None:
			self.skipChangeTime(_("No answer given."))
		if answer is False:
			self.skipChangeTime(_("No confirmation given."))
		else:
			Console().ePopen("date %s" % self.newtime)
			nowTime = time.time()
			if nowTime > 1514808000:
				setRTCtime(nowTime)
				if config.plugins.SystemTime.choiceSystemTime.value == "0":
					eDVBLocalTimeHandler.getInstance().setUseDVBTime(True)
				else:
					eDVBLocalTimeHandler.getInstance().setUseDVBTime(False)
				try:
					eEPGCache.getInstance().timeUpdated()
				except:
					pass
Exemplo n.º 32
0
 def openTest(self):
     ldeps = len(self.depends)
     if ldeps == 0:
         self.viewLog()
     else:
         name1 = self.depends[0]
         missing = name1 + "_"
         slist = 'cams eglibc firmware fonts gstreamer lib mips32el perl plugins python qt4 skins ' + str(
             getBoxType())
         source = slist.split()
         self.found = 0
         i = 0
         while i < 12:
             addn = source[i]
             ftxt = '/tmp/.' + addn + '.txt'
             if not fileExists(ftxt):
                 cmd1 = "wget -O /tmp/." + addn + ".txt 'https://openvision.tech/pedm/mipsel/" + addn + "/index.html'"
                 Console().ePopen(cmd1)
             f1 = file(ftxt)
             flist1 = f1.read()
             if missing in flist1:
                 self.addon = addn
                 n4 = flist1.find(missing, 0)
                 n5 = flist1.find(".ipk", n4)
                 self.ipk = flist1[n4:(n5 + 4)]
                 self.found = 1
                 break
             else:
                 i = i + 1
         if self.found == 0:
             txt = name1 + "\nNot Found On The Server !"
             self.session.open(MessageBox, txt, type=1)
             self.close
         else:
             xurl1 = 'https://openvision.tech/pedm/mipsel/' + self.addon + '/'
             xurl2 = xurl1 + self.ipk
             self.idx = self.idx + 1
             cmd2 = 'opkg install --force-reinstall --force-overwrite ' + xurl2 + ' > /tmp/.log' + str(
                 self.idx) + '.txt'
             title = _("Installing addons %s" % (self.ipk))
             self.session.openWithCallback(self.newdeps, Console, _(title),
                                           [cmd2])
Exemplo n.º 33
0
	def run(self):
		returnValue = self["menu"].l.getCurrentSelection() and self["menu"].l.getCurrentSelection()[1]
		if returnValue is not None:
			cmd = "cp %s %s && chmod 755 %s" % (resolveFilename(SCOPE_PLUGINS, "Extensions/Transmission/transmission.sh"), transmission_sh, transmission_sh)
			Console().ePopen(cmd)
			if returnValue is "info":
				self.session.open(Console, _("Information transmission download"), ["chmod 755 %s && %s" % (transinfo_sh, transinfo_sh)])
			elif returnValue is "pause":
				self.session.open(Console, _("Pause all downloads"), ["chmod 755 %s && %s pause" % (pause_sh, pause_sh)])
			elif returnValue is "unpause":
				self.session.open(Console, _("Unpause all downloads"), ["chmod 755 %s && %s unpause" % (pause_sh, pause_sh)])
			elif returnValue is "start":
				self.session.open(Console, _("Start transmission"), ["%s start" % transmission_sh])
			elif returnValue is "stop":
				self.session.open(Console, _("Stop transmission"), ["%s stop" % transmission_sh])
			elif returnValue is "restart":
				self.session.open(Console, _("Restart transmission"), ["%s restart" % transmission_sh])
			elif returnValue is "enable":
				self.session.open(Console, _("Enable transmission autostart"), ["%s enable" % transmission_sh])
			elif returnValue is "disable":
				self.session.open(Console, _("Disable transmission autostart"), ["%s disable" % transmission_sh])
			elif returnValue is "on":
				self.session.open(Console, _("Enable auto queue downloads"), ["chmod 755 %s && %s on" % (swap_sh, swap_sh)])
			elif returnValue is "off":
				self.session.open(Console, _("Disable auto queue downloads"), ["chmod 755 %s && %s off" % (swap_sh, swap_sh)])
			elif returnValue is "enabled":
				self.session.open(Console, _("Enabled SWAP when start transmission"), ["chmod 755 %s && %s enabled" % (swap_sh, swap_sh)])
			elif returnValue is "create":
				self.session.open(Console, _("Create SWAP '/media/hdd/swapfile'"), ["chmod 755 %s && %s create" % (swap_sh, swap_sh)])
			elif returnValue is "disabled":
				self.session.open(Console, _("Not enabled SWAP when start transmission"), ["chmod 755 %s && %s disabled" % (swap_sh, swap_sh)])
			elif returnValue is "stop_trans":
				self.session.open(Console, _("Stop transmission after downloads (only queue works)"), ["chmod 755 %s && %s stop_trans" % (swap_sh, swap_sh)])
			elif returnValue is "dont_stop_trans":
				self.session.open(Console, _("Don't stop transmission after downloads (only queue works)"), ["chmod 755 %s && %s dont_stop_trans" % (swap_sh, swap_sh)])
			elif returnValue is "about_transmission":
				if fileExists("/usr/bin/transmission-daemon"):
					self.session.open(Console, _("About transmission version"), ["transmission-daemon -V \n", "echo Default login:root/password:root"])
				else:
					self.session.openWithCallback(self.InstallNow, MessageBox, _("transmission-daemon not installed!\nInstall now?"), MessageBox.TYPE_YESNO)
Exemplo n.º 34
0
    def __init__(self, session):
	Screen.__init__(self, session)
        Screen.setTitle(self, _('mediatomb'))
        self['lab1'] = Label(_('Autostart:'))
        self['labactive'] = Label(_(_('Active')))
        self['labdisabled'] = Label(_(_('Disabled')))
        self['lab2'] = Label(_('Current Status:'))
        self['labstop'] = Label(_('Stopped'))
        self['labrun'] = Label(_('Running'))
        self.Console = Console()
        self.my_mediatomb_active = False
        self.my_mediatomb_run = False
	self['key_red'] = Label(_('Close'))
        self['key_yellow'] = Label(_('Start'))
        self['key_blue'] = Label(_('Autostart'))
        self.list = []
        self['list'] = List(self.list)
        self['actions'] = ActionMap(['WizardActions', 'ColorActions', 'MenuActions'], {'back': self.close,
         'red': self.close,
         'yellow': self.mediatombStart,
         'blue': self.autostart})
        self.onLayoutFinish.append(self.updateList)
 def getstate(self, remname):
     if os.path.isfile('/etc/ipkinstalled') is not True:
         cmd = 'opkg list-installed | cut -f1 -d" " > /etc/ipkinstalled'
         Console().ePopen(cmd)
     try:
         myfile = open('/etc/ipkinstalled', 'r+')
         icount = 0
         data = []
         ebuf = []
         for line in myfile:
             data.append(icount)
             data[icount] = line[:-1]
             if data[icount] == remname:
                 state = 1
                 return state
             icount = icount + 1
         myfile.close()
         state = 0
         return state
     except:
         state = 0
         return state