def Dialog_Example(): koding_test = message_xml_url mytext = koding.Text_File(path=koding_test, mode='r') main_text = mytext my_buttons = ['Close'] my_choice = koding.Custom_Dialog(main_content=main_text, pos='center', size='900x600', buttons=my_buttons, transparency=90, highlight_color='yellow', header='Latest News') if my_choice == 0: root()
def Dialog_Example(): koding_test = message_xml_url mytext = koding.Text_File(path=koding_test, mode='r') main_text = mytext my_buttons = ['Close'] my_choice = koding.Custom_Dialog( main_content=main_text, pos='center', size='900x600', buttons=my_buttons, transparency=90, highlight_color='white', header= '[B][COLOR white]Planet[/COLOR] [COLOR red]MMA[/COLOR] [COLOR white]News[/COLOR] [COLOR red]&[/COLOR] [COLOR white]Updates[/COLOR][/B]' ) if my_choice == 0: return
def News_Updates(): koding_test = message_xml_url mytest = '' if 'http' in koding_test: import urllib2 req = urllib2.Request(koding_test) req.add_header('User-Agent', 'klopp') response = urllib2.urlopen(req) mytext = response.read() response.close() else: mytext = koding.Text_File(path=koding_test, mode='r') main_text = mytext my_buttons = ['Close'] my_choice = koding.Custom_Dialog(main_content=main_text,pos='center',size='900x600',buttons=my_buttons,transparency=90,highlight_color='yellow',header='Latest News and Updates') if my_choice ==0: root()
def Dialog_Example(): koding_test = message_xml_url if 'file' in koding_test: temp = xbmc.translatePath(('special://home/addons/%s' % (addon_id))) koding_test = os.path.join(temp, koding_test.replace('file://', '')).decode('utf-8') main_text = koding.Text_File(path=koding_test, mode='r') main_text = main_text.replace('$version$', str(ownAddon.getAddonInfo('version'))) if '$changelog$' in main_text: temp = xbmc.translatePath(('special://home/addons/%s' % (addon_id))) koding_test = os.path.join(temp, 'changelog.txt').decode('utf-8') changelog = koding.Text_File(path=koding_test, mode='r') main_text = main_text.replace('$changelog$', changelog) my_buttons = ['Close'] my_choice = koding.Custom_Dialog( main_content=main_text, pos='center', size='900x600', buttons=my_buttons, transparency=90, highlight_color='yellow', header='Latest News') if my_choice == 0: return