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

Python util.localize函数代码示例

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

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



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

示例1: addScraperToSiteList

	def addScraperToSiteList(self, controlId, sites, romCollection):

		log.info("addScraperToSiteList")

		control = self.getControlById(controlId)
		scraperItem = control.getSelectedItem()
		scraper = scraperItem.getLabel()

		if scraper == util.localize(32854):
			return sites

		#check if this site is already available for current RC
		for site in romCollection.scraperSites:
			if site.name == scraper:
				sites.append(site)
				return sites

		siteRow = None
		siteRows = self.gui.config.tree.findall('Scrapers/Site')
		for element in siteRows:
			if element.attrib.get('name') == scraper:
				siteRow = element
				break

		if siteRow is None:
			xbmcgui.Dialog().ok(util.localize(32021), util.localize(32022) % scraper)
			return None

		site, errorMsg = self.gui.config.readScraper(siteRow, romCollection.name, '', '', True, self.gui.config.tree)
		if site is not None:
			sites.append(site)

		return sites
开发者ID:bruny,项目名称:romcollectionbrowser,代码行数:33,代码来源:dialogeditromcollection.py


示例2: __checkGameHasSaveStates

	def __checkGameHasSaveStates(self, gameRow, filenameRows):

		if self.romCollection.saveStatePath == '':
			log.debug("No save state path set")
			return ''

		rom = filenameRows[0][0]
		saveStatePath = self.__replacePlaceholdersInParams(self.romCollection.saveStatePath, rom, gameRow)

		saveStateFiles = glob.glob(saveStatePath)

		if len(saveStateFiles) == 0:
			log.debug("No save state files found")
			return ''

		log.info('saveStateFiles found: ' + str(saveStateFiles))

		# don't select savestatefile if ASKNUM is requested in Params
		if re.search('(?i)%ASKNUM%', self.romCollection.saveStateParams):
			return saveStateFiles[0]

		options = [util.localize(32165)]
		for f in saveStateFiles:
			options.append(os.path.basename(f))
		selectedFile = xbmcgui.Dialog().select(util.localize(32166), options)
		# If selections is canceled or "Don't launch statefile" option
		if selectedFile < 1:
			return ''

		return saveStateFiles[selectedFile - 1]
开发者ID:bruny,项目名称:romcollectionbrowser,代码行数:30,代码来源:launcher.py


示例3: builMissingFilterStatement

def builMissingFilterStatement(config):

	if(config.showHideOption.lower() == util.localize(32157)):
		return ''
		
	statement = ''
	
	andStatementInfo = buildInfoStatement(config.missingFilterInfo.andGroup, ' AND ')
	if(andStatementInfo != ''):
		statement = andStatementInfo
		
	orStatementInfo =  buildInfoStatement(config.missingFilterInfo.orGroup, ' OR ')
	if(orStatementInfo != ''):
		if (statement != ''):
			statement = statement +' OR '
		statement = statement + orStatementInfo
		
	andStatementArtwork = buildArtworkStatement(config, config.missingFilterArtwork.andGroup, ' AND ')
	if(andStatementArtwork != ''):
		if (statement != ''):
			statement = statement +' OR '
		statement = statement + andStatementArtwork
	
	orStatementArtwork =  buildArtworkStatement(config, config.missingFilterArtwork.orGroup, ' OR ')
	if(orStatementArtwork != ''):
		if (statement != ''):
			statement = statement +' OR '
		statement = statement + orStatementArtwork
	
	if(statement != ''):
		statement = '(%s)' %(statement)
		if(config.showHideOption.lower() == util.localize(32161)):
			statement = 'NOT ' +statement
	
	return statement
开发者ID:martyn-harris,项目名称:romcollectionbrowser,代码行数:35,代码来源:helper.py


示例4: readFileType

	def readFileType(self, name, tree):
		fileTypeRows = tree.findall('FileTypes/FileType')

		fileTypeRow = next((element for element in fileTypeRows if element.attrib.get('name') == name), None)
		if fileTypeRow is None:
			Logutil.log('Configuration error. FileType %s does not exist in config.xml' %name, util.LOG_LEVEL_ERROR)
			return None, util.localize(32005)
			
		fileType = FileType()
		fileType.name = name

		if 'id' not in fileTypeRow.attrib:
			Logutil.log('Configuration error. FileType %s must have an id' %name, util.LOG_LEVEL_ERROR)
			return None, util.localize(32005)
		fileType.id = fileTypeRow.attrib.get('id')
		
		type = fileTypeRow.find('type')
		if(type != None):
			fileType.type = type.text
			
		parent = fileTypeRow.find('parent')
		if(parent != None):
			fileType.parent = parent.text
			
		return fileType, ''
开发者ID:martyn-harris,项目名称:romcollectionbrowser,代码行数:25,代码来源:config.py


示例5: readFileType

	def readFileType(self, name, tree):
		
		fileTypeRow = None 
		fileTypeRows = tree.findall('FileTypes/FileType')
		for element in fileTypeRows:
			if(element.attrib.get('name') == name):
				fileTypeRow = element
				break
			
		if(fileTypeRow == None):
			Logutil.log('Configuration error. FileType %s does not exist in config.xml' %name, util.LOG_LEVEL_ERROR)
			return None, util.localize(35005)
			
		fileType = FileType()
		fileType.name = name
		
		id = fileTypeRow.attrib.get('id')
		if(id == ''):
			Logutil.log('Configuration error. FileType %s must have an id' %name, util.LOG_LEVEL_ERROR)
			return None, util.localize(35005)
			
		fileType.id = id
		
		type = fileTypeRow.find('type')
		if(type != None):
			fileType.type = type.text
			
		parent = fileTypeRow.find('parent')
		if(parent != None):
			fileType.parent = parent.text
			
		return fileType, ''
开发者ID:RobLoach,项目名称:RetroRig,代码行数:32,代码来源:config.py


示例6: addScraperToSiteList

	def addScraperToSiteList(self, controlId, sites, romCollection):				

		Logutil.log('addScraperToSiteList', util.LOG_LEVEL_INFO)
		
		control = self.getControlById(controlId)
		scraperItem = control.getSelectedItem()
		scraper = scraperItem.getLabel()
		
		if(scraper == util.localize(56004)):
			return sites
		
		#check if this site is already available for current RC
		for site in romCollection.scraperSites:
			if(site.name == scraper):
				sites.append(site)
				return sites
		
		siteRow = None
		siteRows = self.gui.config.tree.findall('Scrapers/Site')
		for element in siteRows:
			if(element.attrib.get('name') == scraper):
				siteRow = element
				break
		
		if(siteRow == None):
			xbmcgui.Dialog().ok(util.localize(35021), util.localize(35022) %scraper)
			return None
		
		site, errorMsg = self.gui.config.readScraper(siteRow, romCollection.name, '', '', True, self.gui.config.tree)
		if(site != None):
			sites.append(site)
			
		return sites
开发者ID:roeiba,项目名称:xbmc,代码行数:33,代码来源:dialogeditromcollection.py


示例7: initXml

	def initXml(self):
		Logutil.log('initXml', util.LOG_LEVEL_INFO)

		if(not self.configFile):
			self.configFile = util.getConfigXmlPath()

		if(not xbmcvfs.exists(self.configFile)):
			Logutil.log('File config.xml does not exist. Place a valid config file here: %s' % self.configFile, util.LOG_LEVEL_ERROR)
			return None, False, util.localize(32003)

		# force utf-8
		tree = ElementTree()
		if sys.version_info >= (2, 7):
			parser = XMLParser(encoding='utf-8')
		else:
			parser = XMLParser()

		tree.parse(self.configFile, parser)
		if(tree == None):
			Logutil.log('Could not read config.xml', util.LOG_LEVEL_ERROR)
			return None, False, util.localize(32004)

		self.tree = tree

		return tree, True, ''
开发者ID:bruny,项目名称:romcollectionbrowser,代码行数:25,代码来源:config.py


示例8: launchXbox

def launchXbox(gui, gdb, cmd, romCollection, filenameRows):
	Logutil.log("launchEmu on xbox", util.LOG_LEVEL_INFO)
	
	#on xbox emucmd must be the path to an executable or cut file
	if (not os.path.isfile(cmd)):
		Logutil.log("Error while launching emu: File %s does not exist!" %cmd, util.LOG_LEVEL_ERROR)
		gui.writeMsg(util.localize(32037) %cmd)
		return
					
	if (romCollection.xboxCreateShortcut):
		Logutil.log("creating cut file", util.LOG_LEVEL_INFO)
		
		cutFile = createXboxCutFile(cmd, filenameRows, romCollection)
		if(cutFile == ""):
			Logutil.log("Error while creating .cut file. Check xbmc.log for details.", util.LOG_LEVEL_ERROR)
			gui.writeMsg(util.localize(32038))
			return
			
		cmd = cutFile
		Logutil.log("cut file created: " +cmd, util.LOG_LEVEL_INFO)			
	
	#RunXbe always terminates XBMC. So we have to write autoexec here	
	writeAutoexec(gdb)
		
	Logutil.log("RunXbe", util.LOG_LEVEL_INFO)
	xbmc.executebuiltin("XBMC.Runxbe(%s)" %cmd)
	Logutil.log("RunXbe done", util.LOG_LEVEL_INFO)
	time.sleep(1000)
开发者ID:martyn-harris,项目名称:romcollectionbrowser,代码行数:28,代码来源:launcher.py


示例9: updateConfig

	def updateConfig(self, gui):
		
		if(not os.path.isfile(self.configFile)):
			return False, util.localize(32003)
		
		
		tree = ElementTree().parse(self.configFile)
		if(tree == None):
			Logutil.log('Could not read config.xml', util.LOG_LEVEL_ERROR)
			return False, util.localize(32004)
		
		self.tree = tree
	
		configVersion = tree.attrib.get('version')
		Logutil.log('Reading config version from config.xml: ' +str(configVersion), util.LOG_LEVEL_INFO)
		if(configVersion == None):
			#set to previous version
			configVersion = '0.7.4'
		
		#nothing to do
		if(configVersion == util.CURRENT_CONFIG_VERSION):
			Logutil.log('Config file is up to date', util.LOG_LEVEL_INFO)
			return True, ''
		
		Logutil.log('Config file is out of date. Start update', util.LOG_LEVEL_INFO)
		
		#backup config.xml
		newFileName = self.configFile +'.backup ' +configVersion
		if not os.path.isfile(newFileName):
			try:
				shutil.copy(str(self.configFile), str(newFileName))
			except Exception, (exc):
				return False, util.localize(32007) +": " +str(exc)
开发者ID:EDUARDO1122,项目名称:Halowrepo,代码行数:33,代码来源:configxmlupdater.py


示例10: checkGameHasSaveStates

def checkGameHasSaveStates(romCollection, gameRow, filenameRows, escapeCmd):
	
	if(romCollection.saveStatePath == ''):
		return ''
		
	rom = filenameRows[0][0]
	saveStatePath = replacePlaceholdersInParams(romCollection.saveStatePath, rom, romCollection, gameRow, escapeCmd)
		
	saveStateFiles = glob.glob(saveStatePath)
	
	stateFile = ''
	if(len(saveStateFiles) == 0):
		return ''
	elif(len(saveStateFiles) >= 1):
		Logutil.log('saveStateFiles found: ' +str(saveStateFiles), util.LOG_LEVEL_INFO)
		
		#don't select savestatefile if ASKNUM is requested in Params
		if(re.search('(?i)%ASKNUM%', romCollection.saveStateParams)):
			return saveStateFiles[0]
				
		options = [util.localize(32165)]
		for file in saveStateFiles:
			options.append(os.path.basename(file))
		selectedFile = xbmcgui.Dialog().select(util.localize(32166), options)
		#If selections is canceled or "Don't launch statefile" option
		if(selectedFile < 1):
			return ''
		else:
			stateFile = saveStateFiles[selectedFile -1]
	
	return stateFile
开发者ID:martyn-harris,项目名称:romcollectionbrowser,代码行数:31,代码来源:launcher.py


示例11: getNames7z

def getNames7z(filepath):
	
	try:
		import py7zlib
	except Exception, (exc):
		xbmcgui.Dialog().ok(util.SCRIPTNAME, util.localize(32039), util.localize(32129))
		Logutil.log("You have tried to launch a .7z file but you are missing required libraries to extract the file. You can download the latest RCB version from RCBs project page. It contains all required libraries.", util.LOG_LEVEL_ERROR)
		Logutil.log("Error: " +str(exc), util.LOG_LEVEL_ERROR)
		return None
开发者ID:martyn-harris,项目名称:romcollectionbrowser,代码行数:9,代码来源:launcher.py


示例12: replacePlaceholdersInParams

def replacePlaceholdersInParams(emuParams, rom, romCollection, gameRow, escapeCmd):
		
	if(escapeCmd):
		rom = re.escape(rom)
		
	#TODO: Wanted to do this with re.sub:
	#emuParams = re.sub(r'(?i)%rom%', rom, emuParams)
	#--> but this also replaces \r \n with linefeed and newline etc.
	
	#full rom path ("C:\Roms\rom.zip")	
	emuParams = emuParams.replace('%rom%', rom) 
	emuParams = emuParams.replace('%ROM%', rom)
	emuParams = emuParams.replace('%Rom%', rom)
	
	#romfile ("rom.zip")
	romfile = os.path.basename(rom)
	emuParams = emuParams.replace('%romfile%', romfile)
	emuParams = emuParams.replace('%ROMFILE%', romfile)
	emuParams = emuParams.replace('%Romfile%', romfile)
	
	#romname ("rom")
	romname = os.path.splitext(os.path.basename(rom))[0]
	emuParams = emuParams.replace('%romname%', romname)
	emuParams = emuParams.replace('%ROMNAME%', romname)
	emuParams = emuParams.replace('%Romname%', romname)
	
	#gamename	
	gamename = unicode(gameRow[util.ROW_NAME])
	emuParams = emuParams.replace('%game%', gamename)
	emuParams = emuParams.replace('%GAME%', gamename)
	emuParams = emuParams.replace('%Game%', gamename)
	
	#ask num
	if(re.search('(?i)%ASKNUM%', emuParams)):
		options = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9']
		number = unicode(xbmcgui.Dialog().select(util.localize(32167), options))
		emuParams = emuParams.replace('%asknum%', number)
		emuParams = emuParams.replace('%ASKNUM%', number)
		emuParams = emuParams.replace('%Asknum%', number)
		
	#ask text
	if(re.search('(?i)%ASKTEXT%', emuParams)):
		
		keyboard = xbmc.Keyboard()
		keyboard.setHeading(util.localize(32168))
		keyboard.doModal()
		command = ''
		if (keyboard.isConfirmed()):
			command = keyboard.getText()
		
		emuParams = emuParams.replace('%asktext%', command)
		emuParams = emuParams.replace('%ASKTEXT%', command)
		emuParams = emuParams.replace('%Asktext%', command)
		
	
	return emuParams
开发者ID:martyn-harris,项目名称:romcollectionbrowser,代码行数:56,代码来源:launcher.py


示例13: getAvailableScrapers

	def getAvailableScrapers(self):
		#Scrapers
		sitesInList = [util.localize(56004), util.localize(40053)]
		#get all scrapers
		scrapers = self.gui.config.tree.findall('Scrapers/Site')
		for scraper in scrapers:
			name = scraper.attrib.get('name')
			if(name != None):
				sitesInList.append(name)
				
		return sitesInList
开发者ID:roeiba,项目名称:xbmc,代码行数:11,代码来源:dialogimportoptions.py


示例14: showGameList

	def showGameList(self):
		
		Logutil.log("Begin showGameList", util.LOG_LEVEL_INFO)
		
		#likeStatement = helper.buildLikeStatement(self.selectedCharacter)
		#games = Game(self.gdb).getFilteredGames(self.selectedConsoleId, self.selectedGenreId, self.selectedYearId, self.selectedPublisherId, likeStatement)				
				
		self.writeMsg(util.localize(40021))
		
		self.clearList()
		
		gameRow = Game(self.gdb).getObjectById(self.selectedGameId)
		
		fileDict = self.getFileDictByGameRow(self.gdb, gameRow)
		
		romCollection = None
		try:
			romCollection = self.config.romCollections[str(gameRow[util.GAME_romCollectionId])]
		except:
			Logutil.log(util.localize(35023) %str(gameRow[util.GAME_romCollectionId]), util.LOG_LEVEL_ERROR)
		
		imageGameList = self.getFileForControl(romCollection.imagePlacingInfo.fileTypesForGameList, gameRow[util.ROW_ID], gameRow[util.GAME_publisherId], gameRow[util.GAME_developerId], gameRow[util.GAME_romCollectionId], fileDict)
		imageGameListSelected = self.getFileForControl(romCollection.imagePlacingInfo.fileTypesForGameListSelected, gameRow[util.ROW_ID], gameRow[util.GAME_publisherId], gameRow[util.GAME_developerId], gameRow[util.GAME_romCollectionId], fileDict)
		
		item = xbmcgui.ListItem(gameRow[util.ROW_NAME], str(gameRow[util.ROW_ID]), imageGameList, imageGameListSelected)
		item.setProperty('gameId', str(gameRow[util.ROW_ID]))
				
		#check if we should use autoplay video
		if(romCollection.autoplayVideoInfo):
			item.setProperty('autoplayvideoinfo', 'true')
		else:
			item.setProperty('autoplayvideoinfo', '')
		
		#get video window size
		if (romCollection.imagePlacingInfo.name.startswith('gameinfosmall')):
			item.setProperty('videosizesmall', 'small')
			item.setProperty('videosizebig', '')
		else:
			item.setProperty('videosizebig', 'big')
			item.setProperty('videosizesmall', '')
						
		videos = helper.getFilesByControl_Cached(self.gdb, (self.fileTypeGameplay,), gameRow[util.ROW_ID], gameRow[util.GAME_publisherId], gameRow[util.GAME_developerId], gameRow[util.GAME_romCollectionId], fileDict)
		if(videos != None and len(videos) != 0):
			video = videos[0]
			item.setProperty('gameplayinfo', video)
		
		self.addItem(item)
				
		xbmc.executebuiltin("Container.SortDirection")
		self.writeMsg("")
		
		Logutil.log("End showGameList", util.LOG_LEVEL_INFO)
开发者ID:roeiba,项目名称:xbmc,代码行数:52,代码来源:dialoggameinfo.py


示例15: getArchives7z

def getArchives7z(filepath, archiveList):
	
	try:
		import py7zlib
	except:
		xbmcgui.Dialog().ok(util.SCRIPTNAME, util.localize(32039), util.localize(32129))
		Logutil.log("You have tried to launch a .7z file but you are missing required libraries to extract the file. You can download the latest RCB version from RCBs project page. It contains all required libraries.", util.LOG_LEVEL_ERROR)
		return None
	
	fp = open(str(filepath), 'rb')
	archive = py7zlib.Archive7z(fp)
	archivesDecompressed =  [(name, archive.getmember(name).read())for name in archiveList]
	fp.close()
	return archivesDecompressed
开发者ID:martyn-harris,项目名称:romcollectionbrowser,代码行数:14,代码来源:launcher.py


示例16: selectScrapersInList

	def selectScrapersInList(self, sitesInRomCollection, sitesInList):
		
		if(len(sitesInRomCollection) >= 1):
			self.selectScraperInList(sitesInList, sitesInRomCollection[0].name, CONTROL_LIST_SCRAPER1)			
		else:
			self.selectScraperInList(sitesInList, util.localize(56004), CONTROL_LIST_SCRAPER1)
		if(len(sitesInRomCollection) >= 2):
			self.selectScraperInList(sitesInList, sitesInRomCollection[1].name, CONTROL_LIST_SCRAPER2)
		else:
			self.selectScraperInList(sitesInList, util.localize(56004), CONTROL_LIST_SCRAPER2)
		if(len(sitesInRomCollection) >= 3):
			self.selectScraperInList(sitesInList, sitesInRomCollection[2].name, CONTROL_LIST_SCRAPER3)
		else:
			self.selectScraperInList(sitesInList, util.localize(56004), CONTROL_LIST_SCRAPER3)
开发者ID:roeiba,项目名称:xbmc,代码行数:14,代码来源:dialogimportoptions.py


示例17: addMediaPath

	def addMediaPath(self):

		mediaTypes = self.gui.config.tree.findall('FileTypes/FileType')

		mediaTypeList = []

		for mediaType in mediaTypes:
			name = mediaType.attrib.get('name')
			if name is not None:
				type = mediaType.find('type')
				if type is not None and type.text == 'video':
					name = name + ' (video)'

				# check if media type is already in use for selected RC
				isMediaTypeInUse = False
				for mediaPath in self.selectedRomCollection.mediaPaths:
					if mediaPath.fileType.name == name:
						isMediaTypeInUse = True

				if not isMediaTypeInUse:
					mediaTypeList.append(name)

		mediaTypeIndex = xbmcgui.Dialog().select(util.localize(32142), mediaTypeList)
		if mediaTypeIndex == -1:
			return

		mediaType = mediaTypeList[mediaTypeIndex]
		mediaType = mediaType.replace(' (video)', '')

		mediaPathComplete = self.editPathWithFileMask(CONTROL_BUTTON_MEDIAPATH, '%s ' % mediaType + util.localize(32141), CONTROL_BUTTON_MEDIAFILEMASK)
		# TODO: use default value in editFilemask
		control = self.getControlById(CONTROL_BUTTON_MEDIAFILEMASK)
		control.setLabel('%GAME%.*')
		mediaPathComplete = self.editFilemask(CONTROL_BUTTON_MEDIAFILEMASK, util.localize(32618), mediaPathComplete)

		mediaPath = MediaPath()
		fileType = FileType()
		fileType.name = mediaType
		mediaPath.fileType = fileType
		mediaPath.path = mediaPathComplete
		self.selectedRomCollection.mediaPaths.append(mediaPath)

		control = self.getControlById(CONTROL_LIST_MEDIATYPES)
		item = xbmcgui.ListItem(mediaType, '', '', '')
		control.addItem(item)

		self.selectItemInList(mediaType, CONTROL_LIST_MEDIATYPES)

		xbmc.sleep(util.WAITTIME_UPDATECONTROLS)
		self.updateMediaPathControls()
开发者ID:bruny,项目名称:romcollectionbrowser,代码行数:50,代码来源:dialogeditromcollection.py


示例18: __replacePlaceholdersInParams

	def __replacePlaceholdersInParams(self, emuParams, rom, gameRow):

		if self.escapeCmd:
			rom = re.escape(rom)

		# TODO: Wanted to do this with re.sub:
		# emuParams = re.sub(r'(?i)%rom%', rom, emuParams)
		# --> but this also replaces \r \n with linefeed and newline etc.

		# full rom path ("C:\Roms\rom.zip")
		emuParams = emuParams.replace('%rom%', rom)
		emuParams = emuParams.replace('%ROM%', rom)
		emuParams = emuParams.replace('%Rom%', rom)

		# romfile ("rom.zip")
		romfile = os.path.basename(rom)
		emuParams = emuParams.replace('%romfile%', romfile)
		emuParams = emuParams.replace('%ROMFILE%', romfile)
		emuParams = emuParams.replace('%Romfile%', romfile)

		# romname ("rom")
		romname = os.path.splitext(os.path.basename(rom))[0]
		emuParams = emuParams.replace('%romname%', romname)
		emuParams = emuParams.replace('%ROMNAME%', romname)
		emuParams = emuParams.replace('%Romname%', romname)

		# gamename
		gamename = unicode(gameRow[util.ROW_NAME])
		emuParams = emuParams.replace('%game%', gamename)
		emuParams = emuParams.replace('%GAME%', gamename)
		emuParams = emuParams.replace('%Game%', gamename)

		# ask num
		if re.search('(?i)%ASKNUM%', emuParams):
			options = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9']
			number = unicode(xbmcgui.Dialog().select(util.localize(32167), options))
			emuParams = emuParams.replace('%asknum%', number)
			emuParams = emuParams.replace('%ASKNUM%', number)
			emuParams = emuParams.replace('%Asknum%', number)

		# ask text
		if re.search('(?i)%ASKTEXT%', emuParams):
			command = xbmcgui.Dialog().input(util.localize(32168), type=xbmcgui.INPUT_ALPHANUM)

			emuParams = emuParams.replace('%asktext%', command)
			emuParams = emuParams.replace('%ASKTEXT%', command)
			emuParams = emuParams.replace('%Asktext%', command)

		return emuParams
开发者ID:bruny,项目名称:romcollectionbrowser,代码行数:49,代码来源:launcher.py


示例19: onClick

	def onClick(self, controlID):
		
		Logutil.log('onClick', util.LOG_LEVEL_INFO)
		
		if (controlID == CONTROL_BUTTON_EXIT): # Close window button
			Logutil.log('close', util.LOG_LEVEL_INFO)
			self.close()
		#OK
		elif (controlID == CONTROL_BUTTON_SAVE):
			Logutil.log('save', util.LOG_LEVEL_INFO)
			#store selectedRomCollection
			if(self.selectedRomCollection != None):
				#Code to Remove Roms
				Logutil.log('Removing Roms', util.LOG_LEVEL_INFO)
				self.setDeleteStatus(True)
				#Code to Remove Collection
				if(self.romDelete == 'RCollection'):
					self.setRCDeleteStatus(True)
					Logutil.log('Removing Rom Collection', util.LOG_LEVEL_INFO)
					configWriterRCDel = ConfigXmlWriter(False)
					RCName = str(self.selectedRomCollection.name)
					success, message = configWriterRCDel.removeRomCollection(RCName)
					if(success == False):
						Logutil.log(message, util.LOG_LEVEL_ERROR)
						xbmcgui.Dialog().ok(util.localize(35019), util.localize(35020))
			Logutil.log('Click Close', util.LOG_LEVEL_INFO)
			self.close()
		#Cancel
		elif (controlID == CONTROL_BUTTON_CANCEL):
			self.close()
		#Rom Collection list
		elif(self.selectedControlId in (CONTROL_BUTTON_RC_DOWN, CONTROL_BUTTON_RC_UP)):						
						
			if(self.selectedRomCollection != None):
				
				#store previous selectedRomCollections state
				self.romCollections[self.selectedRomCollection.id] = self.selectedRomCollection
			
			#HACK: add a little wait time as XBMC needs some ms to execute the MoveUp/MoveDown actions from the skin
			xbmc.sleep(util.WAITTIME_UPDATECONTROLS)
			self.updateControls()
		elif(self.selectedControlId in (CONTROL_BUTTON_DEL_DOWN, CONTROL_BUTTON_DEL_UP)):
			#Check for Remove Roms or Roms and Rom Collection
			control = self.getControlById(CONTROL_LIST_DELETEOPTIONS)
			selectedDeleteOption = str(control.getSelectedItem().getLabel())
			if(selectedDeleteOption == util.localize(40038)):
				self.romDelete = 'Roms'
			else:
				self.romDelete = 'RCollection'
开发者ID:RobLoach,项目名称:RetroRig,代码行数:49,代码来源:dialogdeleteromcollection.py


示例20: onInit

	def onInit(self):
		Logutil.log('onInit Remove Rom Collection', util.LOG_LEVEL_INFO)
		
		#Rom Collections
		Logutil.log('build rom collection list', util.LOG_LEVEL_INFO)
		romCollectionList = []
		for rcId in self.romCollections.keys():
			romCollection = self.romCollections[rcId]
			romCollectionList.append(romCollection.name)
		self.addItemsToList(CONTROL_LIST_ROMCOLLECTIONS, romCollectionList)
		
		#Delete Options
		rcDeleteOptions = [util.localize(32137),util.localize(32138)]
		self.addItemsToList(CONTROL_LIST_DELETEOPTIONS, rcDeleteOptions, properties=['RCollection', 'Roms'])
		self.updateControls()
开发者ID:EDUARDO1122,项目名称:Halowrepo,代码行数:15,代码来源:dialogdeleteromcollection.py



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Python util.localpath函数代码示例发布时间:2022-05-26
下一篇:
Python util.load_image函数代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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