当前位置: 首页>>代码示例>>Python>>正文


Python xbmc.sleep函数代码示例

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


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

示例1: install_metapack

def install_metapack(pack):
	packs = metapacks.list()
	pack_details = packs[pack]
	mc = metacontainers.MetaContainer()
	work_path  = mc.work_path
	cache_path = mc.cache_path
	zip = os.path.join(work_path, pack)

	net = Net()
	cookiejar = ADDON.get_profile()
	cookiejar = os.path.join(cookiejar,'cookies')

	html = net.http_GET(pack_details[0]).content
	net.save_cookies(cookiejar)
	name = re.sub('-', r'\\\\u002D', pack)

	r = '"name": "%s".*?"id": "([^\s]*?)".*?"secure_prefix":"(.*?)",' % name
	r = re.search(r,html)
	pack_url  = 'http://i.minus.com'
	pack_url += r.group(2)
	pack_url += '/d' + r.group(1) + '.zip'

	complete = download_metapack(pack_url, zip, displayname=pack)
	extract_zip(zip, work_path)
	xbmc.sleep(5000)
	copy_meta_contents(work_path, cache_path)
	for table in mc.table_list:
		install = mc._insert_metadata(table)
开发者ID:zpanderson,项目名称:1Channel,代码行数:28,代码来源:default.py

示例2: Reload_Movie

  def Reload_Movie(self):
    del self.list[:]

    #-- load movie list
    movie_list = self.getControl(MOVIE_LIST)
    movie_list.reset()
    #---
    self.win.setProperty('Mode', u'Loader')
    xbmc.sleep(500)
    #---
    list = self.getMovieData()
    #-- set serial list
    for rec in list:
        name = rec['name']
        if len(rec['name_orig'])>0:
            name = name + ' - ' + rec['name_orig']
        #name = name + ' (' + rec['season_number'] + u' сезон)'
        self.getControl(413).setLabel(name)

        for mov in rec['movie']:
            item = xbmcgui.ListItem(mov['movie_name'], thumbnailImage = rec['img'])
            item.setProperty('url', mov['url'])
            item.setProperty('img', rec['img'])

            item.setInfo(type='video', infoLabels={ 'plot':        rec['descr']})
            #item.setProperty('watched', 'True')

            movie_list.addItem(item)

            #-- add new item to the list
            self.list.append({'name': mov['movie_name'], 'url': mov['url'], 'img': rec['img']})
    #---
    self.win.setProperty('Mode', self.mode)
    xbmc.sleep(500)
    self.win.setFocusId(MOVIE_LIST)
开发者ID:Backmute,项目名称:seppius-xbmc-repo,代码行数:35,代码来源:Main.py

示例3: Main

def Main():
    restart_reload = False
    try:
        w = Translator( "Translator-Main.xml", CWD )
        w.doModal()
        restart_reload = w.RestartXBMC_ReloadLanguage
        del w
    except:
        print_exc()
    xbmc.executebuiltin( "Dialog.Close(busydialog)" )

    if restart_reload:
        choices = [ "Restart XBMC", "Reload Language", "Close Dialog" ]
        selected = xbmcgui.Dialog().select( "XBMC language file has been changed!", choices )
        if selected == 0:
            if not UNDER_XBOX:
                xbmc.executebuiltin( "XBMC.Minimize()" )
            xbmc.executebuiltin( "XBMC.RestartApp()" )
            if os.environ.get( "OS", "win32" ) == "win32":
                os.startfile( os.path.join( CWD, "resources", "RestartXBMC", "windows.bat" ) )

        elif selected == 1:
            xbmc.executebuiltin( "ActivateWindow(appearancesettings)" )
            xbmc.sleep( 100 )
            xbmc.executebuiltin( "SetFocus(-99)" )
            xbmc.executebuiltin( "SetFocus(-80)" )

        else:
            xbmcgui.Dialog().ok( "XBMC Translator", "XBMC requires to restart to change your language.", "Or reload language." )
开发者ID:djidji88,项目名称:passion-xbmc,代码行数:29,代码来源:translator.py

示例4: submit_pin

    def submit_pin(self):
        result = self.plex_network.check_signin_status(self.identifier)

        if result:
            self.digit_one.setVisible(False)
            self.digit_two.setVisible(False)
            self.digit_three.setVisible(False)
            self.digit_four.setVisible(False)
            self.manual_button.setVisible(False)
            self.cancel_button.setVisible(False)
            self.submit_button.setVisible(False)
            self.pin_button.setVisible(False)
            self.submit_pin_button.setVisible(False)
            # tick mark
            self.tick = pyxbmct.Image("%s/resources/media/tick.png" % GLOBAL_SETUP['__cwd__'], aspectRatio=2)
            self.placeControl(self.tick, 2, 2, columnspan=2, rowspan=2)

            self.description.setText('Successfully Signed In')
            xbmc.sleep(2000)

            log_print("Successfully signed in")

            self.close()
        else:
            log_print("Not Successful signed in")
            self.display_pin(True)
开发者ID:milaq,项目名称:plugin.video.plexbmc,代码行数:26,代码来源:plexsignin.py

示例5: handle_wait_socket

def handle_wait_socket(time_to_wait,title,text,segunda=''):
        sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
        connected = False
        ret = mensagemprogresso.create(' '+title)
        secs=0
        percent=0
        increment = int(100 / time_to_wait)
        cancelled = False
        while secs < time_to_wait:
                try:
                        result = sock.connect(('127.0.0.1',8902))
                        connected = True
                        print("Connected to port 8902, server is working")
                        break
                        sock.close()
                except:
                        print("Stil trying to connect")
                secs = secs + 1
                percent = increment*secs
                secs_left = str((time_to_wait - secs))
                if segunda=='': remaining_display = translate(40187) + " " + str(percent) + " %"
                else: remaining_display=segunda
                mensagemprogresso.update(percent,text,remaining_display)
                xbmc.sleep(1000)
                if (mensagemprogresso.iscanceled()):
                        cancelled = True
                        break
        if cancelled == True:
                return False
        elif connected == True:
                mensagemprogresso.close()
                return True
        else:
                mensagemprogresso.close()
                return False
开发者ID:HIGHWAY99,项目名称:P2P-Streams-XBMC,代码行数:35,代码来源:sopcast.py

示例6: update_states

 def update_states(self):
     xbmc.sleep(2000)  # delay because MovieDB takes some time to update
     _, __, self.account_states = TheMovieDB.extended_episode_info(tvshow_id=self.tvshow_id,
                                                                   season=self.info["season"],
                                                                   episode=self.info["episode"],
                                                                   cache_time=0)
     super(DialogEpisodeInfo, self).update_states()
开发者ID:teamThevibe,项目名称:script.extendedinfo,代码行数:7,代码来源:DialogEpisodeInfo.py

示例7: startPlayer

 def startPlayer(self):
     sPlayerType = self.__getPlayerType()
     xbmcPlayer = xbmc.Player(sPlayerType)
     oPlayList = self.__getPlayList()
     xbmcPlayer.play(oPlayList)
     timer = int(cConfig().getSetting('param_timeout'))
     xbmc.sleep(timer)            
开发者ID:aurellulu,项目名称:venom-xbmc-addons,代码行数:7,代码来源:player.py

示例8: processVideoThemes

    def processVideoThemes(self, jsonGet, target):
        # Only process anything if it is enabled
        if self.uploadsDisabled:
            return

        # Check if we need to upload the TV Shows
        if (target == 'tvshows') and not self.isTvShowsEnabled:
            return

        # Check if we need to upload the movies
        if (target == 'movies') and not self.isMoviesEnabled:
            return

        # Get the videos that are in the library
        themeList = self.getVideos(jsonGet, target)

        lastFileUploaded = False
        for videoItem in themeList:
            # We want to wait between each upload, there is no rush and we do not want
            # to interfere with anything that is playing, so spread out the uploads
            # As each sleep is a tenth of a second, lets split the uploads by 5 minutes each
            uploadWait = 3000
            while (uploadWait > 0) and lastFileUploaded:
                # Check to make sure we have not been requested to stop yet
                if xbmc.abortRequested:
                    return
                # Wait for a tenth of a second
                xbmc.sleep(100)
                uploadWait = uploadWait - 1

            lastFileUploaded = self.uploadThemeItem(videoItem)

            # Check if all uploads were disabled
            if self.uploadsDisabled or xbmc.abortRequested:
                return
开发者ID:kodibrasil,项目名称:KodiBrasil,代码行数:35,代码来源:upload.py

示例9: list_dialog

 def list_dialog(self, movie_id):
     xbmc.executebuiltin("ActivateWindow(busydialog)")
     listitems = [LANG(32139)]
     account_lists = get_account_lists()
     for item in account_lists:
         listitems.append("%s (%i)" % (item["name"], item["item_count"]))
     listitems.append(LANG(32138))
     xbmc.executebuiltin("Dialog.Close(busydialog)")
     index = xbmcgui.Dialog().select(heading=LANG(32136),
                                     list=listitems)
     if index == 0:
         listname = xbmcgui.Dialog().input(heading=LANG(32137),
                                           type=xbmcgui.INPUT_ALPHANUM)
         if listname:
             list_id = create_list(listname)
             xbmc.sleep(1000)
             change_list_status(list_id=list_id,
                                movie_id=movie_id,
                                status=True)
     elif index == len(listitems) - 1:
         self.remove_list_dialog(account_lists)
     elif index > 0:
         change_list_status(list_id=account_lists[index - 1]["id"],
                            movie_id=movie_id,
                            status=True)
开发者ID:maverick1960,项目名称:script.extendedinfo,代码行数:25,代码来源:DialogVideoList.py

示例10: context_menu

 def context_menu(self):
     item_id = self.listitem.getProperty("id")
     if self.type == "tv":
         listitems = [LANG(32169)]
     else:
         listitems = [LANG(32113)]
     if self.logged_in:
         listitems += [LANG(14076)]
         if not self.type == "tv":
             listitems += [LANG(32107)]
         if self.mode == "list":
             listitems += [LANG(32035)]
     selection = xbmcgui.Dialog().select(heading=LANG(32151),
                                         list=listitems)
     if selection == 0:
         if set_rating_prompt(self.type, item_id):
             xbmc.sleep(2000)
             self.update(force_update=True)
             self.getControl(500).selectItem(self.position)
     elif selection == 1:
         change_fav_status(media_id=item_id,
                           media_type=self.type,
                           status="true")
     elif selection == 2:
         self.list_dialog(item_id)
     elif selection == 3:
         change_list_status(list_id=self.list_id,
                            movie_id=item_id,
                            status=False)
         self.update(force_update=True)
         self.getControl(500).selectItem(self.position)
开发者ID:maverick1960,项目名称:script.extendedinfo,代码行数:31,代码来源:DialogVideoList.py

示例11: onAction

    def onAction(self, action):
        if action.getId() in [ACTION_PARENT_DIR, ACTION_PREVIOUS_MENU, KEY_NAV_BACK, KEY_CONTEXT_MENU]:
            self.close()
            return

        if self.getFocusId() == self.C_CHANNELS_LIST and action.getId() == ACTION_LEFT:
            listControl = self.getControl(self.C_CHANNELS_LIST)
            idx = listControl.getSelectedPosition()
            buttonControl = self.getControl(self.C_CHANNELS_SELECTION)
            buttonControl.setLabel('[B]%s[/B]' % self.channelList[idx].title)

            self.getControl(self.C_CHANNELS_SELECTION_VISIBLE).setVisible(False)
            self.setFocusId(self.C_CHANNELS_SELECTION)

        elif self.getFocusId() == self.C_CHANNELS_SELECTION and action.getId() in [ACTION_RIGHT, ACTION_SELECT_ITEM]:
            self.getControl(self.C_CHANNELS_SELECTION_VISIBLE).setVisible(True)
            xbmc.sleep(350)
            self.setFocusId(self.C_CHANNELS_LIST)

        elif self.getFocusId() == self.C_CHANNELS_SELECTION and action.getId() == ACTION_UP:
            listControl = self.getControl(self.C_CHANNELS_LIST)
            idx = listControl.getSelectedPosition()
            if idx > 0:
                self.swapChannels(idx, idx - 1)

        elif self.getFocusId() == self.C_CHANNELS_SELECTION and action.getId() == ACTION_DOWN:
            listControl = self.getControl(self.C_CHANNELS_LIST)
            idx = listControl.getSelectedPosition()
            if idx < listControl.size() - 1:
                self.swapChannels(idx, idx + 1)
开发者ID:bdntv,项目名称:bdntv,代码行数:30,代码来源:gui.py

示例12: run

    def run(self):
        self.logMsg("Started")
        
        self.updateRecent()
        lastRun = datetime.today()
        lastProfilePath = xbmc.translatePath('special://profile')
        
        while (xbmc.abortRequested == False):
            td = datetime.today() - lastRun
            secTotal = td.seconds
            
            profilePath = xbmc.translatePath('special://profile')
            
            updateInterval = 60
            if (xbmc.Player().isPlaying()):
                updateInterval = 300
                
            if(secTotal > updateInterval or lastProfilePath != profilePath):
                self.updateRecent()
                lastRun = datetime.today()

            lastProfilePath = profilePath
            
            xbmc.sleep(3000)
                        
        self.logMsg("Exited")
开发者ID:zawsx,项目名称:multimedia-MediaBrowser.XBMC,代码行数:26,代码来源:RecentItems.py

示例13: get_media_url

    def get_media_url(self, host, media_id):
        web_url = self.get_url(host, media_id)
        html = self.net.http_GET(web_url).content
        form_values = {}
        stream_url = ''
        for i in re.finditer('<input type="hidden" name="([^"]+)" value="([^"]+)', html):
            form_values[i.group(1)] = i.group(2)

        xbmc.sleep(2000)
        html = self.net.http_POST(web_url, form_data=form_values).content
        
        r = re.search("file\s*:\s*'([^']+)'", html)
        if r:
            stream_url = r.group(1)

        for match in re.finditer('(eval\(function.*?)</script>', html, re.DOTALL):
            js_data = jsunpack.unpack(match.group(1))
            match2 = re.search('<param\s+name="src"\s*value="([^"]+)', js_data)
            if match2:
                stream_url = match2.group(1)
            else:
                match2 = re.search('<embed.*?type="video.*?src="([^"]+)', js_data)
                if match2:
                    stream_url = match2.group(1)
            
        if stream_url:
            return stream_url + '|User-Agent=%s&Referer=%s' % (common.IE_USER_AGENT, web_url)

        raise UrlResolver.ResolverError('Unable to resolve cloudyvideos link. Filelink not found.')
开发者ID:Lynx187,项目名称:script.module.urlresolver,代码行数:29,代码来源:cloudyvideos.py

示例14: panPlay

def panPlay():
    li = xbmcgui.ListItem(_station[0])
    li.setPath("special://home/addons/%s/silent.m4a" % _plugin)
    li.setProperty(_plugin, _stamp)
    li.setProperty('mimetype', 'audio/aac')

    _lock.acquire()
    start = time.time()
    panFill()

    while not _play:
        time.sleep(0.01)
        xbmc.sleep(1000)

        if xbmc.abortRequested:
            _lock.release()
            exit()

        if (threading.active_count() == 1) or ((time.time() - start) >= 60):
            if _play: break	# check one last time before we bail

            xbmc.log("%s.Play BAD (%13s, %ds)" % (_plugin, _stamp, time.time() - start))
            xbmcgui.Dialog().ok(_name, 'No Tracks Received', '', 'Try again later')
            exit()

    _playlist.clear()
    _lock.release()
    time.sleep(0.01)	# yield to the song threads
    xbmc.sleep(1000)	# might return control to xbmc and skip the other threads ?

    xbmcplugin.setResolvedUrl(_handle, True, li)
    _player.play(_playlist)
    xbmc.executebuiltin('ActivateWindow(10500)')

    xbmc.log("%s.Play  OK (%13s)           '%s - %s'" % (_plugin, _stamp, _station.id[-4:], _station.name))
开发者ID:ClashTheBunny,项目名称:gominoa-xbmc-addons,代码行数:35,代码来源:default.py

示例15: run

    def run(self, content, name, url, year, imdb, tvdb, meta):

        if control.window.getProperty('PseudoTVRunning') == 'True':
            return control.player.play(url, control.item(path=url))

        self.getVideoInfo(content, name, year, imdb, tvdb)

        if self.folderPath.startswith('plugin://') and not meta == None:
            poster, thumb, meta = self.getMeta(meta)
        else:
            poster, thumb, meta = self.getLibraryMeta()

        item = control.item(path=url, iconImage='DefaultVideo.png', thumbnailImage=thumb)
        item.setInfo(type='Video', infoLabels = meta)
        try: item.setArt({'poster': poster, 'tvshow.poster': poster, 'season.poster': poster})
        except: pass
        item.setProperty('Video', 'true')
        item.setProperty('IsPlayable', 'true')
        control.player.play(url, item)

        for i in range(0, 240):
            if self.isPlayingVideo(): break
            xbmc.sleep(1000)
        while self.isPlayingVideo():
            try: self.totalTime = self.getTotalTime()
            except: pass
            try: self.currentTime = self.getTime()
            except: pass
            xbmc.sleep(1000)
        control.window.clearProperty('script.trakt.ids')
        time.sleep(5)
开发者ID:azumimuo,项目名称:family-xbmc-addon,代码行数:31,代码来源:player.py


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