• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python OMBManagerLocale._函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中OMBManagerLocale._函数的典型用法代码示例。如果您正苦于以下问题:Python _函数的具体用法?Python _怎么用?Python _使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了_函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: __init__

	def __init__(self, session, mount_point):
		Screen.__init__(self, session)
		
		self.setTitle(_('openMultiboot Manager'))
		
		self.session = session
		self.mount_point = mount_point
		self.data_dir = mount_point + '/' + OMB_DATA_DIR
		self.upload_dir = mount_point + '/' + OMB_UPLOAD_DIR
		self.select = None

		self["label1"] = Label(_("Current Running Image:"))
		self["label2"] = Label("")

		self.populateImagesList()
		self["list"] = List(self.images_list)
		self["list"].onSelectionChanged.append(self.onSelectionChanged)
		self["background"] = Pixmap()
		self["key_red"] = Button(_('Rename'))
		self["key_yellow"] = Button()
		self["key_blue"] = Button(_('Menu'))
		if BRANDING:
			self["key_green"] = Button(_('Install'))
		else:
			self["key_green"] = Button('')
		self["actions"] = ActionMap(["OkCancelActions", "ColorActions", "MenuActions"],
		{
			"cancel": self.close,
			"red": self.keyRename,
			"yellow": self.keyDelete,
			"green": self.keyInstall,
			"blue": self.showMen,
			"ok": self.KeyOk,
			"menu": self.showMen,
		})
开发者ID:oe-alliance,项目名称:openmultibootmanager,代码行数:35,代码来源:OMBManagerList.py


示例2: __init__

	def __init__(self, session, mount_point):
		Screen.__init__(self, session)
		
		self.setTitle(_('openMultiboot Manager'))
		
		self.session = session
		self.mount_point = mount_point
		self.data_dir = mount_point + '/' + OMB_DATA_DIR
		self.upload_dir = mount_point + '/' + OMB_UPLOAD_DIR

		self.populateImagesList()
		
		self["list"] = List(self.images_list)
		self["list"].onSelectionChanged.append(self.onSelectionChanged)
		self["background"] = Pixmap()
		self["key_red"] = Button(_('Rename'))
		self["key_yellow"] = Button()
		self["key_blue"] = Button(_('About'))
		if BRANDING:
			self["key_green"] = Button(_('Install'))
		else:
			self["key_green"] = Button('')
		self["config_actions"] = ActionMap(["OkCancelActions", "ColorActions"],
		{
			"cancel": self.close,
			"red": self.keyRename,
			"yellow": self.keyDelete,
			"green": self.keyInstall,
			"blue": self.keyAbout
		})
开发者ID:MCelliotG,项目名称:openmultibootmanager,代码行数:30,代码来源:OMBManagerList.py


示例3: __init__

	def __init__(self, session, kernel_module):
		self.session = session
		self.kernel_module = kernel_module

		message = _("You need the module ") + self.kernel_module + _(" to use openMultiboot\nDo you want install it?")
		disks_list = []
		for partition in harddiskmanager.getMountedPartitions():
			if partition.mountpoint != '/':
				disks_list.append((partition.description, partition.mountpoint))

		self.session.openWithCallback(self.installCallback, MessageBox, message, MessageBox.TYPE_YESNO)
开发者ID:oe-alliance,项目名称:openmultibootmanager,代码行数:11,代码来源:OMBManager.py


示例4: installPrepare

	def installPrepare(self):
		self.timer.stop()
		
		selected_image = self.selected_image
		selected_image_identifier = self.guessIdentifierName(selected_image)

		source_file = self.mount_point + '/' + OMB_UPLOAD_DIR + '/' + selected_image + '.zip'
		target_folder = self.mount_point + '/' + OMB_DATA_DIR + '/' + selected_image_identifier
		kernel_target_folder = self.mount_point + '/' + OMB_DATA_DIR + '/.kernels'
		kernel_target_file = kernel_target_folder + '/' + selected_image_identifier + '.bin'

		if not os.path.exists(kernel_target_folder):
			try:
				os.makedirs(kernel_target_folder)
			except OSError as exception:
				self.showError(_("Cannot create kernel folder %s") % kernel_target_folder)
				return
				
		if os.path.exists(target_folder):
			self.showError(_("The folder %s already exist") % target_folder)
			return
			
		try:
			os.makedirs(target_folder)
		except OSError as exception:
			self.showError(_("Cannot create folder %s") % target_folder)
			return

		tmp_folder = self.mount_point + '/' + OMB_TMP_DIR
		if os.path.exists(tmp_folder):
			os.system(OMB_RM_BIN + ' -rf ' + tmp_folder)			
		try:
			os.makedirs(tmp_folder)
			os.makedirs(tmp_folder + '/ubi')
			os.makedirs(tmp_folder + '/jffs2')
		except OSError as exception:
			self.showError(_("Cannot create folder %s") % tmp_folder)
			return
				
		if os.system(OMB_UNZIP_BIN + ' ' + source_file + ' -d ' + tmp_folder) != 0:
			self.showError(_("Cannot deflate image"))
			return
			
		if self.installImage(tmp_folder, target_folder, kernel_target_file, tmp_folder):
			os.system(OMB_RM_BIN + ' -f ' + source_file)
			self.messagebox.close()
			self.close()
		
		os.system(OMB_RM_BIN + ' -rf ' + tmp_folder)
开发者ID:devilcosta,项目名称:openmultibootmanager,代码行数:49,代码来源:OMBManagerInstall.py


示例5: __init__

	def __init__(self, session, mount_point, upload_list):
		Screen.__init__(self, session)
		
		self.setTitle(_('openMultiboot Install'))

		self.session = session
		self.mount_point = mount_point
		
		self['info'] = Label(_("Choose the image to install"))
		self["list"] = List(upload_list)
		self["actions"] = ActionMap(["SetupActions"],
		{
			"cancel": self.keyCancel,
			"ok": self.keyInstall
		})
开发者ID:devilcosta,项目名称:openmultibootmanager,代码行数:15,代码来源:OMBManagerInstall.py


示例6: doFormatDevice

	def doFormatDevice(self):
		self.timer.stop()
		self.error_message = ''
		if os.system('umount /dev/' + self.response.device) != 0:
			self.error_message = _('Cannot umount the device')
		else:
			if os.system('/sbin/mkfs.ext4 /dev/' + self.response.device) != 0:
				self.error_message = _('Cannot format the device')
			else:
				if os.system('mount /dev/' + self.response.device + ' ' + self.response.mountpoint) != 0:
					self.error_message = _('Cannot remount the device')
				
		self.messagebox.close()
		self.timer = eTimer()
		self.timer.callback.append(self.afterFormat)
		self.timer.start(100)
开发者ID:undertaker01,项目名称:openmultibootmanager,代码行数:16,代码来源:OMBManager.py


示例7: keyRename

	def keyRename(self):
		self.renameIndex = self["list"].getIndex()
		name = self["list"].getCurrent()
		if self["list"].getIndex() == 0:
			if name.endswith('(Flash)'):
				name = name[:-8]

		self.session.openWithCallback(self.renameEntryCallback, VirtualKeyBoard, title=_("Please enter new name:"), text=name)
开发者ID:MCelliotG,项目名称:openmultibootmanager,代码行数:8,代码来源:OMBManagerList.py


示例8: installImageTARBZ2

	def installImageTARBZ2(self, src_path, dst_path, kernel_dst_path, tmp_folder):
		base_path = src_path + '/' + OMB_GETIMAGEFOLDER
		rootfs_path = base_path + '/' + OMB_GETMACHINEROOTFILE
		kernel_path = base_path + '/' + OMB_GETMACHINEKERNELFILE

		if os.system(OMB_TAR_BIN + ' jxf %s -C %s' % (rootfs_path,dst_path)) != 0:
			self.showError(_("Error unpacking rootfs"))
			return False

		if os.path.exists(dst_path + '/usr/bin/enigma2'):
			if os.system(OMB_CP_BIN + ' ' + kernel_path + ' ' + kernel_dst_path) != 0:
				self.showError(_("Error copying kernel"))
				return False

		self.dirtyHack(dst_path)

		return True
开发者ID:oe-alliance,项目名称:openmultibootmanager,代码行数:17,代码来源:OMBManagerInstall.py


示例9: installImage

	def installImage(self, src_path, dst_path, kernel_dst_path, tmp_folder):
		if OMB_GETIMAGEFILESYSTEM == "ubi":
			return self.installImageUBI(src_path, dst_path, kernel_dst_path, tmp_folder)
		elif OMB_GETIMAGEFILESYSTEM == "jffs2":
			return self.installImageJFFS2(src_path, dst_path, kernel_dst_path, tmp_folder)
		else:
			self.showError(_("Your STB doesn\'t seem supported"))
			return False
开发者ID:devilcosta,项目名称:openmultibootmanager,代码行数:8,代码来源:OMBManagerInstall.py


示例10: keyDelete

	def keyDelete(self):
		if len(self.images_entries) == 0:
			return
			
		index = self["list"].getIndex()
		if index >= 0 and index < len(self.images_entries):
			self.entry_to_delete = self.images_entries[index]
			if self.canDeleteEntry(self.entry_to_delete):
				self.session.openWithCallback(self.deleteConfirm, MessageBox, _("Do you want to delete %s?") % self.entry_to_delete['label'], MessageBox.TYPE_YESNO)
开发者ID:MCelliotG,项目名称:openmultibootmanager,代码行数:9,代码来源:OMBManagerList.py


示例11: __init__

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

		message = _("Where do you want to install openMultiboot?")
		disks_list = []
		for partition in harddiskmanager.getMountedPartitions():
			if partition and partition.mountpoint and partition.device and partition.mountpoint != '/' and partition.device[:2] == 'sd':
				disks_list.append((partition.description, partition))

		if len(disks_list) > 0:
			disks_list.append((_("Cancel"), None))
			self.session.openWithCallback(self.initCallback, MessageBox, message, list=disks_list)
		else:
			self.session.open(
				MessageBox,
				_("No suitable devices found"),
				type = MessageBox.TYPE_ERROR
			)
开发者ID:undertaker01,项目名称:openmultibootmanager,代码行数:18,代码来源:OMBManager.py


示例12: confirmNextbootCB

	def confirmNextbootCB(self, ret):
		if ret:
			image = self.images_entries[self.select]['identifier']
			print "[OMB] set nextboot to %s" % image
			file_entry = self.data_dir + '/.nextboot'
			f = open(file_entry, 'w')
			f.write(image)
			f.close()

			self.session.openWithCallback(self.confirmRebootCB, MessageBox,_('Do you want to reboot now ?'), MessageBox.TYPE_YESNO)
开发者ID:a4tech,项目名称:openmultibootmanager,代码行数:10,代码来源:OMBManagerList.py


示例13: Plugins

def Plugins(**kwargs):
    return [
        PluginDescriptor(
            name="OpenMultiboot",
            description=_("OpenMultiboot Manager"),
            icon="plugin.png",
            where=[PluginDescriptor.WHERE_EXTENSIONSMENU, PluginDescriptor.WHERE_PLUGINMENU],
            fnc=OMBManager,
        )
    ]
开发者ID:undertaker01,项目名称:openmultibootmanager,代码行数:10,代码来源:plugin.py


示例14: __init__

	def __init__(self, session, mount_point, upload_list):
		Screen.__init__(self, session)
		
		self.setTitle(_('openMultiboot Install'))

		self.session = session
		self.mount_point = mount_point

		self.esize = "128KiB"
		self.vid_offset = "2048"
		self.nandsim_parm = "first_id_byte=0x20 second_id_byte=0xac third_id_byte=0x00 fourth_id_byte=0x15"

		self['info'] = Label(_("Choose the image to install"))
		self["list"] = List(upload_list)
		self["actions"] = ActionMap(["SetupActions"],
		{
			"cancel": self.keyCancel,
			"ok": self.keyInstall
		})
开发者ID:a4tech,项目名称:openmultibootmanager,代码行数:19,代码来源:OMBManagerInstall.py


示例15: installModule

	def installModule(self):
		self.timer.stop()
		self.error_message = ''
		if os.system('opkg update && opkg install ' + self.kernel_module) != 0:
			self.error_message = _('Cannot install ' + self.kernel_module)
		
		self.messagebox.close()
		self.timer = eTimer()
		self.timer.callback.append(self.afterInstall)
		self.timer.start(100)
开发者ID:undertaker01,项目名称:openmultibootmanager,代码行数:10,代码来源:OMBManager.py


示例16: onSelectionChanged

	def onSelectionChanged(self):
		if len(self.images_entries) == 0:
			return
			
		index = self["list"].getIndex()
		if index >= 0 and index < len(self.images_entries):
			entry = self.images_entries[index]
			if self.canDeleteEntry(entry):
				self["key_yellow"].setText(_('Delete'))
			else:
				self["key_yellow"].setText('')
开发者ID:MCelliotG,项目名称:openmultibootmanager,代码行数:11,代码来源:OMBManagerList.py


示例17: keyInstall

	def keyInstall(self):
		self.selected_image = self["list"].getCurrent()
		if not self.selected_image:
			return
			
		self.messagebox = self.session.open(MessageBox, _('Please wait while installation is in progress.\nThis operation may take a while.'), MessageBox.TYPE_INFO, enable_input = False)
		self.timer = eTimer()
		self.timer.callback.append(self.installPrepare)
		self.timer.start(100)
		self.error_timer = eTimer()
		self.error_timer.callback.append(self.showErrorCallback)
开发者ID:devilcosta,项目名称:openmultibootmanager,代码行数:11,代码来源:OMBManagerInstall.py


示例18: initCallback

	def initCallback(self, response):
		if response:
			fs_type = self.getFSType(response.device)
			if fs_type not in ['ext3', 'ext4']:
				self.response = response
				self.session.openWithCallback(
					self.formatDevice,
					MessageBox,
					_("Filesystem not supported\nDo you want format your drive?"),
					type = MessageBox.TYPE_YESNO
				)
			else:
				self.createDir(response)
开发者ID:undertaker01,项目名称:openmultibootmanager,代码行数:13,代码来源:OMBManager.py


示例19: installImageUBI

	def installImageUBI(self, src_path, dst_path, kernel_dst_path, tmp_folder):
		for i in range(0, 20):
			mtdfile = "/dev/mtd" + str(i)
			if os.path.exists(mtdfile) is False:
				break
		mtd = str(i)

		base_path = src_path + '/' + OMB_GETIMAGEFOLDER
		rootfs_path = base_path + '/' + OMB_GETMACHINEROOTFILE
		kernel_path = base_path + '/' + OMB_GETMACHINEKERNELFILE
		ubi_path = src_path + '/ubi'

		# This is idea from EGAMI Team to handle universal UBIFS unpacking - used only for INI-HDp model
		if OMB_GETMACHINEBUILD in ('inihdp'):
			if fileExists("/usr/lib/enigma2/python/Plugins/Extensions/OpenMultiboot/ubi_reader/ubi_extract_files.py"):
				ubifile = "/usr/lib/enigma2/python/Plugins/Extensions/OpenMultiboot/ubi_reader/ubi_extract_files.py"
			else:
				ubifile = "/usr/lib/enigma2/python/Plugins/Extensions/OpenMultiboot/ubi_reader/ubi_extract_files.pyo"
			cmd= "chmod 755 " + ubifile
			rc = os.system(cmd)
			cmd = "python " + ubifile + " " + rootfs_path + " -o " + ubi_path
			rc = os.system(cmd)
			os.system(OMB_CP_BIN + ' -rp ' + ubi_path + '/rootfs/* ' + dst_path)
			rc = os.system(cmd)
			cmd = ('chmod -R +x ' + dst_path)
			rc = os.system(cmd)
			cmd = 'rm -rf ' + ubi_path
			rc = os.system(cmd)
			os.system(OMB_CP_BIN + ' ' + kernel_path + ' ' + kernel_dst_path)
			return True

		virtual_mtd = tmp_folder + '/virtual_mtd'
		os.system(OMB_MODPROBE_BIN + ' nandsim cache_file=' + virtual_mtd + ' ' + self.nandsim_parm)
		if not os.path.exists('/dev/mtd' + mtd):
			os.system('rmmod nandsim')
			self.showError(_("Cannot create virtual MTD device"))
			return False

		os.system(OMB_DD_BIN + ' if=' + rootfs_path + ' of=/dev/mtdblock' + mtd + ' bs=2048')
		os.system(OMB_UBIATTACH_BIN + ' /dev/ubi_ctrl -m ' + mtd + ' -O ' + self.vid_offset)
		os.system(OMB_MOUNT_BIN + ' -t ubifs ubi1_0 ' + ubi_path)

		if os.path.exists(ubi_path + '/usr/bin/enigma2'):
			os.system(OMB_CP_BIN + ' -rp ' + ubi_path + '/* ' + dst_path)
			os.system(OMB_CP_BIN + ' ' + kernel_path + ' ' + kernel_dst_path)

		os.system(OMB_UMOUNT_BIN + ' ' + ubi_path)
		os.system(OMB_UBIDETACH_BIN + ' -m ' + mtd)
		os.system(OMB_RMMOD_BIN + ' nandsim')

		return True
开发者ID:a4tech,项目名称:openmultibootmanager,代码行数:51,代码来源:OMBManagerInstall.py


示例20: __init__

	def __init__(self, session):
		Screen.__init__(self, session)
		
		self.setTitle(_('openMultiboot About'))
		
		about = "openMultiboot Manager " + OMB_MANAGER_VERION + "\n"
		about += "(c) 2014 Impex-Sat Gmbh & Co.KG\n\n"
		about += "Written by Sandro Cavazzoni <[email protected]>"
		
		self['about'] = Label(about)
		self["actions"] = ActionMap(["SetupActions"],
		{
			"cancel": self.keyCancel
		})
开发者ID:BlackHole,项目名称:openmultibootmanager,代码行数:14,代码来源:OMBManagerAbout.py



注:本文中的OMBManagerLocale._函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python OSC.OSCClient类代码示例发布时间:2022-05-24
下一篇:
Python interfaces.IOrderedContainer类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap