當前位置: 首頁>>代碼示例>>Python>>正文


Python xbmcgui.DialogProgress方法代碼示例

本文整理匯總了Python中xbmcgui.DialogProgress方法的典型用法代碼示例。如果您正苦於以下問題:Python xbmcgui.DialogProgress方法的具體用法?Python xbmcgui.DialogProgress怎麽用?Python xbmcgui.DialogProgress使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在xbmcgui的用法示例。


在下文中一共展示了xbmcgui.DialogProgress方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: Authorization

# 需要導入模塊: import xbmcgui [as 別名]
# 或者: from xbmcgui import DialogProgress [as 別名]
def Authorization(verification_url, user_code, device_code):
    pDialog = xbmcgui.DialogProgress()
    pDialog.create(__scriptname__, "%s: %s" % (__language__(33806), verification_url), "%s: %s" % (__language__(33807), user_code))
    for i in range(0, 100):
        pDialog.update(i)
        xbmc.sleep(5000)  
        if pDialog.iscanceled(): return
        _authorize = Authorize(device_code)
        if _authorize.is_authorized:
            __addon__.setSetting('token', _authorize.access_token)
            user = GetUserInformations(_authorize.access_token)
            if user.is_authenticated:
                if __welcome__ == 'true':
                    xbmcgui.Dialog().ok(__scriptname__, '%s %s' % (__language__(32902), user.username), __language__(33808))
                __addon__.setSetting('user', user.username)
            return
    pDialog.close() 
開發者ID:cxii-dev,項目名稱:script.tvtime,代碼行數:19,代碼來源:program.py

示例2: __create_dialog

# 需要導入模塊: import xbmcgui [as 別名]
# 或者: from xbmcgui import DialogProgress [as 別名]
def __create_dialog(self, line1, line2, line3):
        if self.background:
            pd = xbmcgui.DialogProgressBG()
            msg = line1 + line2 + line3
            pd.create(self.heading, msg)
        else:
            if xbmc.getCondVisibility('Window.IsVisible(progressdialog)'):
                pd = CustomProgressDialog.ProgressDialog()
            else:
                pd = xbmcgui.DialogProgress()
            if six.PY2:
                pd.create(self.heading, line1, line2, line3)
            else:
                pd.create(self.heading,
                          line1 + '\n'
                          + line2 + '\n'
                          + line3)
        return pd 
開發者ID:tvaddonsco,項目名稱:script.module.urlresolver,代碼行數:20,代碼來源:kodi.py

示例3: __init__

# 需要導入模塊: import xbmcgui [as 別名]
# 或者: from xbmcgui import DialogProgress [as 別名]
def __init__(self, heading, line1='', line2='', line3='', active=True, countdown=60, interval=5):
        self.heading = heading
        self.countdown = countdown
        self.interval = interval
        self.line1 = line1
        self.line2 = line2
        self.line3 = line3
        if active:
            if xbmc.getCondVisibility('Window.IsVisible(progressdialog)'):
                pd = CustomProgressDialog.ProgressDialog()
            else:
                pd = xbmcgui.DialogProgress()
            if not self.line3:
                line3 = 'Expires in: %s seconds' % countdown
            if six.PY2:
                pd.create(self.heading, line1, line2, line3)
            else:
                pd.create(self.heading,
                          line1 + '\n'
                          + line2 + '\n'
                          + line3)
            pd.update(100)
            self.pd = pd
        else:
            self.pd = None 
開發者ID:tvaddonsco,項目名稱:script.module.urlresolver,代碼行數:27,代碼來源:kodi.py

示例4: get_trailer

# 需要導入模塊: import xbmcgui [as 別名]
# 或者: from xbmcgui import DialogProgress [as 別名]
def get_trailer(self, url):
        progress = xbmcgui.DialogProgress()
        progress.create(xbmcup.app.addon['name'])
        progress.update(0)
        html = self.load(url)
        movieInfo = {}
        movieInfo['error'] = False
        if not html:
            xbmcup.gui.message(xbmcup.app.lang[34031].encode('utf8'))
            progress.update(0)
            progress.close()
            return False

        progress.update(50)
        html = html.encode('utf-8')
        soup = xbmcup.parser.html(self.strip_scripts(html))

        link = self.decode_direct_media_url(soup.find('input', id='video-link').get('value'))
        avail_quality = max(map(self.my_int, self.get_qualitys(link)))
        progress.update(100)
        progress.close()
        return self.format_direct_link(link, str(avail_quality)) 
開發者ID:evgen-dev,項目名稱:repository.evgen_dev.xbmc-addons,代碼行數:24,代碼來源:http.py

示例5: mark_movies

# 需要導入模塊: import xbmcgui [as 別名]
# 或者: from xbmcgui import DialogProgress [as 別名]
def mark_movies():
    movies, limits = get_movies()
    total = limits.get("total")
    progress = xbmcgui.DialogProgress()
    progress.create("Mark (Movies)", "Please wait. Marking...")
    modify = 0
    for i, movie in enumerate(movies):
        if (progress.iscanceled()):
            break

        if modify_movie(movie):
            modify += 1

        result_string = "{0}: {1}".format("Mark results", modify)
        progress.update(100 * i / total, line2=movie.get("title"), line3=result_string)

#        time.sleep(0.1)
    progress.close() 
開發者ID:dandygithub,項目名稱:kodi,代碼行數:20,代碼來源:default.py

示例6: mark_tvshows

# 需要導入模塊: import xbmcgui [as 別名]
# 或者: from xbmcgui import DialogProgress [as 別名]
def mark_tvshows():
    tvshows, limits = get_tvshows()
    total = limits.get("total")
    progress = xbmcgui.DialogProgress()
    progress.create("Mark (TVShows)", "Please wait. Marking...")
    modify = 0
    for i, tvshow in enumerate(tvshows):
        if (progress.iscanceled()):
            break

        if modify_tvshow(tvshow):
            modify += 1

        result_string = "{0}: {1}".format("Mark results", modify)
        progress.update(100 * i / total, line2=tvshow.get("title"), line3=result_string)

#        time.sleep(0.1)
    progress.close() 
開發者ID:dandygithub,項目名稱:kodi,代碼行數:20,代碼來源:default.py

示例7: clear_movies

# 需要導入模塊: import xbmcgui [as 別名]
# 或者: from xbmcgui import DialogProgress [as 別名]
def clear_movies():
    movies, limits = get_movies()
    total = limits.get("total")
    progress = xbmcgui.DialogProgress()
    progress.create("Clear (Movies)", "Please wait. Clearing...")
    modify = 0
    for i, movie in enumerate(movies):
        if (progress.iscanceled()):
            break

        if clear_movie(movie):
            modify += 1

        result_string = "{0}: {1}".format("Clear results", modify)
        progress.update(100 * i / total, line2=movie.get("title"), line3=result_string)

#        time.sleep(0.1)
    progress.close() 
開發者ID:dandygithub,項目名稱:kodi,代碼行數:20,代碼來源:default.py

示例8: clear_tvshows

# 需要導入模塊: import xbmcgui [as 別名]
# 或者: from xbmcgui import DialogProgress [as 別名]
def clear_tvshows():
    tvshows, limits = get_tvshows()
    total = limits.get("total")
    progress = xbmcgui.DialogProgress()
    progress.create("Clear (TVShows)", "Please wait. Clearing...")
    modify = 0
    for i, tvshow in enumerate(tvshows):
        if (progress.iscanceled()):
            break

        if clear_tvshow(tvshow):
            modify += 1

        result_string = "{0}: {1}".format("Clear results", modify)
        progress.update(100 * i / total, line2=tvshow.get("title"), line3=result_string)

#        time.sleep(0.1)
    progress.close() 
開發者ID:dandygithub,項目名稱:kodi,代碼行數:20,代碼來源:default.py

示例9: list_videos

# 需要導入模塊: import xbmcgui [as 別名]
# 或者: from xbmcgui import DialogProgress [as 別名]
def list_videos(channel,show_title):
    videos=[]                
    if show_title=='unseen':
        if os.path.exists(globalvar.FAVOURITES_FILE) :
            #Read favourites
            fileFav = open(globalvar.FAVOURITES_FILE)
            jsonfav = json.loads(fileFav.read())
            pDialog = xbmcgui.DialogProgress()
            ret = pDialog.create(globalvar.LANGUAGE(33002).encode('utf-8'),'')
            i=1
            for show_folder in  jsonfav['favourites']:
                show_folder = [x.encode('utf-8') for x in show_folder]
                pDialog.update((i-1)*100/len(jsonfav['favourites']),globalvar.LANGUAGE(33003).encode('utf-8')+ show_folder[2] + ' - ' + str(i) + '/' +  str(len(jsonfav['favourites'])))
                videos+=(list_videos(show_folder[0],show_folder[1]));
                i+=1
            fileFav.close()
            pDialog.close()
    else:
        videos=globalvar.channels[channel][1].list_videos(channel,show_title) 
    return videos 
開發者ID:spmjc,項目名稱:plugin.video.freplay,代碼行數:22,代碼來源:favourites.py

示例10: list_shows

# 需要導入模塊: import xbmcgui [as 別名]
# 或者: from xbmcgui import DialogProgress [as 別名]
def list_shows(channel,folder):
  shows=[]                                
  progress = xbmcgui.DialogProgress()
  progress.create('Progress', 'This is a progress bar.')
  i=0
  for item in globalvar.ordered_channels:   
    chan_id=item[0]
    chan_title=globalvar.channels[item[0]][0]     
        
    if chan_id!='favourites' and chan_id!='mostviewed' and chan_id!=channel:

      percent = int( ( i / len(globalvar.channels)-3 ) * 100)
      message = chan_title + str( i ) + '-' + str(len(globalvar.channels)-3) + '-' + str(i / (len(globalvar.channels)-3 ))
      progress.update( percent, "", message, "" )
      if progress.iscanceled():
        break    
        
      shows.append( [channel,chan_id, chan_title , os.path.join( globalvar.MEDIA, chan_id +".png"),'shows'] )
      shows_channel=globalvar.channels[chan_id][1].list_shows(chan_id,'none') 
      shows.extend(shows_channel)
      i = i + 1
        
  progress.close()
  return shows 
開發者ID:spmjc,項目名稱:plugin.video.freplay,代碼行數:26,代碼來源:search.py

示例11: __init__

# 需要導入模塊: import xbmcgui [as 別名]
# 或者: from xbmcgui import DialogProgress [as 別名]
def __init__(self, heading, line1='', line2='', line3='', active=True, countdown=60, interval=5):
        self.heading = heading
        self.countdown = countdown
        self.interval = interval
        self.line3 = line3
        if active:
            if xbmc.getCondVisibility('Window.IsVisible(progressdialog)'):
                pd = CustomProgressDialog.ProgressDialog()
            else:
                pd = xbmcgui.DialogProgress()
            if not self.line3: line3 = 'Expires in: %s seconds' % (countdown)
            pd.create(self.heading, line1, line2, line3)
            pd.update(100)
            self.pd = pd
        else:
            self.pd = None 
開發者ID:mrknow,項目名稱:filmkodi,代碼行數:18,代碼來源:kodi.py

示例12: __init__

# 需要導入模塊: import xbmcgui [as 別名]
# 或者: from xbmcgui import DialogProgress [as 別名]
def __init__(self, provider, settings, addon):
        xbmcprovider.XBMCMultiResolverContentProvider.__init__(
            self, provider, settings, addon)
        provider.parent = self
        self.dialog = xbmcgui.DialogProgress()
        try:
            import StorageServer
            self.cache = StorageServer.StorageServer("Downloader")
        except:
            import storageserverdummy as StorageServer
            self.cache = StorageServer.StorageServer("Downloader") 
開發者ID:kodi-czsk,項目名稱:plugin.video.sosac.ph,代碼行數:13,代碼來源:sutils.py

示例13: root_list

# 需要導入模塊: import xbmcgui [as 別名]
# 或者: from xbmcgui import DialogProgress [as 別名]
def root_list(network_name):
	"""
	Loads data from master list
	"""
	network = get_network(network_name)
	dialog = xbmcgui.DialogProgress()
	dialog.create(smart_utf8(addon.getLocalizedString(39016)))
	current = 0
	rootlist = []
	network_name = network.NAME
	dialog.update(0, smart_utf8(addon.getLocalizedString(39017)) + network.NAME, smart_utf8(addon.getLocalizedString(39018)))
	showdata = network.masterlist()
	total_shows = len(showdata)
	current_show = 0
	for show in showdata:
		percent = int( (float(current_show) / total_shows))
		dialog.update(percent, smart_utf8(addon.getLocalizedString(39017)) + network.NAME, smart_utf8(addon.getLocalizedString(39005)) + show[0])
		current_show += 1
		if (dialog.iscanceled()):
			return False
	for show in showdata:
		try:
			add_show(show[0], show[1], show[2], show[3], sitedata = show[4])
		except:
			add_show(show[0], show[1], show[2], show[3])
	set_view('root') 
開發者ID:moneymaker365,項目名稱:plugin.video.ustvvod,代碼行數:28,代碼來源:common.py

示例14: refresh_db

# 需要導入模塊: import xbmcgui [as 別名]
# 或者: from xbmcgui import DialogProgress [as 別名]
def refresh_db():
	if not os.path.isfile(ustvpaths.DBFILE):
		database.create_db()
	networks = get_networks()
	dialog = xbmcgui.DialogProgress()
	dialog.create(smart_utf8(addon.getLocalizedString(39016)))
	total_stations = len(networks)
	current = 0
	increment = 100.0 / total_stations
	all_shows = []
	for network in networks:
		network_name = network.NAME
		if addon.getSetting(network.SITE) == 'true':
			percent = int(increment * current)
			dialog.update(percent, smart_utf8(addon.getLocalizedString(39017)) + network.NAME, smart_utf8(addon.getLocalizedString(39018)))
			showdata = network.masterlist()
			for show in showdata:
				try:
					series_title, mode, submode, url = show
				except:
					series_title, mode, submode, url, siteplot = show
				all_shows.append((smart_unicode(series_title.lower().strip()), smart_unicode(mode), smart_unicode(submode)))
			total_shows = len(showdata)
			current_show = 0
			for show in showdata:
				percent = int((increment * current) + (float(current_show) / total_shows) * increment)
				dialog.update(percent, smart_utf8(addon.getLocalizedString(39017)) + network.NAME, smart_utf8(addon.getLocalizedString(39005)) + show[0])
				get_serie(show[0], show[1], show[2], show[3], forceRefresh = False)
				current_show += 1
				if (dialog.iscanceled()):
					return False
		current += 1
	command = 'select tvdb_series_title , series_title, mode, submode, url from shows order by series_title'
	shows = database.execute_command(command, fetchall = True) 
	for show in shows:
		tvdb_series_title, series_title, mode, submode, url = show
		if ((smart_unicode(series_title.lower().strip()),smart_unicode(mode), smart_unicode(submode)) not in all_shows and (smart_unicode(tvdb_series_title.lower().strip()),smart_unicode(mode), smart_unicode(submode)) not in all_shows):
			command = 'delete from shows where series_title = ? and mode = ? and submode = ? and url = ?;'
			values = (series_title, mode, submode, url)
			print "Deleting - " + series_title + " " + mode + " " + submode + " " + url
			database.execute_command(command, values, fetchone = True, commit = True) 
開發者ID:moneymaker365,項目名稱:plugin.video.ustvvod,代碼行數:43,代碼來源:common.py

示例15: convert_subtitles

# 需要導入模塊: import xbmcgui [as 別名]
# 或者: from xbmcgui import DialogProgress [as 別名]
def convert_subtitles(video_guid):
	try:
		file = None
		dialog = xbmcgui.DialogProgress()
        	dialog.create(common.smart_utf8(addon.getLocalizedString(39026)))
		dialog.update(0, common.smart_utf8(addon.getLocalizedString(39027)))
		str_output = ''
		subtitle_data = connection.getURL(CLOSEDCAPTION % video_guid, connectiontype = 0)
		subtitle_data = simplejson.loads(subtitle_data)
		lines_total = len(subtitle_data)
		dialog.update(0, common.smart_utf8(addon.getLocalizedString(39028)))
		for i, subtitle_line in enumerate(subtitle_data):
			if subtitle_line is not None and 'Text' in subtitle_line['metadata']:
				if (dialog.iscanceled()):
					return
				if i % 10 == 0:
					percent = int( (float(i*100) / lines_total) )
					dialog.update(percent, common.smart_utf8(addon.getLocalizedString(30929)))
				sub = common.smart_utf8(subtitle_line['metadata']['Text'])
				start_time = common.smart_utf8(str(subtitle_line['startTime'])).split('.')
				start_minutes, start_seconds = divmod(int(start_time[0]), 60)
				start_hours, start_minutes = divmod(start_minutes, 60)
				start_time = '%02d:%02d:%02d,%02d' % (start_hours, start_minutes, start_seconds, int(start_time[1][0:2]))
				end_time = common.smart_utf8(str(subtitle_line['endTime'])).split('.')
				end_minutes, end_seconds = divmod(int(end_time[0]), 60)
				end_hours, end_minutes = divmod(end_minutes, 60)
				end_time = '%02d:%02d:%02d,%02d' % (end_hours, end_minutes, end_seconds, int(end_time[1][0:2]))
				str_output += str(i + 1) + '\n' + start_time + ' --> ' + end_time + '\n' + sub + '\n\n'
		file = open(ustvpaths.SUBTITLE, 'w')
		file.write(str_output)
		file.close()
	except Exception, e:
		print "Exception: " + unicode(e)
		common.show_exception(NAME, addon.getLocalizedString(39030)) 
開發者ID:moneymaker365,項目名稱:plugin.video.ustvvod,代碼行數:36,代碼來源:thecw.py


注:本文中的xbmcgui.DialogProgress方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。