本文整理匯總了Python中xbmcgui.ALPHANUM_HIDE_INPUT屬性的典型用法代碼示例。如果您正苦於以下問題:Python xbmcgui.ALPHANUM_HIDE_INPUT屬性的具體用法?Python xbmcgui.ALPHANUM_HIDE_INPUT怎麽用?Python xbmcgui.ALPHANUM_HIDE_INPUT使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類xbmcgui
的用法示例。
在下文中一共展示了xbmcgui.ALPHANUM_HIDE_INPUT屬性的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: get_keyboard_new
# 需要導入模塊: import xbmcgui [as 別名]
# 或者: from xbmcgui import ALPHANUM_HIDE_INPUT [as 別名]
def get_keyboard_new(heading, default='', hide_input=False):
"""
This function has been in support since XBMC Gotham v13
"""
if hide_input is False:
hide_input = 0
elif hide_input is True:
hide_input = xbmcgui.ALPHANUM_HIDE_INPUT
dialog = xbmcgui.Dialog()
keyboard = dialog.input(heading, defaultt=default, type=0, option=hide_input)
if keyboard:
return keyboard
return None
示例2: open_url
# 需要導入模塊: import xbmcgui [as 別名]
# 或者: from xbmcgui import ALPHANUM_HIDE_INPUT [as 別名]
def open_url(self, url, stream=False, check=False, cred=None, count=0):
if not url:
return False
valid = self.check_url(url, cred)
if not valid:
return False
if check:
return True
if valid == 'auth' and not cred:
cred = (xbmcgui.Dialog().input(heading=xbmc.getLocalizedString(1014)) or '', xbmcgui.Dialog().input(heading=xbmc.getLocalizedString(733), option=xbmcgui.ALPHANUM_HIDE_INPUT) or '')
response = requests.get(url, timeout=10.000, stream=stream, auth=cred)
if response.status_code == 401:
if count > 2 or not xbmcgui.Dialog().yesno(self.addon.getAddonInfo('name'), self.addon.getLocalizedString(32056), yeslabel=self.addon.getLocalizedString(32057), nolabel=xbmc.getLocalizedString(222)):
xbmcgui.Dialog().ok(self.addon.getAddonInfo('name'), self.addon.getLocalizedString(32055))
return False
count += 1
cred = (xbmcgui.Dialog().input(heading=xbmc.getLocalizedString(1014)) or '', xbmcgui.Dialog().input(heading=xbmc.getLocalizedString(733), option=xbmcgui.ALPHANUM_HIDE_INPUT) or '')
response = self.open_url(url, stream, check, cred, count)
return response
示例3: ask_for_password
# 需要導入模塊: import xbmcgui [as 別名]
# 或者: from xbmcgui import ALPHANUM_HIDE_INPUT [as 別名]
def ask_for_password():
"""Ask the user for the password"""
return g.py2_decode(xbmcgui.Dialog().input(
heading=common.get_local_string(30004),
type=xbmcgui.INPUT_ALPHANUM,
option=xbmcgui.ALPHANUM_HIDE_INPUT)) or None
示例4: login_dialog
# 需要導入模塊: import xbmcgui [as 別名]
# 或者: from xbmcgui import ALPHANUM_HIDE_INPUT [as 別名]
def login_dialog():
username = dialog.input(u'用戶名:', type=xbmcgui.INPUT_ALPHANUM)
password = dialog.input(u'密碼:', type=xbmcgui.INPUT_ALPHANUM, option=xbmcgui.ALPHANUM_HIDE_INPUT)
if username and password:
cookie,tokens = get_auth.run(username,password)
if tokens:
save_user_info(username,password,cookie,tokens)
homemenu = plugin.get_storage('homemenu')
homemenu.clear()
dialog.ok('',u'登錄成功', u'點擊返回首頁並耐心等待')
items = [{'label': u'<< 返回首頁', 'path': plugin.url_for('main_menu')}]
return plugin.finish(items, update_listing=True)
else:
dialog.ok('Error',u'用戶名或密碼不能為空')
return None
示例5: login
# 需要導入模塊: import xbmcgui [as 別名]
# 或者: from xbmcgui import ALPHANUM_HIDE_INPUT [as 別名]
def login():
username = addon.getSetting('username')
password = addon.getSetting('password')
subscription_type = [SubscriptionType.hifi, SubscriptionType.premium][int('0' + addon.getSetting('subscription_type'))]
if not username or not password:
# Ask for username/password
dialog = xbmcgui.Dialog()
username = dialog.input(_T(30008), username)
if not username:
return
password = dialog.input(_T(30009), option=xbmcgui.ALPHANUM_HIDE_INPUT)
if not password:
return
selected = dialog.select(_T(30010), [SubscriptionType.hifi, SubscriptionType.premium])
if selected < 0:
return
subscription_type = [SubscriptionType.hifi, SubscriptionType.premium][selected]
ok = session.login(username, password, subscription_type)
if ok and (not addon.getSetting('username') or not addon.getSetting('password')):
# Ask about remembering username/password
dialog = xbmcgui.Dialog()
if dialog.yesno(plugin.name, _T(30209)):
addon.setSetting('username', username)
addon.setSetting('password', password)
else:
addon.setSetting('password', '')
if not ok:
xbmcgui.Dialog().notification(plugin.name, _T(30253) , icon=xbmcgui.NOTIFICATION_ERROR)
xbmc.executebuiltin('Container.Refresh()')
示例6: show_password_dialog
# 需要導入模塊: import xbmcgui [as 別名]
# 或者: from xbmcgui import ALPHANUM_HIDE_INPUT [as 別名]
def show_password_dialog(self):
"""
Asks the user for its Netflix password
:returns: str - Netflix password
"""
dlg = xbmcgui.Dialog()
dialog = dlg.input(
heading=self.get_local_string(string_id=30004),
type=xbmcgui.INPUT_ALPHANUM,
option=xbmcgui.ALPHANUM_HIDE_INPUT)
return dialog