Exemplo n.º 1
1
	def backuP(self):
		m = checkkernel()
		if m == 1:
		    check = False
		    if fileExists('/proc/mounts'):
			    fileExists('/proc/mounts')
			    f = open('/proc/mounts', 'r')
			    for line in f.readlines():
				    if line.find('/media/cf') != -1:
					    check = True
					    continue
				    if line.find('/media/usb') != -1:
					    check = True
					    continue
				    if line.find('/media/usb2') != -1:
					    check = True
					    continue
				    if line.find('/media/usb3') != -1:
					    check = True
					    continue
				    if line.find('/media/card') != -1:
					    check = True
					    continue
				    if line.find('/hdd') != -1:
					    check = True
					    continue
			    f.close()
		    else:
			    fileExists('/proc/mounts')
		    if check == False:
			    self.session.open(MessageBox, _('Sorry, there is not any connected devices in your STB.\nPlease connect HDD or USB to store/restore Your EGAMI Backup!'), MessageBox.TYPE_INFO)
		    else:
			    self.session.openWithCallback(self.myclose, EGAMIBackupPanel_Step2)
		else:
		  self.session.open(MessageBox, _('Sorry: Wrong image in flash found. You have to install in flash EGAMI Image'), MessageBox.TYPE_INFO, 3)
Exemplo n.º 2
0
 def __init__(self, session, args=None):
     Screen.__init__(self, session)
     Screen.setTitle(self, _('EGAMI Backup Panel'))
     m = checkkernel()
     if m == 1:
         print 'EGAMI Valid'
     else:
         self.close()
     self['label1'] = Label(_('1. STEP - Choose option RESTORE / BACKUP'))
     self['label2'] = Label(
         _('There is not any EGAMI Backup file on connected devices!'))
     self['label3'] = Label(_(''))
     self['key_red'] = Label(_('Cancel'))
     self['key_green'] = Label(_('Restore EGAMI'))
     self['key_yellow'] = Label(_('Backup EGAMI'))
     self.mlist = []
     self['list'] = MenuList(self.mlist)
     self['actions'] = ActionMap(
         ['OkCancelActions', 'ColorActions'], {
             'red': self.close,
             'cancel': self.close,
             'yellow': self.backuP,
             'green': self.restorE
         }, -1)
     self.onLayoutFinish.append(self.updateT)
Exemplo n.º 3
0
def main(session, **kwargs):
	m = checkkernel()
	if m == 1:
		try:
			f = open('/usr/lib/enigma2/python/Plugins/Extensions/EGAMIBoot/.egamiboot_location', 'r')
			mypath = f.readline().strip()
			f.close()
			cmd="mount " + mypath + " /media/egamiboot"
			system(cmd)
			f = open('/proc/mounts', 'r')
			for line in f.readlines():
				if line.find('/media/egamiboot') != -1:
					line = line[0:9]
					break
			cmd="mount " + line + " " + mypath
			system(cmd)
			cmd="mount " + mypath + " /media/egamiboot"
			system(cmd)
		except:
			"error"
		if fileExists("/usr/lib/enigma2/python/Plugins/Extensions/EGAMIBoot/.egamiboot_location"):
			  session.open(EGAMIBootImageChoose)
		else:
			  session.open(EGAMIBootInstallation)
	else:
		session.open(MessageBox, _('Sorry: Wrong image in flash found. You have to install in flash EGAMI Image'), MessageBox.TYPE_INFO, 3)
Exemplo n.º 4
0
def main(session, **kwargs):
    m = checkkernel()
    if m == 1:
        try:
            session.open(EGAMIMainNews)
        except:
            print '[EGAMINews] Plugin execution failed'

    else:
        session.open(MessageBox, _('Sorry: Wrong Image Detected You Have To Install EGAMI On Flash'), MessageBox.TYPE_INFO, 10)
Exemplo n.º 5
0
def main(session, **kwargs):
    m = checkkernel()
    if m == 1:
        try:
            session.open(EGAMIMainNews)
        except:
            print '[EGAMINews] Plugin execution failed'

    else:
        session.open(MessageBox, _('Sorry: Wrong image in flash found. You have to install in flash EGAMI Image'), MessageBox.TYPE_INFO, 3)
Exemplo n.º 6
0
    def restorE(self):
        m = checkkernel()
        if m == 1:
            check = False
            if fileExists('/proc/mounts'):
                fileExists('/proc/mounts')
                f = open('/proc/mounts', 'r')
                for line in f.readlines():
                    if line.find('/media/cf') != -1:
                        check = True
                        continue
                    if line.find('/media/usb') != -1:
                        check = True
                        continue
                    if line.find('/media/usb2') != -1:
                        check = True
                        continue
                    if line.find('/media/usb3') != -1:
                        check = True
                        continue
                    if line.find('/media/card') != -1:
                        check = True
                        continue
                    if line.find('/hdd') != -1:
                        check = True
                        continue

                f.close()
            else:
                fileExists('/proc/mounts')
            if check == False:
                self.session.open(
                    MessageBox,
                    _('Sorry, there is not any connected devices in your STB.\nPlease connect HDD or USB to store/restore Your EGAMI Backup!'
                      ), MessageBox.TYPE_INFO)
            else:
                backup_file = self['list'].l.getCurrentSelection()[1]
                if backup_file != '':
                    message = _(
                        'Do you really want to restore the EGAMI Backup:\n '
                    ) + self.mybackupfile + ' ?'
                    self.session.openWithCallback(self.restorE_2, MessageBox,
                                                  message,
                                                  MessageBox.TYPE_YESNO)
                else:
                    system('umount /media/egamibackup_location')
                    system('rmdir /media/egamibackup_location')
                    self.session.open(MessageBox,
                                      _('Sorry, EGAMI Backup not found.'),
                                      MessageBox.TYPE_INFO)
        else:
            self.session.open(
                MessageBox,
                _('Sorry: Wrong image in flash found. You have to install in flash EGAMI Image'
                  ), MessageBox.TYPE_INFO, 3)
Exemplo n.º 7
0
 def __init__(self, session):
     Screen.__init__(self, session)
     Screen.setTitle(self, _('EGAMI Full Image Backup'))
     m = checkkernel()
     if m == 1:
         print 'EGAMI Valid'
     else:
         self.close()
     self.list = []
     self['config'] = MenuList(self.list)
     self['key_green'] = Label(_('Full Backup'))
     self['key_red'] = Label(_('Cancel'))
     self['label1'] = Label(_('1. STEP - Choose backup location'))
     self['label2'] = Label(_('Here is the list of mounted devices in Your STB\nPlease choose a device where You would like to keep Your backup:'))
     self['actions'] = ActionMap(['WizardActions', 'ColorActions'], {'green': self.saveMysets,
      'red': self.close,
      'back': self.close})
     self.deviceok = True
     self.updateList()
Exemplo n.º 8
0
    def restorE(self):
        m = checkkernel()
        if m == 1:
            check = False
            if fileExists('/proc/mounts'):
                fileExists('/proc/mounts')
                f = open('/proc/mounts', 'r')
                for line in f.readlines():
                    if line.find('/media/cf') != -1:
                        check = True
                        continue
                    if line.find('/media/usb') != -1:
                        check = True
                        continue
                    if line.find('/media/usb2') != -1:
                        check = True
                        continue
                    if line.find('/media/usb3') != -1:
                        check = True
                        continue
                    if line.find('/media/card') != -1:
                        check = True
                        continue
                    if line.find('/hdd') != -1:
                        check = True
                        continue

                f.close()
            else:
                fileExists('/proc/mounts')
            if check == False:
                self.session.open(MessageBox, _('Sorry, there is not any connected devices in your STB.\nPlease connect HDD or USB to store/restore Your EGAMI Backup!'), MessageBox.TYPE_INFO)
            else:
                backup_file = self['list'].l.getCurrentSelection()[1]
                if backup_file != '':
                    message = _('Do you really want to restore the EGAMI Backup:\n ') + self.mybackupfile + ' ?'
                    self.session.openWithCallback(self.restorE_2, MessageBox, message, MessageBox.TYPE_YESNO)
                else:
                    system('umount /media/egamibackup_location')
                    system('rmdir /media/egamibackup_location')
                    self.session.open(MessageBox, _('Sorry, EGAMI Backup not found.'), MessageBox.TYPE_INFO)
        else:
            self.session.open(MessageBox, _('Sorry: Wrong image in flash found. You have to install in flash EGAMI Image'), MessageBox.TYPE_INFO, 3)
Exemplo n.º 9
0
    def backuP(self):
        m = checkkernel()
        if m == 1:
            check = False
            if fileExists('/proc/mounts'):
                fileExists('/proc/mounts')
                f = open('/proc/mounts', 'r')
                for line in f.readlines():
                    if line.find('/media/cf') != -1:
                        check = True
                        continue
                    if line.find('/media/usb') != -1:
                        check = True
                        continue
                    if line.find('/media/usb2') != -1:
                        check = True
                        continue
                    if line.find('/media/usb3') != -1:
                        check = True
                        continue
                    if line.find('/media/card') != -1:
                        check = True
                        continue
                    if line.find('/hdd') != -1:
                        check = True
                        continue

                f.close()
            else:
                fileExists('/proc/mounts')
            if check == False:
                self.session.open(
                    MessageBox,
                    _('Sorry, there is not any connected devices in your STB.\nPlease connect HDD or USB to store/restore Your EGAMI Backup!'
                      ), MessageBox.TYPE_INFO)
            else:
                self.session.openWithCallback(self.myclose,
                                              EGAMIBackupPanel_Step2)
        else:
            self.session.open(
                MessageBox,
                _('Sorry: Wrong image in flash found. You have to install in flash EGAMI Image'
                  ), MessageBox.TYPE_INFO, 3)
Exemplo n.º 10
0
	def __init__(self, session):
		self.skin = EGAMIBackupPanel_Step2_Skin
		Screen.__init__(self, session)
		
		m = checkkernel()
		if m == 1:
		  print "EGAMI Valid"
		else:
		  self.close()
		  
		self.list = []
		self["config"] = MenuList(self.list)
		self['key_yellow'] = Label(_('Full Backup'))
		self['key_green'] = Label(_('Cancel'))
		self['label1'] = Label(_('1. STEP - Choose backup location'))
		self['label2'] = Label(_('Here is the list of mounted devices in Your STB\nPlease choose a device where You would like to keep Your backup:'))
		self['actions'] = ActionMap(['WizardActions', 'ColorActions'], {'yellow': self.saveMysets, 'green': self.close, 'back': self.close})

		self.deviceok = True
		
		self.updateList()
Exemplo n.º 11
0
 def __init__(self, session, args = None):
     Screen.__init__(self, session)
     Screen.setTitle(self, _('EGAMI Backup Panel'))
     m = checkkernel()
     if m == 1:
         print 'EGAMI Valid'
     else:
         self.close()
     self['label1'] = Label(_('1. STEP - Choose option RESTORE / BACKUP'))
     self['label2'] = Label(_('There is not any EGAMI Backup file on connected devices!'))
     self['label3'] = Label(_(''))
     self['key_red'] = Label(_('Cancel'))
     self['key_green'] = Label(_('Restore EGAMI'))
     self['key_yellow'] = Label(_('Backup EGAMI'))
     self.mlist = []
     self['list'] = MenuList(self.mlist)
     self['actions'] = ActionMap(['OkCancelActions', 'ColorActions'], {'red': self.close,
      'cancel': self.close,
      'yellow': self.backuP,
      'green': self.restorE}, -1)
     self.onLayoutFinish.append(self.updateT)
Exemplo n.º 12
0
 def __init__(self, session):
     Screen.__init__(self, session)
     Screen.setTitle(self, _('EGAMI Full Image Backup'))
     m = checkkernel()
     if m == 1:
         print 'EGAMI Valid'
     else:
         self.close()
     self.list = []
     self['config'] = MenuList(self.list)
     self['key_green'] = Label(_('Full Backup'))
     self['key_red'] = Label(_('Cancel'))
     self['label1'] = Label(_('1. STEP - Choose backup location'))
     self['label2'] = Label(
         _('Here is the list of mounted devices in Your STB\nPlease choose a device where You would like to keep Your backup:'
           ))
     self['actions'] = ActionMap(['WizardActions', 'ColorActions'], {
         'green': self.saveMysets,
         'red': self.close,
         'back': self.close
     })
     self.deviceok = True
     self.updateList()
Exemplo n.º 13
0
def start_from_pluginmenu(session, **kwargs):
    m = checkkernel()
    if m == 1:
        session.openWithCallback(exit, FileCommanderScreen)
    else:
        session.open(MessageBox, _('Sorry: Wrong image in flash found. You have to install in flash EGAMI Image'), MessageBox.TYPE_INFO, 3)