本文整理汇总了Python中utils.getString函数的典型用法代码示例。如果您正苦于以下问题:Python getString函数的具体用法?Python getString怎么用?Python getString使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了getString函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: erase
def erase(self):
self.showOnly(self.style + ERASE)
#Not implemented yet
#if self.flirc.version > 1:
# self.getControl(self.style + ERASE_STOP + 1000).setVisible(True)
self.freeRemote()
self.timerOff()
self.lockInfobox = True
self.setInfoBox(utils.getString(self.style + ERASE_STOP))
response = self.flirc.erase()
self.timerOn()
self.setInfoBox(utils.getString(response))
self.sleep(INFOSECS) #1 second
self.showAll()
self.getControl(self.style + ERASE_STOP + 1000).setVisible(False)
self.lockInfobox = False
self._setFocus(self.style + ERASE)
示例2: extract
def extract(self,zipFile,outLoc,progressBar):
utils.log("extracting zip archive")
result = True #result is true unless we fail
#update the progress bar
progressBar.updateProgress(0,utils.getString(30100))
#list the files
fileCount = float(len(zipFile.listFiles()))
currentFile = 0
try:
for aFile in zipFile.listFiles():
#update the progress bar
currentFile += 1
progressBar.updateProgress(int((currentFile/fileCount) * 100),utils.getString(30100))
#extract the file
zipFile.extract(aFile,outLoc)
except Exception,e:
print str(e)
utils.log("Error extracting file", xbmc.LOGDEBUG)
result = False
示例3: run
def run(self):
#check if there is even a file playing
if(self.localPlayer.isPlaying()):
#figure out what xbmc to send to
selected_xbmc = xbmcgui.Dialog().select(utils.getString(30036),self.host_manager.listHosts())
if(selected_xbmc != -1):
#create a local host
local_host = XbmcHost("Local","127.0.0.1","8080")
#get the address of the host
remote_host = self.host_manager.getHost(selected_xbmc)
#check if the remote player is currently playing something
remote_player = remote_host.isPlaying()
if(remote_player >= 0 and utils.getSetting("override_destination") == 'true'):
#we need to stop the player before sending the new file
remote_host.stop()
self.sendTo(local_host,remote_host)
elif(remote_player >= 0 and utils.getSetting("override_destination") == "false"):
#we can't stop the player, notify the user
xbmcgui.Dialog().ok("SendTo",remote_host.name + " " + utils.getString(30039),utils.getString(30037))
elif(remote_player == -2):
#catch for if the player is off
xbmcgui.Dialog().ok("SendTo",remote_host.name + " " + utils.getString(30040),utils.getString(30038))
else:
#not playing anything, send as normal
self.sendTo(local_host,remote_host)
示例4: _checkValidationFile
def _checkValidationFile(self,path):
result = False
#copy the file and open it
self.xbmc_vfs.put(path + "xbmcbackup.val",xbmc.translatePath(utils.data_dir() + "xbmcbackup_restore.val"))
vFile = xbmcvfs.File(xbmc.translatePath(utils.data_dir() + "xbmcbackup_restore.val"),'r')
jsonString = vFile.read()
vFile.close()
#delete after checking
xbmcvfs.delete(xbmc.translatePath(utils.data_dir() + "xbmcbackup_restore.val"))
try:
json_dict = json.loads(jsonString)
if(xbmc.getInfoLabel('System.BuildVersion') == json_dict['xbmc_version']):
result = True
else:
result = xbmcgui.Dialog().yesno(utils.getString(30085),utils.getString(30086),utils.getString(30044))
except ValueError:
#may fail on older archives
result = True
return result
示例5: startRecording
def startRecording(self, controlId):
#utils.log("******************* startRecording *******************")
#utils.log(controlId)
self.currentButton = controlId
if self.currentButton == 0:
return
self.lockInfobox = True
self.showOnly(self.currentButton)
cmd = utils.getRecordCommandString(controlId)
text = utils.getString(utils.RECORD_TEXT) % utils.getString(controlId).lower()
self.setInfoBox(text)
response = self.flirc.recordKey(cmd)
self.setInfoBox(utils.getString(response))
ret = True
if response == utils.RECORD_OK:
self.sleep(INFOSECS) #1 second
else:
self.sleep(2*INFOSECS) #2 seconds
ret = False
#self._setFocus(controlId)
self.lockInfobox = False
return ret
示例6: __init__
def __init__(self,rootString):
self.set_root(rootString)
authorizer = DropboxAuthorizer()
if(authorizer.isAuthorized()):
self.client = authorizer.getClient()
else:
#tell the user to go back and run the authorizer
xbmcgui.Dialog().ok(utils.getString(30010),utils.getString(30105))
sys.exit()
示例7: format
def format(self):
#utils.log("******************* format *******************")
if not utils.yesno(1, 7, 0, 8):
self.setInfoBox(utils.getString(4))
return
self.timerOff()
self.setInfoBox(utils.getString(9))
self.sleep(INFOSECS) #1 second
response = self.flirc.format()
self.timerOn()
self.setInfoBox(utils.getString(response))
self.sleep(INFOSECS) #1 second
示例8: loadConfig
def loadConfig(self):
utils.log("******************* load *******************")
filename = utils.fileBrowse(14, 'fcfg')
if not filename:
return
self.timerOff()
self.setInfoBox(utils.getString(15))
self.sleep(INFOSECS) #1 second
response = self.flirc.loadConfig(filename)
self.timerOn()
self.setInfoBox(utils.getString(response))
self.sleep(INFOSECS) #1 second
示例9: upgradeFW
def upgradeFW(self):
utils.log("******************* upgrade *******************")
filename = utils.fileBrowse(10, 'bin')
if not filename:
return
self.timerOff()
self.setInfoBox(utils.getString(11))
self.sleep(INFOSECS) #1 second
response = self.flirc.upgradeFW(filename)
self.timerOn()
self.setInfoBox(utils.getString(response))
self.sleep(INFOSECS) #1 second
示例10: saveConfig
def saveConfig(self):
utils.log("******************* save *******************")
folder = utils.folderBrowse(12)
filename = 'my_flirc_config.fcfg'
filename = os.path.join(folder, filename)
self.timerOff()
self.setInfoBox(utils.getString(13))
self.sleep(INFOSECS) #1 second
response = self.flirc.saveConfig(filename)
self.timerOn()
self.setInfoBox(utils.getString(response))
self.sleep(INFOSECS) #1 second
示例11: doAutoMode
def doAutoMode(self):
self.showAll()
failed = False
self.autoModeOn = True
self.timerOff()
#self.flirc.format()
for i in range(self.buttonMin+10, self.buttonMax+1): #+10 ignore 'Functional' Buttons
if not self._onClick(i):
failed = True
break
self.timerOn()
self.autoModeOn = False
self.getControl(self.style + GO_STOP + 1000).setVisible(False)
self.showAll()
self.currentButton = 0
self.loseFocus()
if failed:
return
utils.setSetting('autoStart', 'false')
self.lockInfobox = True
self._setFocus(self.style + GO)
self.lockInfobox = False
self.setInfoBox(utils.getString(utils.AUTO_OK))
self.sleep(10*INFOSECS)
示例12: sendTo
def sendTo(self,local_host,remote_host,reverse=False):
#get the player/playlist id
playerid = str(local_host.isPlaying())
#get the percentage played and position
player_props = local_host.playingProperties(playerid)
#check if the player is currently paused
if(player_props['speed'] != 0):
#pause the playing file
self.pausePlayback(local_host)
#if reverse these checks don't matter
keep_playing = True
if(not reverse):
#check if we should prompt to keep playback paused
if(utils.getSetting("pause_prompt") == "true"):
keep_playing = not xbmcgui.Dialog().yesno(utils.getString(30000),utils.getString(30041))
#get a list of all items in the playlist
playlist = local_host.getPlaylist(playerid)
#add these files to the other playlist
remote_host.addItems(playlist,playerid)
#play remote playlist
remote_host.playPosition(str(player_props['position']),playerid)
#pause the player
self.pausePlayback(remote_host)
#seek to the correct spot
remote_host.seekFile(player_props['percentage'],playerid)
if(utils.getSetting('continue_host_on_transfer') == 'false'):
#stop the current player
local_host.stop(playerid)
local_host.executeJSON('Playlist.Clear','{"playlistid": ' + playerid + '}')
else:
#continue playing
self.pausePlayback(local_host)
if(keep_playing):
#unpause
self.pausePlayback(remote_host)
示例13: restoreFiles
def restoreFiles(self):
self.fileManager.createFileList()
utils.log(utils.getString(30051))
allFiles = self.fileManager.getFileList()
#write list from remote to local
self.writeFiles(allFiles,self.remote_path,self.local_path)
#call update addons to refresh everything
xbmc.executebuiltin('UpdateLocalAddons')
示例14: onFocus
def onFocus(self, controlId):
#updates text in the infobox for the current focused key
if self.lockInfobox:
return
if controlId > self.buttonMax:
controlId -= 1000
if controlId == SWITCH:
controlId += self.style
self.setInfoBox(utils.getString(controlId))
示例15: syncFiles
def syncFiles(self):
#make the remote directory
vfs.mkdir(self.remote_path)
utils.log(utils.getString(30051))
self.fileManager.createFileList()
allFiles = self.fileManager.getFileList()
#write list from local to remote
self.writeFiles(allFiles,self.local_path,self.remote_path)