本文整理汇总了Python中xbmcgui.unlock函数的典型用法代码示例。如果您正苦于以下问题:Python unlock函数的具体用法?Python unlock怎么用?Python unlock使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了unlock函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: onInit
def onInit(self):
try:
logFile.info("Initialising ContextMenu")
self.SetupContextMenu()
xbmcgui.unlock()
except:
logFile.critical("Error aligning the contexmenu", exc_info=True)
开发者ID:Bram77,项目名称:xbmc-favorites,代码行数:7,代码来源:contextmenu.py
示例2: update_center
def update_center(self, n="default"):
print("%s : %s" % (n, DB.get_room_by_name(n)))
if n != "default":
dev = DB.search_devices(room_id=DB.get_room_by_name(n).id)
devices = []
for d in dev:
this_dev = (d.type, d.technology_id, d.id, d.name, DB.get_last_stat_of_device(d.id).value)
devices.append(this_dev)
print(devices)
else:
devices = [
("type1", "techno1", 1, "%s1" % n, "value1"),
("type2", "techno2", 2, "%s2" % n, "value2"),
("type3", "techno3", 3, "%s3" % n, "value3"),
("type4", "techno4", 4, "%s4" % n, "value4"),
("type5", "techno5", 5, "%s5" % n, "value5"),
("type6", "techno6", 6, "%s6" % n, "value6"),
("type7", "techno7", 7, "%s7" % n, "value7"),
("type8", "techno8", 8, "%s8" % n, "value8"),
("type9", "techno9", 9, "%s9" % n, "value9"),
("type10", "techno10", 10, "%s10" % n, "value10"),
("type11", "techno11", 11, "%s11" % n, "value11"),
("type12", "techno12", 12, "%s12" % n, "value12"),
("type13", "techno13", 13, "%s13" % n, "value13"),
]
if self._set is not None:
del self._set
xbmcgui.lock()
self._set = DeviceSet(self, self.left.menu, 150, 100, 4, devices)
xbmcgui.unlock()
开发者ID:ripleyXLR8,项目名称:domogik,代码行数:30,代码来源:main.py
示例3: __init__
def __init__(self):
if Emulating: xbmcgui.Window.__init__(self)
xbmcgui.lock()
self.setCoordinateResolution(6)
self.addControl(xbmcgui.ControlImage(0,0,0,0, ScriptHome + "background.png"))
self.addControl(xbmcgui.ControlImage(50, 50, 0, 0,ScriptHome + "ircx_logo.png"))
self.chan_topic = xbmcgui.ControlFadeLabel(60, 530,720-60*2, 30)
self.addControl(self.chan_topic)
self.chan_topic.addLabel("")
self.curmsgline = 0
# Control Decarlation Start
self.usrlist = xbmcgui.ControlList(500, 130, 150, 300,itemTextXOffset=-5)
self.addControl(self.usrlist)
self.msgbox = xbmcgui.ControlList(40, 130, 460, 300,itemTextXOffset=-5)
self.addControl(self.msgbox)
global themessage
global ircmg2
self.ircmg = ircmg2
self.themessage = themessage
self.mymsg = xbmcgui.ControlLabel(60, 450, 370, 30, self.themessage)
self.addControl(self.mymsg)
SetupButtons(self, 520,450, 70, 30, "Hori",gap=10)
self.but_sendmsg = AddButon(self,"Send")
self.but_changemsg = AddButon(self,"Type MSG")
self.but_sendmsg2usr = AddButon(self,"PM USR")
self.but_chtopic = xbmcgui.ControlButton(500, 50, 150, 30, "Change Topic")
self.addControl(self.but_chtopic)
self.but_joinchan = xbmcgui.ControlButton(420, - 50, 150, 30, "Join Chan") # was y = 50
self.addControl(self.but_joinchan)
# Control Decarlation End
# Navigation Code Start
self.setFocus(self.but_sendmsg)
self.but_sendmsg.controlRight(self.but_changemsg)
self.but_changemsg.controlRight(self.but_sendmsg2usr)
self.but_sendmsg2usr.controlRight(self.usrlist)
#self.but_joinchan.controlRight(self.msgbox)
self.but_chtopic.controlRight(self.msgbox)
self.msgbox.controlRight(self.but_changemsg)
#self.usrlist.controlRight(self.but_joinchan)
self.usrlist.controlRight(self.but_chtopic)
self.but_changemsg.controlLeft(self.but_sendmsg)
self.but_sendmsg.controlLeft(self.msgbox) #usrlist
#self.msgbox.controlLeft(self.but_joinchan)
self.msgbox.controlLeft(self.but_chtopic)
self.usrlist.controlLeft(self.but_sendmsg2usr)
self.but_sendmsg2usr.controlLeft(self.but_changemsg)
#self.but_joinchan.controlLeft(self.usrlist)
self.but_chtopic.controlLeft(self.usrlist)
self.but_sendmsg.controlUp(self.usrlist)
self.msgbox.controlDown(self.but_sendmsg)
# Navigation Code End
xbmcgui.unlock()
self.startircthread() # Executing Function to Create a thread
开发者ID:amitca71,项目名称:xbmc-scripting,代码行数:60,代码来源:default.py
示例4: show_lyrics
def show_lyrics( self, lyrics):
try:
xbmcgui.lock()
self.reset_controls()
self.getControl( 100 ).setText( "" )
self.getControl( 200 ).setLabel( "" )
self.menu_items = []
self.allow_exception = False
if ( self.current_song == lyrics.song ):
lyricsText = lyrics.lyrics
if (lyricsText == "{{Instrumental}}"):
lyricsText = "Instrumental"
self.getControl( 100 ).setText( lyricsText )
splitLyrics = lyricsText.splitlines()
for x in splitLyrics:
self.getControl( 110 ).addItem( x )
self.getControl( 110 ).selectItem( 0 )
self.focus_lyrics()
self.getControl( 200 ).setEnabled( False )
self.getControl( 200 ).setLabel( lyrics.source )
finally:
xbmcgui.unlock()
开发者ID:NEOhidra,项目名称:script.cu.lyrics,代码行数:26,代码来源:gui.py
示例5: setupcontrols
def setupcontrols(self):
self.getControl(80).setImage("XBXinBoXLogo.png")
self.getControl(89).setLabel(self.language(266))
self.getControl(84).setLabel(self.language(310))
self.getControl(85).setLabel(self.language(311))
self.getControl(86).setLabel(self.language(312))
self.getControl(87).setLabel(self.language(313))
self.getControl(61).setLabel(self.language(314))
self.getControl(62).setLabel(self.language(61))
self.getControl(63).setLabel(self.language(333))
self.getControl(82).addItem(self.mydraft[0])
self.getControl(82).addItem(self.mydraft[1])
self.getControl(82).addItem(self.mydraft[2])
self.getControl(82).addItem(self.mydraft[3])
self.getControl(73).addLabel(self.language(315) + " " + self.inbox + " <" + self.ibsettings.getSetting("Email Address") + ">")
if len(self.attachments) != 0:
self.attachlist = True
for attach in self.attachments:
self.getControl(81).addItem(attach[0])
self.getControl(81).setEnabled(True)
self.animating = True
xbmcgui.unlock()
xbmc.executebuiltin("Skin.ToggleSetting(emaildialog)")
time.sleep(1.2)
xbmc.executebuiltin("Skin.ToggleSetting(attachlistnotempty)")
time.sleep(0.8)
self.animating = False
else:
self.animating = True
xbmcgui.unlock()
xbmc.executebuiltin("Skin.ToggleSetting(emaildialog)")
time.sleep(0.8)
self.animating = False
self.getControl(81).setEnabled(False)
self.setFocusId(82)
开发者ID:amitca71,项目名称:xbmc-scripting,代码行数:35,代码来源:XinBox_Compose.py
示例6: setupWindow
def setupWindow( self ):
error = 0
try: xbmcgui.lock()
except: pass
# get the id for the current 'active' window as an integer.
# http://wiki.xbmc.org/index.php?title=Window_IDs
try: currentWindowId = xbmcgui.getCurrentWindowId()
except: currentWindowId = self.window
if hasattr( self.button, "isSelected" ):
self.canceled = self.button.isSelected()
if hasattr( self.window, "getProperty" ):
self.canceled = self.canceled or ( self.window.getProperty( "DialogAddonScan.Cancel" ) == "true" )
if hasattr( self.window, "setProperty" ):
self.window.setProperty( "DialogAddonScan.Hide", __settings__.getSetting( "hidedialog" ) )
#if self.window is None and hasattr( currentWindowId, "__int__" ):
# self.window = xbmcgui.Window( currentWindowId )
if hasattr( currentWindowId, "__int__" ) and currentWindowId != self.windowId:
self.removeControls()
self.windowId = currentWindowId
self.window = xbmcgui.Window( self.windowId )
self.initialize()
if not self.window or not hasattr( self.window, "addControl" ):
self.removeControls()
error = 1
self.window.setProperty( "DialogAddonScan.Hide", __settings__.getSetting( "hidedialog" ) )
xbmcgui.unlock()
if error:
raise xbmcguiWindowError( "xbmcgui.Window(%s)" % repr( currentWindowId ) )
#self.canceled = ( self.window.getProperty( "DialogAddonScan.Cancel" ) == "true" )
self.window.setProperty( "DialogAddonScan.IsAlive", "true" )
开发者ID:070499,项目名称:repo-scripts,代码行数:35,代码来源:AddonScan.py
示例7: _set_controls_values
def _set_controls_values( self ):
""" sets the value labels """
xbmcgui.lock()
try:
self.getControl( 201 ).setLabel( self.getControl( 201 ).getLabel(), label2=self.settings[ "skin" ] )
self.getControl( 202 ).setLabel( self.getControl( 202 ).getLabel(), label2=self.quality[ self.settings[ "trailer_quality" ] ] )
self.getControl( 203 ).setLabel( self.getControl( 203 ).getLabel(), label2=self.mode[ self.settings[ "mode" ] ] )
self.getControl( 204 ).setLabel( self.getControl( 204 ).getLabel(), label2=self.settings[ "save_folder" ] )
self.getControl( 204 ).setEnabled( self.settings[ "mode" ] >= 1 )
#self.getControl( 205 ).setLabel( _( 205 ) )
self.getControl( 205 ).setSelected( self.settings[ "auto_play_all" ] )
self.getControl( 206 ).setLabel( self.getControl( 206 ).getLabel(), label2=self.thumbnail[ self.settings[ "thumbnail_display" ] ] )
#self.getControl( 207 ).setLabel( _( 207 ) )
self.getControl( 207 ).setSelected( self.settings[ "fade_thumb" ] )
self.getControl( 207 ).setEnabled( self.settings[ "thumbnail_display" ] == 0 )
self.getControl( 208 ).setLabel( self.getControl( 208 ).getLabel(), label2=self.startup_categories[ self.settings[ "startup_category_id" ] ] )
self.getControl( 209 ).setLabel( self.getControl( 209 ).getLabel(), label2=self.startup_categories[ self.settings[ "shortcut1" ] ] )
self.getControl( 210 ).setLabel( self.getControl( 210 ).getLabel(), label2=self.startup_categories[ self.settings[ "shortcut2" ] ] )
self.getControl( 211 ).setLabel( self.getControl( 211 ).getLabel(), label2=self.startup_categories[ self.settings[ "shortcut3" ] ] )
#self.getControl( 212 ).setLabel( _( 212 ) )
self.getControl( 212 ).setSelected( self.settings[ "refresh_newest" ] )
#self.getControl( 213 ).setLabel( _( 213 ) )
self.getControl( 213 ).setSelected( self.settings[ "use_simple_search" ] )
#self.getControl( 214 ).setLabel( _( 214 ) )
self.getControl( 214 ).setSelected( self.settings[ "match_whole_words" ] )
self.getControl( 214 ).setEnabled( self.settings[ "use_simple_search" ] )
self.getControl( 215 ).setLabel( self.getControl( 215 ).getLabel(), label2=self.videoplayer_displayresolutions[ self.settings[ "videoplayer_displayresolution" ] ] )
self.getControl( 216 ).setLabel( self.getControl( 216 ).getLabel(), label2= self.settings[ "showtimes_local" ] )
self.getControl( 217 ).setLabel( self.getControl( 217 ).getLabel(), label2=self.settings[ "showtimes_scraper" ] )
#self.getControl( 218 ).setLabel( _( 218 ) )
self.getControl( 218 ).setSelected( self.settings[ "refresh_trailers" ] )
self.getControl( 250 ).setEnabled( self.settings_original != self.settings )
except:
pass
xbmcgui.unlock()
开发者ID:amitca71,项目名称:xbmc-scripting,代码行数:35,代码来源:settings.py
示例8: _fill_cast
def _fill_cast( self, listitem ):
xbmcgui.lock()
try:
# clear the cast list
self.getControl( self.CONTROL_INFO_CAST ).reset()
# grab the cast from the main lists listitem, we use this for actor thumbs
cast = xbmc.getInfoLabel( "Container(100).ListItem.Cast" )
# if cast exists we fill the cast list
if ( cast ):
# we set these class variables for the player
self.title = xbmc.getInfoLabel( "Container(100).ListItem.Title" )
self.genre = xbmc.getInfoLabel( "Container(100).ListItem.Genre" )
self.plot = xbmc.getInfoLabel( "Container(100).ListItem.Plot" )
self.director = xbmc.getInfoLabel( "Container(100).ListItem.Director" )
self.year = int( xbmc.getInfoLabel( "Container(100).ListItem.Year" ) )
self.trailer = xbmc.getInfoLabel( "Container(100).ListItem.Trailer" )
self.thumb = xbmc.getInfoImage( "Container(100).ListItem.Thumb" )
# we actually use the ListItem.CastAndRole infolabel to fill the list
role = xbmc.getInfoLabel( "Container(100).ListItem.CastAndRole" ).split( "\n" )
# enumerate through our cast list and set cast and role
for count, actor in enumerate( cast.split( "\n" ) ):
# create the actor cached thumb
actor_path = xbmc.translatePath( os.path.join( "P:\\Thumbnails", "Video", xbmc.getCacheThumbName( "actor" + actor )[ 0 ], xbmc.getCacheThumbName( "actor" + actor ) ) )
# if an actor thumb exists use it, else use the default thumb
actor_thumbnail = ( "DefaultActorBig.png", actor_path, )[ os.path.isfile( actor_path ) ]
# set the default icon
actor_icon = "DefaultActorBig.png"
# add the item to our cast list
self.getControl( self.CONTROL_INFO_CAST ).addItem( xbmcgui.ListItem( role[ count ], iconImage=actor_icon, thumbnailImage=actor_thumbnail ) )
# set the play trailer buttons status
self._set_trailer_button( self.trailer )
except:
pass
xbmcgui.unlock()
开发者ID:drrlramsey,项目名称:xbmc-addons,代码行数:34,代码来源:default.py
示例9: refresh
def refresh(self):
xbmcgui.lock()
self.getCurr()
xbmcgui.unlock()
#print "hello world"
self.t = Timer(30.0,self.refresh)
self.t.start()
开发者ID:EddyPan,项目名称:xbmc-addons-chinese-1,代码行数:7,代码来源:mystocks_detail.py
示例10: onAction
def onAction(self, action):
if action == ACTION_PREVIOUS_MENU:
self.close()
elif (
action == ACTION_MOVE_LEFT
or action == ACTION_MOVE_RIGHT
or action == ACTION_MOVE_UP
or action == ACTION_MOVE_DOWN
or action == ACTION_PAGE_UP
or action == ACTION_PAGE_DOWN
or action == ACTION_SCROLL_UP
or action == ACTION_SCROLL_DOWN
):
def SubthreadUpdate(self):
self.lblDescription.reset()
try:
self.lblDescription.setText(self.listedItems[self.lstVideos.getSelectedPosition()].description)
except:
pass
subThread = threading.Thread(target=SubthreadUpdate, args=[self])
subThread.setDaemon(True)
xbmcgui.lock()
subThread.start()
subThread.join(0.05)
xbmcgui.unlock()
if action == ACTION_MOVE_LEFT:
self.setFocus(self.btnCategories[self.currentCategory])
开发者ID:cuki,项目名称:xbmc-blackmarket,代码行数:31,代码来源:carbondefault.py
示例11: _show_credits
def _show_credits( self ):
try:
xbmcgui.lock()
#team credits
self.getControl( 20 ).setLabel( __scriptname__ )
self.getControl( 30 ).setLabel( "%s: %s-%s" % ( _( 1006 ), __version__, __svn_revision__, ) )
self.getControl( 40 ).addLabel( __svn_url__ )
self.getControl( 901 ).setLabel( _( 901 ) )
self.getControl( 101 ).reset()
list_item = xbmcgui.ListItem( sys.modules[ "__main__" ].__credits_l1__, sys.modules[ "__main__" ].__credits_r1__ )
self.getControl( 101 ).addItem( list_item )
list_item = xbmcgui.ListItem( sys.modules[ "__main__" ].__credits_l2__, sys.modules[ "__main__" ].__credits_r2__ )
self.getControl( 101 ).addItem( list_item )
list_item = xbmcgui.ListItem( sys.modules[ "__main__" ].__credits_l3__, sys.modules[ "__main__" ].__credits_r3__ )
self.getControl( 101 ).addItem( list_item )
# Additional credits
self.getControl( 902 ).setLabel( _( 902 ) )
self.getControl( 102 ).reset()
list_item = xbmcgui.ListItem( sys.modules[ "__main__" ].__add_credits_l1__, sys.modules[ "__main__" ].__add_credits_r1__ )
self.getControl( 102 ).addItem( list_item )
list_item = xbmcgui.ListItem( sys.modules[ "__main__" ].__add_credits_l2__, sys.modules[ "__main__" ].__add_credits_r2__ )
self.getControl( 102 ).addItem( list_item )
list_item = xbmcgui.ListItem( sys.modules[ "__main__" ].__add_credits_l3__, sys.modules[ "__main__" ].__add_credits_r3__ )
self.getControl( 102 ).addItem( list_item )
# Skin credits
self.getControl( 903 ).setLabel( _( 903 ) )
except:
pass
xbmcgui.unlock()
开发者ID:anikrooz,项目名称:XBMC-Skin.seventft,代码行数:29,代码来源:credits.py
示例12: _getData
def _getData(self):
xbmcgui.lock()
self.loadingMessage.setVisible(True)
self.loadingMessage.setLabel('Fetching Data...')
xbmcgui.unlock()
try:
authHandler = urllib2.HTTPBasicAuthHandler()
authHandler.add_password(
realm='SeedboxPy',
uri=self.server['uri'],
user=self.server['user'],
passwd=self.server['passwd'],
)
urlOpener = urllib2.build_opener(authHandler)
urllib2.install_opener(urlOpener)
server_status_json = urllib2.urlopen(self.server['uri']).read()
self.server_status = json.loads(server_status_json)
return True
except:
xbmcgui.lock()
self.loadingMessage.setVisible(False)
xbmcgui.unlock()
self._modal('Download Failed', 'Could not get the Server Status')
return False
开发者ID:EldonMcGuinness,项目名称:SeedboxPy-XBMC,代码行数:32,代码来源:addon.py
示例13: _set_controls_values
def _set_controls_values( self ):
""" sets the value labels """
xbmcgui.lock()
try:
self.getControl( 201 ).setLabel( _( 201 ), label2=self.scrapers_title[ self.current_scraper ] )
self.getControl( 202 ).setLabel( _( 202 ) )
self.getControl( 202 ).setSelected( self.settings[ "save_lyrics" ] )
self.getControl( 203 ).setLabel( _( 203 ), label2=self.settings[ "lyrics_path" ] )
self.getControl( 203 ).setEnabled( self.settings[ "save_lyrics" ] )
self.getControl( 204 ).setLabel( _( 204 ) )
self.getControl( 204 ).setSelected( self.settings[ "smooth_scrolling" ] )
self.getControl( 205 ).setLabel( _( 205 ) )
self.getControl( 205 ).setSelected( self.settings[ "show_viz" ] )
self.getControl( 206 ).setLabel( _( 206 ) )
self.getControl( 206 ).setSelected( self.settings[ "use_filename" ] )
self.getControl( 207 ).setLabel( _( 207 ), label2=self.filename_format[ self.settings[ "filename_format" ] ] )
self.getControl( 208 ).setLabel( _( 208 ), label2=self.settings[ "music_path" ] )
self.getControl( 209 ).setLabel( _( 209 ) )
self.getControl( 209 ).setSelected( self.settings[ "shuffle" ] )
self.getControl( 210 ).setLabel( _( 210 ) )
self.getControl( 210 ).setSelected( self.settings[ "compatible" ] )
self.getControl( 210 ).setEnabled( self.settings[ "save_lyrics" ] )
self.getControl( 211 ).setLabel( _( 211 ) )
self.getControl( 211 ).setSelected( self.settings[ "use_extension" ] )
self.getControl( 211 ).setEnabled( self.settings[ "save_lyrics" ] )
self.getControl( 250 ).setEnabled( self.settings_original != self.settings )
self.getControl( 254 ).setEnabled( not xbmc.Player().isPlayingAudio() )
except:
pass
xbmcgui.unlock()
开发者ID:HuXDK,项目名称:PlexAeon9,代码行数:30,代码来源:settings.py
示例14: _set_controls_labels
def _set_controls_labels( self ):
xbmcgui.lock()
self.i_itemId = self.i_itemId or str( self.mainwin.getCurrentListPosition()+1 )
try:
if self.i_previewPicture:
filename = os.path.basename( self.i_previewPicture )
thumbnail = os.path.join( BASE_THUMBS_PATH, filename[ 0 ], filename )
if os.path.isfile( thumbnail ): self.i_thumbnail = thumbnail
except:
print_exc()
try:
self.getControl( 48 ).reset()
listitem = xbmcgui.ListItem( self.i_title, "", self.i_thumbnail, self.i_thumbnail )
listitem.setProperty( "title", self.i_title )
listitem.setProperty( "itemId", self.i_itemId )
listitem.setProperty( "author", self.i_author )
listitem.setProperty( "DLSource", self.i_dlsource )
listitem.setProperty( "type", self.i_type )
listitem.setProperty( "language", self.i_language )
listitem.setProperty( "version", self.i_version )
listitem.setProperty( "date", self.i_date )
listitem.setProperty( "added", self.i_added )
listitem.setProperty( "outline", self.i_outline )
#listitem.setProperty( "rating", self.i_rating ) # not implanted
listitem.setProperty( "fileName", self.i_fileName )
listitem.setProperty( "description", self.i_description or _( 604 ) )
listitem.setProperty( "fanartpicture", self.i_previewPicture )
listitem.setProperty( "previewVideoURL", self.i_previewVideoURL )
self.getControl( 48 ).addItem( listitem )
except:
print_exc()
xbmcgui.unlock()
开发者ID:Quihico,项目名称:passion-xbmc,代码行数:33,代码来源:DialogItemDescription.py
示例15: showInfo
def showInfo(self):
log("> showInfo()")
backend_version = "unknown"
for node in self.dom.getElementsByTagName('version'):
backend_version = node.firstChild.data
options = {"cdr":120,"vm":121}
if (__os__ == 'xbox'): xbmcgui.lock()
for option in options.keys():
self.getControl(options[option]).reset()
# Parse CDR/VM XML content
for node in self.dom.getElementsByTagName(option):
listitem = xbmcgui.ListItem()
for childNode in node.childNodes:
if (childNode.nodeName != "#text"):
if (childNode.firstChild):
listitem.setProperty(childNode.nodeName,childNode.firstChild.data)
else:
listitem.setProperty(childNode.nodeName,"")
self.getControl(options[option]).addItem(listitem)
del listitem
if (__os__ == 'xbox'): xbmcgui.unlock()
del self.dom
if (backend_version != __version__):
log(">> Version mismatch!: Frontend is " + __version__ + " while Backend is " + backend_version)
xbmc_notification = "You have to update the backend!"
xbmc_img = xbmc.translatePath(os.path.join(RESOURCE_PATH,'media','xbmc-pbx-addon.png'))
log(">> Notification: " + xbmc_notification)
xbmc.executebuiltin("XBMC.Notification("+ __language__(30051) +","+ xbmc_notification +","+ str(15*1000) +","+ xbmc_img +")")
开发者ID:070499,项目名称:repo-scripts,代码行数:28,代码来源:default.py
示例16: refresh
def refresh(self):
self.lock.acquire()
xbmcgui.lock()
try:
#May be XBMC is not playing any media file
cur_time = xbmc.Player().getTime()
nums = self.getControl( 110 ).size()
pos = self.getControl( 110 ).getSelectedPosition()
if (cur_time < self.pOverlay[pos][0]):
while (pos > 0 and self.pOverlay[pos - 1][0] > cur_time):
pos = pos -1
else:
while (pos < nums - 1 and self.pOverlay[pos + 1][0] < cur_time):
pos = pos +1
if (pos + 5 > nums - 1):
self.getControl( 110 ).selectItem( nums - 1 )
else:
self.getControl( 110 ).selectItem( pos + 5 )
self.getControl( 110 ).selectItem( pos )
self.setFocus( self.getControl( 110 ) )
if (self.allowtimer and cur_time < self.pOverlay[nums - 1][0]):
waittime = self.pOverlay[pos + 1][0] - cur_time
self.timer = Timer(waittime, self.refresh)
self.timer.start()
xbmcgui.unlock()
self.lock.release()
except:
xbmcgui.unlock()
self.lock.release()
开发者ID:EddyPan,项目名称:xbmc-addons-chinese-1,代码行数:29,代码来源:gui.py
示例17: _fetch_hour_forecast
def _fetch_hour_forecast(self):
# fetch hour by hour forecast
alerts, alertscolor, alertscount, headings, forecasts = self.TWCClient.fetch_hour_forecast()
try:
# set any alerts
self._set_alerts(alerts, alertscolor, alertscount)
# lock the gui for faster updating
xbmcgui.lock()
# reset list
self.getControl(self.CONTROL_HOUR_LIST).reset()
# enumerate thru and set our heading properties
for count, heading in enumerate(headings):
self.CURRENT_WINDOW.setProperty("HBHHead%d" % (count + 1,), heading)
# enumerate thru and set the info
for forecast in forecasts:
listitem = xbmcgui.ListItem(forecast[0])
listitem.setProperty("icon", forecast[1])
listitem.setProperty("temp", forecast[2])
listitem.setProperty("brief", forecast[3])
listitem.setProperty("feels", forecast[4])
listitem.setProperty("precip", forecast[5])
# listitem.setProperty( "dew", forecast[ 6 ] )
listitem.setProperty("humidity", forecast[6])
listitem.setProperty("wind", forecast[7])
self.getControl(self.CONTROL_HOUR_LIST).addItem(listitem)
except:
pass
# unlock the gui
xbmcgui.unlock()
开发者ID:nolenfelten,项目名称:xbmc-addons,代码行数:29,代码来源:gui.py
示例18: _fetch_10day_forecast
def _fetch_10day_forecast(self):
# fetch hour by hour forecast
alerts, alertscolor, alertscount, headings, forecasts = self.TWCClient.fetch_10day_forecast()
# lock the gui for faster updating
xbmcgui.lock()
try:
# set any alerts
self._set_alerts(alerts, alertscolor, alertscount)
# reset list
self.getControl(self.CONTROL_10DAY_LIST).reset()
# enumerate thru and set our heading properties
for count, heading in enumerate(headings):
self.CURRENT_WINDOW.setProperty("10DayHead%d" % (count + 1,), heading.strip())
# enumerate thru and set the info
for forecast in forecasts:
listitem = xbmcgui.ListItem(forecast[0])
listitem.setProperty("date", forecast[1])
listitem.setProperty("icon", forecast[2])
listitem.setProperty("brief", forecast[3].replace(" / ", "/").replace(" ", "\n").replace("/", " /\n"))
listitem.setProperty("high", forecast[4])
listitem.setProperty("low", forecast[5])
listitem.setProperty("precip", forecast[6])
listitem.setProperty("wind", forecast[7])
listitem.setProperty("speed", forecast[8])
self.getControl(self.CONTROL_10DAY_LIST).addItem(listitem)
except:
pass
# unlock the gui
xbmcgui.unlock()
开发者ID:nolenfelten,项目名称:xbmc-addons,代码行数:29,代码来源:gui.py
示例19: getCurrentVausRect
def getCurrentVausRect( self ):
try:
# vaus step = 24
xbmcgui.lock()
vaus_pos = self.vausControl.getSelectedPosition()
offset = vaus_pos * 24
if self.vaus_statut != "BIG":
# normal vaus
vaus_width = self.defaultVausRect.w
else:
# big vaus
vaus_width = self.defaultVausBigRect.w
default_offset = int( ( vaus_width - 24 ) / 2 ) #-36
offset -= default_offset
if vaus_pos == 0: offset += default_offset
elif vaus_pos == 25: offset -= default_offset
if self.vaus_statut != "BIG":
# normal vaus
if vaus_pos == 1: offset += ( default_offset / 2 )
elif vaus_pos == 24: offset -= ( default_offset / 2 )
else:
# big vaus
if vaus_pos == 1: offset += ( ( default_offset / 3 ) * 2 )
elif vaus_pos == 2: offset += ( default_offset / 3 )
elif vaus_pos == 23: offset -= ( default_offset / 3 )
elif vaus_pos == 24: offset -= ( ( default_offset / 3 ) * 2 )
xbmcgui.unlock()
return Rect( self.defaultWallRect.left+offset, self.defaultVausRect.top, vaus_width, self.defaultVausRect.h )
except:
print_exc()
xbmcgui.unlock()
return Rect( 0, 0, 0, 0 )
开发者ID:Quihico,项目名称:passion-xbmc,代码行数:34,代码来源:game.py
示例20: _fetch_36_forecast
def _fetch_36_forecast(self, showView=True):
# fetch 36 hour forecast
alerts, alertscolor, alertscount, forecasts, video = self.TWCClient.fetch_36_forecast(
self.CURRENT_WINDOW.getProperty("Video")
)
# lock the gui for faster updating
xbmcgui.lock()
try:
# set any alerts
self._set_alerts(alerts, alertscolor, alertscount)
# set video
self._set_video(video)
# enumerate thru and set the info
for day, forecast in enumerate(forecasts):
self.CURRENT_WINDOW.setProperty("36Hour%dicon" % (day + 1,), forecast[1])
self.CURRENT_WINDOW.setProperty("36Hour%dbrief" % (day + 1,), forecast[2])
self.CURRENT_WINDOW.setProperty("36Hour%dtemptitle" % (day + 1,), forecast[3])
self.CURRENT_WINDOW.setProperty("36Hour%dtemp" % (day + 1,), forecast[4])
self.CURRENT_WINDOW.setProperty("36Hour%dpreciptitle" % (day + 1,), forecast[5])
self.CURRENT_WINDOW.setProperty("36Hour%dprecip" % (day + 1,), forecast[6])
self.CURRENT_WINDOW.setProperty("36Hour%doutlook" % (day + 1,), forecast[7])
self.CURRENT_WINDOW.setProperty("36Hour%ddaylight" % (day + 1,), forecast[8])
self.CURRENT_WINDOW.setProperty("36Hour%dtitle" % (day + 1,), forecast[0])
except:
pass
# unlock the gui
xbmcgui.unlock()
开发者ID:nolenfelten,项目名称:xbmc-addons,代码行数:27,代码来源:gui.py
注:本文中的xbmcgui.unlock函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论