コード例 #1
0
    def __init__(self, session, args=0):
        Screen.__init__(self, session)
        self.session = session
        self.MODEL = getBoxType()
        self.OEM = getBrandOEM()
        self.MACHINEBUILD = getMachineBuild()
        self.MACHINENAME = getMachineName()
        self.MACHINEBRAND = getMachineBrand()
        self.IMAGEFOLDER = getImageFolder()
        self.UBINIZE_ARGS = getMachineUBINIZE()
        self.MKUBIFS_ARGS = getMachineMKUBIFS()
        self.MTDKERNEL = getMachineMtdKernel()
        self.ROOTFSBIN = getMachineRootFile()
        self.KERNELBIN = getMachineKernelFile()
        self.ROOTFSTYPE = getImageFileSystem()
        print "[FULL BACKUP] BOX MACHINEBUILD = >%s<" % self.MACHINEBUILD
        print "[FULL BACKUP] BOX MACHINENAME = >%s<" % self.MACHINENAME
        print "[FULL BACKUP] BOX MACHINEBRAND = >%s<" % self.MACHINEBRAND
        print "[FULL BACKUP] BOX MODEL = >%s<" % self.MODEL
        print "[FULL BACKUP] OEM MODEL = >%s<" % self.OEM
        print "[FULL BACKUP] IMAGEFOLDER = >%s<" % self.IMAGEFOLDER
        print "[FULL BACKUP] UBINIZE = >%s<" % self.UBINIZE_ARGS
        print "[FULL BACKUP] MKUBIFS = >%s<" % self.MKUBIFS_ARGS
        print "[FULL BACKUP] MTDKERNEL = >%s<" % self.MTDKERNEL
        print "[FULL BACKUP] ROOTFSTYPE = >%s<" % self.ROOTFSTYPE

        self["key_green"] = Button("USB")
        self["key_red"] = Button("HDD")
        self["key_blue"] = Button(_("Exit"))
        self["key_yellow"] = Button("Create path usb")
        self["info-usb"] = Label(
            _("USB = Do you want to make a back-up on USB?\nThis will take between 4 and 15 minutes depending on the used filesystem and is fully automatic.\nMake sure you first insert an USB flash drive before you select USB."
              ))
        self["info-hdd"] = Label(
            _("HDD = Do you want to make an USB-back-up image on HDD? \nThis only takes 2 or 10 minutes and is fully automatic."
              ))
        self["actions"] = ActionMap(
            ["OkCancelActions", "ColorActions"], {
                "blue": self.quit,
                "yellow": self.yellow,
                "green": self.green,
                "red": self.red,
                "cancel": self.quit,
            }, -2)
コード例 #2
0
ファイル: fullbackup.py プロジェクト: trunca/novale-viejo
	def __init__(self, session, args = 0):
		Screen.__init__(self, session)
		self.session = session
		self.MODEL = getBoxType()
		self.OEM = getBrandOEM()
		self.MACHINEBUILD = getMachineBuild()
		self.MACHINENAME = getMachineName()
		self.MACHINEBRAND = getMachineBrand()
		self.IMAGEFOLDER = getImageFolder()
		self.UBINIZE_ARGS = getMachineUBINIZE()
		self.MKUBIFS_ARGS = getMachineMKUBIFS()
		self.MTDKERNEL = getMachineMtdKernel()
		self.ROOTFSBIN = getMachineRootFile()
		self.KERNELBIN = getMachineKernelFile()
		self.ROOTFSTYPE = getImageFileSystem()
		print "[FULL BACKUP] BOX MACHINEBUILD = >%s<" %self.MACHINEBUILD
		print "[FULL BACKUP] BOX MACHINENAME = >%s<" %self.MACHINENAME
		print "[FULL BACKUP] BOX MACHINEBRAND = >%s<" %self.MACHINEBRAND
		print "[FULL BACKUP] BOX MODEL = >%s<" %self.MODEL
		print "[FULL BACKUP] OEM MODEL = >%s<" %self.OEM
		print "[FULL BACKUP] IMAGEFOLDER = >%s<" %self.IMAGEFOLDER
		print "[FULL BACKUP] UBINIZE = >%s<" %self.UBINIZE_ARGS
		print "[FULL BACKUP] MKUBIFS = >%s<" %self.MKUBIFS_ARGS
		print "[FULL BACKUP] MTDKERNEL = >%s<" %self.MTDKERNEL
		print "[FULL BACKUP] ROOTFSTYPE = >%s<" %self.ROOTFSTYPE
		
		self["key_green"] = Button("USB")
		self["key_red"] = Button("HDD")
		self["key_blue"] = Button(_("Exit"))
		self["key_yellow"] = Button("Create path usb")
		self["info-usb"] = Label(_("USB = Do you want to make a back-up on USB?\nThis will take between 4 and 15 minutes depending on the used filesystem and is fully automatic.\nMake sure you first insert an USB flash drive before you select USB."))
		self["info-hdd"] = Label(_("HDD = Do you want to make an USB-back-up image on HDD? \nThis only takes 2 or 10 minutes and is fully automatic."))
		self["actions"] = ActionMap(["OkCancelActions", "ColorActions"], 
		{
			"blue": self.quit,
			"yellow": self.yellow,
			"green": self.green,
			"red": self.red,
			"cancel": self.quit,
		}, -2)
コード例 #3
0
from Components.ActionMap import ActionMap
from Components.About import about
from Screens.Console import SFConsole
from Screens.MessageBox import MessageBox
from time import time, strftime, localtime
from os import path, system, makedirs, listdir, walk, statvfs
import commands
import datetime
from Tools.Directories import fileExists
import os
from SFtoolbox import getBoxType, getMachineBrand, getMachineName, getDriverDate, getImageVersion, getImageBuild, getBrandOEM, getMachineBuild, getImageFolder, getMachineUBINIZE, getMachineMKUBIFS, getMachineMtdKernel, getMachineKernelFile, getMachineRootFile, getImageFileSystem

VERSION = "Version 4.2.1 SFteam"

HaveGZkernel = True
if getBrandOEM() in ("fulan"):
    HaveGZkernel = False


def Freespace(dev):
    statdev = statvfs(dev)
    space = (statdev.f_bavail * statdev.f_frsize) / 1024
    print "[FULL BACKUP] Free space on %s = %i kilobytes" % (dev, space)
    return space


class ImageBackup(Screen):
    skin = """
	<screen position="center,center" size="560,400" title="Image Backup">
		<ePixmap position="0,360"   zPosition="1" size="140,40" pixmap="skin_default/buttons/red.png" transparent="1" alphatest="on" />
		<ePixmap position="140,360" zPosition="1" size="140,40" pixmap="skin_default/buttons/green.png" transparent="1" alphatest="on" />
コード例 #4
0
ファイル: fullbackup.py プロジェクト: trunca/novale-viejo
from Components.ActionMap import ActionMap
from Components.About import about
from Screens.Console import SFConsole
from Screens.MessageBox import MessageBox
from time import time, strftime, localtime
from os import path, system, makedirs, listdir, walk, statvfs
import commands
import datetime
from Tools.Directories import fileExists
import os
from SFtoolbox import getBoxType, getMachineBrand, getMachineName, getDriverDate, getImageVersion, getImageBuild, getBrandOEM, getMachineBuild, getImageFolder, getMachineUBINIZE, getMachineMKUBIFS, getMachineMtdKernel, getMachineKernelFile, getMachineRootFile, getImageFileSystem

VERSION = "Version 4.2.1 SFteam"

HaveGZkernel = True
if getBrandOEM() in ("fulan"):
	HaveGZkernel = False

def Freespace(dev):
	statdev = statvfs(dev)
	space = (statdev.f_bavail * statdev.f_frsize) / 1024
	print "[FULL BACKUP] Free space on %s = %i kilobytes" %(dev, space)
	return space

class ImageBackup(Screen):
	skin = """
	<screen position="center,center" size="560,400" title="Image Backup">
		<ePixmap position="0,360"   zPosition="1" size="140,40" pixmap="skin_default/buttons/red.png" transparent="1" alphatest="on" />
		<ePixmap position="140,360" zPosition="1" size="140,40" pixmap="skin_default/buttons/green.png" transparent="1" alphatest="on" />
		<ePixmap position="280,360" zPosition="1" size="140,40" pixmap="skin_default/buttons/yellow.png" transparent="1" alphatest="on" />
		<ePixmap position="420,360" zPosition="1" size="140,40" pixmap="skin_default/buttons/blue.png" transparent="1" alphatest="on" />