本文整理汇总了Python中xbmc.getLocalizedString函数的典型用法代码示例。如果您正苦于以下问题:Python getLocalizedString函数的具体用法?Python getLocalizedString怎么用?Python getLocalizedString使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了getLocalizedString函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: renameItem
def renameItem(self):
position = self.getCurrentListPosition()
itemInfos = self.fullInfos.get(position)
if not itemInfos: return
url = itemInfos.get('url')
#title = itemInfos.get('title')
keyboard = xbmc.Keyboard(os.path.basename(url), xbmc.getLocalizedString(16013))
keyboard.doModal()
if keyboard.isConfirmed():
new = keyboard.getText()
try:
self.fullInfos[position]['url'] = url.replace(os.path.basename(url), new)
self.fullInfos[position]['title'] = new
os.rename(url, url.replace(os.path.basename(url), new))
try:
cover = url.replace('.mp3', '.tbn').replace('.MP3', '.tbn')
newcovername = cover.replace(os.path.basename(cover), new.replace('.mp3', '.tbn').replace('.MP3', '.tbn'))
os.rename(cover, newcovername)
self.fullInfos[position]['ico'] = newcovername
self.fullInfos[position]['icoBig'] = newcovername
except: printLastError(False)
except:
xbmcgui.Dialog().ok(xbmc.getLocalizedString(257), __language__(27), __language__(26), __language__(28))
printLastError(False)
else:
self.addItemsInControlList()
self.setCurrentListPosition(position)
开发者ID:Quihico,项目名称:passion-xbmc,代码行数:27,代码来源:default.py
示例2: listchannels
def listchannels(params, url, category):
xbmc.output("[channelselector.py] listchannels")
# Verifica actualizaciones solo en el primer nivel
if xbmcplugin.getSetting("updatecheck2") == "true":
xbmc.output("updatecheck2=true")
import updater
updater.checkforupdates()
else:
xbmc.output("updatecheck2=false")
CHANNELNAME = "kideoschannel"
xbmctools.addnewfolder(CHANNELNAME, "ageslist", CHANNELNAME, xbmc.getLocalizedString(30501), "", "", "")
xbmctools.addnewfolder(CHANNELNAME, "categorylist", CHANNELNAME, xbmc.getLocalizedString(30502), "", "", "")
xbmctools.addnewfolder(CHANNELNAME, "userlist", CHANNELNAME, xbmc.getLocalizedString(30503), "", "", "")
xbmctools.addnewfolder("configuracion", "mainlist", "configuracion", xbmc.getLocalizedString(30504), "", "", "")
xbmctools.addnewfolder("descargados", "mainlist", "descargados", xbmc.getLocalizedString(30505), "", "", "")
# Label (top-right)...
xbmcplugin.setPluginCategory(handle=int(sys.argv[1]), category="Canales")
# Disable sorting...
xbmcplugin.addSortMethod(handle=int(sys.argv[1]), sortMethod=xbmcplugin.SORT_METHOD_NONE)
# End of directory...
xbmcplugin.endOfDirectory(handle=int(sys.argv[1]), succeeded=True)
开发者ID:hmemar,项目名称:xbmc-tvalacarta,代码行数:27,代码来源:channelselector.py
示例3: main
def main(self, action_param=None):
'''show the NextAired dialog'''
weekday = self.date.weekday()
self.win.setProperty("NextAired.TodayText", xbmc.getLocalizedString(33006))
self.win.setProperty("NextAired.TomorrowText", xbmc.getLocalizedString(33007))
self.win.setProperty("NextAired.YesterdayText", self.addon.getLocalizedString(32018))
self.win.setProperty("NextAired.TodayDate", self.str_date(self.date, 'DropYear'))
self.win.setProperty("NextAired.TomorrowDate", self.str_date(self.tomorrow, 'DropThisYear'))
self.win.setProperty("NextAired.YesterdayDate", self.str_date(self.yesterday, 'DropThisYear'))
for count in range(0, 7):
wdate = self.date
if count != weekday:
wdate += timedelta(days=(count - weekday + 7) % 7)
self.win.setProperty("NextAired.%d.Date" % (count + 1), self.str_date(wdate, 'DropThisYear'))
from next_aired_dialog import NextAiredDialog
today_style = self.addon.getSetting("TodayStyle") == 'true'
scan_days = int(self.addon.getSetting("ScanDays2" if today_style else "ScanDays"))
want_yesterday = self.addon.getSetting("WantYesterday") == 'true'
eps_list = self.get_nextaired_listing(include_last_episode=want_yesterday)
xml = "script-NextAired-TVGuide%s.xml" % (2 if today_style else "")
xml_path = self.addon.getAddonInfo('path').decode('utf-8')
dialog = NextAiredDialog(
xml,
xml_path,
"Default",
listing=eps_list,
nice_date=self.nice_date,
scan_days=scan_days,
today_style=today_style,
want_yesterday=want_yesterday)
dialog.doModal()
del dialog
开发者ID:marcelveldt,项目名称:script.tv.show.next.aired,代码行数:32,代码来源:main_module.py
示例4: pickFileSystem
def pickFileSystem():
availableFS = ["FAT32", "ext4", "ext3", "ext2", "NTFS", xbmc.getLocalizedString(222)]; # Cancel
selected = xbmcgui.Dialog().select(addon.getLocalizedString(50025), availableFS); # Select file system:
fileSystem = availableFS[selected];
if fileSystem == xbmc.getLocalizedString(222): # Cancel
return None;
return fileSystem;
开发者ID:earthlyreaper,项目名称:unofficial-addons,代码行数:7,代码来源:default.py
示例5: linkList
def linkList(movieid):
(moviedetails, moviecount) = db.runSQL(SQL.SINGLE_MOVIE % movieid, True)
(results, totalcount) = db.runSQL(SQL.MOVIE_LINKS % movieid)
u=sys.argv[0]+ \
"?mode="+str(PLAY_ALL_LINKS)+ \
"&movieid="+str(movieid)
print "U: " + u
l = xbmcgui.ListItem(xbmc.getLocalizedString(30061),
iconImage='DefaultFolder.png',
thumbnailImage=fixUrl(moviedetails["FrontCover"]))
l.setInfo(type="Video", infoLabels={
"TVShowTitle": moviedetails["Title"],
"Title": xbmc.getLocalizedString(30061),
"Plot": fixHtml(moviedetails["Plot"])})
xbmcplugin.addDirectoryItem(int(sys.argv[1]), u, l, False)
for link in results:
l = xbmcgui.ListItem(link["Description"],
iconImage="DefaultFolder.png",
thumbnailImage=fixUrl(moviedetails["FrontCover"]))
l.setInfo(type="Video", infoLabels={
"TVShowTitle": moviedetails["Title"],
"Title": link["Description"],
"Plot": fixHtml(moviedetails["Plot"])})
print "Adding link: " + link["URL"]
xbmcplugin.addDirectoryItem(int(sys.argv[1]), fixUrl(link["URL"]), l, False, totalcount)
开发者ID:drrlramsey,项目名称:xbmc-addons,代码行数:27,代码来源:default.py
示例6: _get_strings
def _get_strings( self ):
self.localized_string = {}
self.localized_string[ 30900 ] = xbmc.getLocalizedString( 30900 )
self.localized_string[ 30901 ] = xbmc.getLocalizedString( 30901 )
self.localized_string[ 30902 ] = xbmc.getLocalizedString( 30902 )
self.localized_string[ 30903 ] = xbmc.getLocalizedString( 30903 )
self.localized_string[ 30905 ] = xbmc.getLocalizedString( 30905 )
开发者ID:drrlramsey,项目名称:xbmc-addons,代码行数:7,代码来源:xbmcplugin_videos.py
示例7: _get_files
def _get_files( self, asset_files ):
""" fetch the files """
try:
finished_path = ""
for cnt, url in enumerate( asset_files ):
items = os.path.split( url )
# TODO: Change this to U: for other than xbox
drive = xbmc.translatePath( ( "U:\\%s" % self.args.install, "Q:\\%s" % self.args.install, )[ os.environ.get( "OS", "xbox" ) == "xbox" ] )
path = os.path.join( drive, os.path.sep.join( items[ 0 ].split( "/" )[ self.args.ioffset : ] ).replace( "%20", " " ) )
if ( not finished_path ): finished_path = path
file = items[ 1 ].replace( "%20", " " )
pct = int( ( float( cnt ) / len( asset_files ) ) * 100 )
self.dialog.update( pct, "%s %s" % ( xbmc.getLocalizedString( 30005 ), url, ), "%s %s" % ( xbmc.getLocalizedString( 30006 ), path, ), "%s %s" % ( xbmc.getLocalizedString( 30007 ), file, ) )
if ( self.dialog.iscanceled() ): raise
if ( not os.path.isdir( path ) ): os.makedirs( path )
url = self.REPO_URL + url
fpath = os.path.join( path, file )
urllib.urlretrieve( url.replace( " ", "%20" ), fpath )
except:
# oops print error message
print "ERROR: %s::%s (%d) - %s" % ( self.__class__.__name__, sys.exc_info()[ 2 ].tb_frame.f_code.co_name, sys.exc_info()[ 2 ].tb_lineno, sys.exc_info()[ 1 ], )
raise
else:
self.dialog.close()
xbmcgui.Dialog().ok( self.title, xbmc.getLocalizedString( 30008 ), finished_path )
开发者ID:derobert,项目名称:debianlink-xbmc-mediastream,代码行数:25,代码来源:xbmcplugin_downloader.py
示例8: set_list_control
def set_list_control(self):
'''select correct list (3=small, 6=big with icons)'''
# set list id 6 if available for rich dialog
if self.richlayout:
self.list_control = self.getControl(6)
self.getControl(3).setVisible(False)
else:
self.list_control = self.getControl(3)
self.getControl(6).setVisible(False)
self.list_control.setEnabled(True)
self.list_control.setVisible(True)
# enable cancel button
self.set_cancel_button()
# show get more button
if self.getmorebutton:
util.debug("[SC] dialog 1")
self.getControl(5).setVisible(True)
self.getControl(5).setLabel(xbmc.getLocalizedString(21452))
elif not self.multiselect:
util.debug("[SC] dialog 2")
self.getControl(5).setLabel(xbmc.getLocalizedString(186))
self.getControl(5).setVisible(True)
else:
util.debug("[SC] dialog 3")
self.getControl(5).setVisible(True)
self.getControl(5).setEnabled(True)
开发者ID:milokmet,项目名称:plugin.video.stream-cinema,代码行数:30,代码来源:dialogselect.py
示例9: ShowManageDialog
def ShowManageDialog(self):
manage_list = []
listitems = []
tvshow_dbid = str(self.tvshow["general"].get("DBID", ""))
title = self.tvshow["general"].get("TVShowTitle", "")
# imdb_id = str(self.tvshow["general"].get("imdb_id", ""))
# filename = self.tvshow["general"].get("FilenameAndPath", False)
if tvshow_dbid:
temp_list = [[xbmc.getLocalizedString(413), "RunScript(script.artwork.downloader,mode=gui,mediatype=tv,dbid=" + tvshow_dbid + ")"],
[xbmc.getLocalizedString(14061), "RunScript(script.artwork.downloader, mediatype=tv, dbid=" + tvshow_dbid + ")"],
[addon.getLocalizedString(32101), "RunScript(script.artwork.downloader,mode=custom,mediatype=tv,dbid=" + tvshow_dbid + ",extrathumbs)"],
[addon.getLocalizedString(32100), "RunScript(script.artwork.downloader,mode=custom,mediatype=tv,dbid=" + tvshow_dbid + ")"]]
manage_list += temp_list
else:
manage_list += [[addon.getLocalizedString(32166), "RunScript(special://home/addons/plugin.program.sickbeard/resources/lib/addshow.py," + title + ")"]]
# if xbmc.getCondVisibility("system.hasaddon(script.tvtunes)") and tvshow_dbid:
# manage_list.append([addon.getLocalizedString(32102), "RunScript(script.tvtunes,mode=solo&tvpath=$ESCINFO[Window.Property(movie.FilenameAndPath)]&tvname=$INFO[Window.Property(movie.TVShowTitle)])"])
if xbmc.getCondVisibility("system.hasaddon(script.libraryeditor)") and tvshow_dbid:
manage_list.append([addon.getLocalizedString(32103), "RunScript(script.libraryeditor,DBID=" + tvshow_dbid + ")"])
manage_list.append([xbmc.getLocalizedString(1049), "Addon.OpenSettings(script.extendedinfo)"])
for item in manage_list:
listitems.append(item[0])
selection = xbmcgui.Dialog().select(addon.getLocalizedString(32133), listitems)
if selection > -1:
builtin_list = manage_list[selection][1].split("||")
for item in builtin_list:
xbmc.executebuiltin(item)
开发者ID:eztv,项目名称:script.extendedinfo,代码行数:27,代码来源:DialogTVShowInfo.py
示例10: translateOrderBy
def translateOrderBy( self, rule ):
# Load the rules
tree = self._load_rules()
hasValue = True
if rule[ 0 ] == "sorttitle":
rule[ 0 ] = "title"
if rule[ 0 ] != "random":
# Get the field we're ordering by
elems = tree.getroot().find( "matches" ).findall( "match" )
for elem in elems:
if elem.attrib.get( "name" ) == rule[ 0 ]:
match = xbmc.getLocalizedString( int( elem.find( "label" ).text ) )
else:
# We'll manually set for random
match = xbmc.getLocalizedString( 590 )
# Get localization of direction
direction = None
elems = tree.getroot().find( "orderby" ).findall( "type" )
for elem in elems:
if elem.text == rule[ 1 ]:
direction = xbmc.getLocalizedString( int( elem.attrib.get( "label" ) ) )
directionVal = rule[ 1 ]
if direction is None:
direction = xbmc.getLocalizedString( int( tree.getroot().find( "orderby" ).find( "type" ).attrib.get( "label" ) ) )
directionVal = tree.getroot().find( "orderby" ).find( "type" ).text
return [ [ match, rule[ 0 ] ], [ direction, directionVal ] ]
开发者ID:Ignoble61,项目名称:plugin.library.node.editor,代码行数:26,代码来源:orderby.py
示例11: _map_series_data
def _map_series_data(self, showdetails):
'''maps the tvdb data to more kodi compatible format'''
result = {}
if showdetails:
result["title"] = showdetails["seriesName"]
result["status"] = showdetails["status"]
result["tvdb_status"] = showdetails["status"]
result["tvdb_id"] = showdetails["id"]
result["network"] = showdetails["network"]
result["studio"] = [showdetails["network"]]
local_airday, local_airday_short, airday_int = self._get_local_weekday(showdetails["airsDayOfWeek"])
result["airday"] = local_airday
result["airday.short"] = local_airday_short
result["airday.int"] = airday_int
result["airtime"] = self._get_local_time(showdetails["airsTime"])
result["airdaytime"] = "%s %s (%s)" % (result["airday"], result["airtime"], result["network"])
result["airdaytime.short"] = "%s %s" % (result["airday.short"], result["airtime"])
result["airdaytime.label"] = "%s %s - %s %s" % (result["airday"],
result["airtime"],
xbmc.getLocalizedString(145),
result["network"])
result["airdaytime.label.short"] = "%s %s - %s %s" % (
result["airday.short"],
result["airtime"],
xbmc.getLocalizedString(145),
result["network"])
result["votes"] = showdetails["siteRatingCount"]
result["rating.tvdb"] = showdetails["siteRating"]
# make sure we have a decimal in the rating
if len(str(result["rating.tvdb"])) == 1:
result["rating.tvdb"] = "%s.0" % result["rating.tvdb"]
result["rating"] = result["rating.tvdb"]
result["votes.tvdb"] = showdetails["siteRatingCount"]
try:
result["runtime"] = int(showdetails["runtime"]) * 60
except Exception:
pass
result["plot"] = showdetails["overview"]
result["genre"] = showdetails["genre"]
classification = CLASSIFICATION_REGEX.search("/".join(showdetails["genre"])) if isinstance(showdetails["genre"], list) else None
result["classification"] = classification.group(1) if classification else 'Scripted'
result["firstaired"] = showdetails["firstAired"]
result["imdbnumber"] = showdetails["imdbId"]
# artwork
result["art"] = {}
fanarts = self.get_series_fanarts(showdetails["id"])
if fanarts:
result["art"]["fanart"] = fanarts[0]
result["art"]["fanarts"] = fanarts
landscapes = self.get_series_fanarts(showdetails["id"], True)
if landscapes:
result["art"]["landscapes"] = landscapes
result["art"]["landscape"] = landscapes[0]
posters = self.get_series_posters(showdetails["id"])
if posters:
result["art"]["posters"] = posters
result["art"]["poster"] = posters[0]
if showdetails.get("banner"):
result["art"]["banner"] = "https://thetvdb.com/banners/" + showdetails["banner"]
return result
开发者ID:marcelveldt,项目名称:script.module.thetvdb,代码行数:60,代码来源:thetvdb.py
示例12: authenticate
def authenticate( self ):
# request a frob
frob = self.flickr_auth_getfrob()
# if successful finish authenticating
if ( frob[ "stat" ] == "ok" ):
# create our params dictionary
params = { "api_key": self.api_key, "perms": "delete", "frob": frob[ "frob" ][ "_content" ] }
# add api_sig to our params dictionary
params[ "api_sig" ] = self._signature( params )
# create our url
url = u"%s?%s" % ( self.BASE_URL_AUTH, urllib.urlencode( params ), )
# we handle xboix differnetly
if ( os.environ.get( "OS", "n/a" ) == "xbox" ):
print "XBMC Flicker authorization url: %s" % ( url, )
ok = xbmcgui.Dialog().yesno( xbmc.getLocalizedString( 30907 ), xbmc.getLocalizedString( 30915 ), "", "", xbmc.getLocalizedString( 30913 ), xbmc.getLocalizedString( 30914 ) )
elif ( os.environ.get( "OS", "n/a" ) == "OS X" ):
# osx needs special handling
os.system( "open \"%s\"" % ( url, ) )
else:
# open our webbrowser for user authentication
import webbrowser
webbrowser.open( url )
# get response from user
if ( DEBUG ):
ok = raw_input( "Have you authenticated this application? (Y/N): " )
else:
ok = xbmcgui.Dialog().yesno( xbmc.getLocalizedString( 30907 ), xbmc.getLocalizedString( 30912 ), "", "", xbmc.getLocalizedString( 30913 ), xbmc.getLocalizedString( 30914 ) )
# return token
if ( ok ):
# get token
authtoken = self.flickr_auth_getToken( frob=frob[ "frob" ][ "_content" ] )
# if successful return token
if ( authtoken[ "stat" ] == "ok" ):
return authtoken[ "auth" ][ "token" ][ "_content" ]
return ""
开发者ID:nuka1195,项目名称:plugin.image.flickr,代码行数:35,代码来源:FlickrClient.py
示例13: onClick
def onClick(self, controlID):
if controlID == 7:
if self.destinationTBN and self.img != DEFAULTAUDIOBIG:
import shutil
try:
shutil.copy(self.img, self.destinationTBN)
xbmcgui.Dialog().ok(__language__(120), self.destinationTBN)
except:
printLastError(False)
xbmcgui.Dialog().ok(__language__(106), __language__(121))
else: self.newTBN = self.destinationTBN
del shutil
elif controlID == 8:
album = self.tagsmp3.get('album', self.albumname.replace('.mp3', '').replace('.MP3', ''))
keyboard = xbmc.Keyboard(album, xbmc.getLocalizedString(16011))
keyboard.doModal()
if keyboard.isConfirmed():
albumsearch = keyboard.getText()
artist = self.tagsmp3.get('artist', self.albumname.replace('.mp3', '').replace('.MP3', ''))
keyboard = xbmc.Keyboard(artist, xbmc.getLocalizedString(16025))
keyboard.doModal()
if keyboard.isConfirmed():
artistsearch = keyboard.getText()
if not albumsearch == artistsearch: manuelsearch = '%s - %s' % (albumsearch, artistsearch)
else: manuelsearch = albumsearch
self.img, self.text = exechttpapi.requestOnAllMusic_Com(manuelsearch)
if not self.text == self.img: self.setupControls()
开发者ID:Quihico,项目名称:passion-xbmc,代码行数:27,代码来源:default.py
示例14: _download_item
def _download_item( self, forceInstall=False ):
log("> _download_item() forceInstall=%s" % forceInstall)
try:
if ( forceInstall or xbmcgui.Dialog().yesno( self.title, xbmc.getLocalizedString( 30000 ), "", "", xbmc.getLocalizedString( 30020 ), xbmc.getLocalizedString( 30021 ) ) ):
self.dialog.create( self.title, xbmc.getLocalizedString( 30002 ), xbmc.getLocalizedString( 30003 ) )
asset_files = []
folders = [ self.args.download_url.replace( " ", "%20" ) ]
while folders:
try:
htmlsource = readURL( self.REPO_URL + folders[ 0 ] )
if ( not htmlsource ): raise
items = self._parse_html_source( htmlsource )
if ( not items or items[ "status" ] == "fail" ): raise
files, dirs = self._parse_items( items )
for file in files:
asset_files.append( "%s/%s" % ( items[ "url" ], file, ) )
for folder in dirs:
folders.append( folders[ 0 ] + folder )
folders = folders[ 1 : ]
except:
folders = []
finished_path = self._get_files( asset_files )
self.dialog.close()
if finished_path and not forceInstall:
xbmcgui.Dialog().ok( self.title, xbmc.getLocalizedString( 30008 ), finished_path )
# force list refresh
# xbmc.executebuiltin('Container.Refresh')
except:
# oops print error message
print "ERROR: %s::%s (%d) - %s" % ( self.__class__.__name__, sys.exc_info()[ 2 ].tb_frame.f_code.co_name, sys.exc_info()[ 2 ].tb_lineno, sys.exc_info()[ 1 ], )
self.dialog.close()
xbmcgui.Dialog().ok( self.title, xbmc.getLocalizedString( 30030 ) )
log("< _download_item()")
开发者ID:drrlramsey,项目名称:xbmc-addons,代码行数:34,代码来源:xbmcplugin_downloader.py
示例15: onAction
def onAction(self, act):
action = act.getId()
if action in ACTION_PREVIOUS_MENU:
if self.showingList == False:
self.cancelChan()
self.hideChanDetails()
else:
if self.madeChanges == 1:
dlg = xbmcgui.Dialog()
if dlg.yesno(xbmc.getLocalizedString(190), LANGUAGE(30032)):
ADDON_SETTINGS.writeSettings()
if CHANNEL_SHARING:
realloc = ADDON.getSetting('SettingsFolder')
FileAccess.copy(SETTINGS_LOC + '/settings2.xml', realloc + '/settings2.xml')
self.close()
elif act.getButtonCode() == 61575: # Delete button
curchan = self.listcontrol.getSelectedPosition() + 1
if( (self.showingList == True) and (ADDON_SETTINGS.getSetting("Channel_" + str(curchan) + "_type") != "9999") ):
dlg = xbmcgui.Dialog()
if dlg.yesno(xbmc.getLocalizedString(190), LANGUAGE(30033)):
ADDON_SETTINGS.setSetting("Channel_" + str(curchan) + "_type", "9999")
self.updateListing(curchan)
self.madeChanges = 1
开发者ID:rafaelvieiras,项目名称:script.pseudotv,代码行数:29,代码来源:Config.py
示例16: playRTMP
def playRTMP():
vid=re.compile('id=(\d+)').findall(common.args.url)[0]
smilurl = getsmil(vid)
rtmpurl = str(getrtmp())
swfUrl = getswfUrl()
link = str(common.getHTML(smilurl))
match=re.compile('<video src="(.+?)"').findall(link)
if (common.settings['quality'] == '0'):
dia = xbmcgui.Dialog()
ret = dia.select(xbmc.getLocalizedString(30004), [xbmc.getLocalizedString(30016),xbmc.getLocalizedString(30017),xbmc.getLocalizedString(30018)])
if (ret == 2):
return
else:
ret = None
for playpath in match:
playpath = playpath.replace('.flv','')
if '_0700' in playpath and (xbmcplugin.getSetting(pluginhandle,"quality") == '1' or '_0700' in playpath and (ret == 0)):
item=xbmcgui.ListItem(common.args.name, iconImage='', thumbnailImage='')
item.setInfo( type="Video",infoLabels={ "Title": common.args.name})
item.setProperty("SWFPlayer", swfUrl)
item.setProperty("PlayPath", playpath)
elif '_0500' in playpath and (xbmcplugin.getSetting(pluginhandle,"quality") == '2') or '_0500' in playpath and (ret == 1):
item=xbmcgui.ListItem(common.args.name, iconImage='', thumbnailImage='')
item.setInfo( type="Video",infoLabels={ "Title": common.args.name})
item.setProperty("SWFPlayer", swfUrl)
item.setProperty("PlayPath", playpath)
xbmc.Player(xbmc.PLAYER_CORE_DVDPLAYER).play(rtmpurl, item)
开发者ID:AbsMate,项目名称:bluecop-xbmc-repo,代码行数:30,代码来源:scifi_tv.py
示例17: __init__
def __init__( self ):
#
# Search by movie file...
#
listitem = xbmcgui.ListItem( xbmc.getLocalizedString(30001), iconImage="DefaultFolder.png" )
xbmcplugin.addDirectoryItem( handle = int(sys.argv[ 1 ]), url = '%s?action=search' % ( sys.argv[ 0 ] ), listitem=listitem, isFolder=True)
#
# Search for playing movie...
#
if xbmc.Player().isPlayingVideo() :
movie_file = xbmc.Player().getPlayingFile()
listitem = xbmcgui.ListItem( xbmc.getLocalizedString(30002), iconImage="DefaultFolder.png" )
xbmcplugin.addDirectoryItem( handle = int(sys.argv[ 1 ]), url = '%s?action=search&movie_file=%s' % ( sys.argv[ 0 ], urllib.quote_plus( movie_file ) ), listitem=listitem, isFolder=True)
#
# Disable sorting...
#
xbmcplugin.addSortMethod( handle=int( sys.argv[ 1 ] ), sortMethod=xbmcplugin.SORT_METHOD_NONE )
#
# End of list...
#
xbmcplugin.endOfDirectory( handle=int( sys.argv[ 1 ] ), succeeded=True )
开发者ID:abellujan,项目名称:xbmc4xbox-addons,代码行数:26,代码来源:opensubtitles_main.py
示例18: _mark_watched
def _mark_watched( self ):
try:
pDialog.update( -1, xbmc.getLocalizedString( 30502 ), xbmc.getLocalizedString( 30503 ) )
from pysqlite2 import dbapi2 as sqlite
import datetime
fetch_sql = "SELECT times_watched FROM movies WHERE idMovie=?;"
update_sql = "UPDATE movies SET times_watched=?, last_watched=? WHERE idMovie=?;"
# connect to the database
db = sqlite.connect( self.settings[ "amt_db_path" ] )
# get our cursor object
cursor = db.cursor()
# we fetch the times watched so we can increment by one
cursor.execute( fetch_sql, ( self.args.idMovie, ) )
# increment the times watched
times_watched = cursor.fetchone()[ 0 ] + 1
# get todays date
last_watched = datetime.date.today()
# update the record with our new values
cursor.execute( update_sql, ( times_watched, last_watched, self.args.idMovie, ) )
# commit the update
db.commit()
# close the database
db.close()
except:
# oops print error message
print "ERROR: %s::%s (%d) - %s" % ( self.__class__.__name__, sys.exc_info()[ 2 ].tb_frame.f_code.co_name, sys.exc_info()[ 2 ].tb_lineno, sys.exc_info()[ 1 ], )
开发者ID:amitca71,项目名称:xbmc-scripting,代码行数:26,代码来源:xbmcplugin_player.py
示例19: _show_dialog
def _show_dialog( self ):
self.getControl( 20 ).setLabel( self.args.title )
self.getControl( 30 ).setLabel( "%s: %s" % ( xbmc.getLocalizedString( 30603 ), self.settings[ "local" ] ), )
self.getControl( 40 ).setLabel( "%s:" % ( xbmc.getLocalizedString(30602 ), ) )
self.getControl( 50 ).setLabel( "" )
self.getControl( 100 ).reset()
self.getControl( 100 ).addItem( xbmc.getLocalizedString( 30601 ) )
开发者ID:Bram77,项目名称:xbmc-favorites,代码行数:7,代码来源:xbmcplugin_showtimes.py
示例20: _download_item
def _download_item( self ):
try:
if ( xbmcgui.Dialog().yesno( self.title, xbmc.getLocalizedString( 30000 ), "", "", xbmc.getLocalizedString( 30020 ), xbmc.getLocalizedString( 30021 ) ) ):
self.dialog.create( self.title, xbmc.getLocalizedString( 30002 ), xbmc.getLocalizedString( 30003 ) )
asset_files = []
folders = [ self.args.download_url ]
while folders:
try:
htmlsource = self._get_html_source( self.REPO_URL + folders[ 0 ] )
if ( not htmlsource ): raise
items = self._parse_html_source( htmlsource )
if ( not items or items[ "status" ] == "fail" ): raise
files, dirs = self._parse_items( items )
for file in files:
asset_files.append( "%s/%s" % ( items[ "url" ], file, ) )
for folder in dirs:
folders.append( folders[ 0 ] + folder )
folders = folders[ 1 : ]
except:
folders = []
self._get_files( asset_files )
except:
# oops print error message
print "ERROR: %s::%s (%d) - %s" % ( self.__class__.__name__, sys.exc_info()[ 2 ].tb_frame.f_code.co_name, sys.exc_info()[ 2 ].tb_lineno, sys.exc_info()[ 1 ], )
self.dialog.close()
xbmcgui.Dialog().ok( self.title, xbmc.getLocalizedString( 30030 ) )
开发者ID:derobert,项目名称:debianlink-xbmc-mediastream,代码行数:26,代码来源:xbmcplugin_downloader.py
注:本文中的xbmc.getLocalizedString函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论