本文整理匯總了Python中xbmcgui.INPUT_NUMERIC屬性的典型用法代碼示例。如果您正苦於以下問題:Python xbmcgui.INPUT_NUMERIC屬性的具體用法?Python xbmcgui.INPUT_NUMERIC怎麽用?Python xbmcgui.INPUT_NUMERIC使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類xbmcgui
的用法示例。
在下文中一共展示了xbmcgui.INPUT_NUMERIC屬性的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: record_and_play
# 需要導入模塊: import xbmcgui [as 別名]
# 或者: from xbmcgui import INPUT_NUMERIC [as 別名]
def record_and_play(channelname):
#channelid = channelid.decode("utf8")
channelname = channelname.decode("utf8")
utcnow = datetime.utcnow()
ts = time.time()
utc_offset = total_seconds(datetime.fromtimestamp(ts) - datetime.utcfromtimestamp(ts))
start = utcnow - timedelta(seconds=utc_offset)
hours = xbmcgui.Dialog().input("Hours",type=xbmcgui.INPUT_NUMERIC,defaultt="4")
#log(hours)
stop = utcnow - timedelta(seconds=utc_offset) + timedelta(hours=int(hours))
do_refresh = False
watch = False
remind = False
channelid = None
threading.Thread(target=record_once_thread,args=[None, do_refresh, watch, remind, channelid, channelname, start, stop, True, None]).start()
time.sleep(5)
return recordings()
示例2: get_user_input_id
# 需要導入模塊: import xbmcgui [as 別名]
# 或者: from xbmcgui import INPUT_NUMERIC [as 別名]
def get_user_input_id():
dialog = xbmcgui.Dialog()
kp_id = None
result = dialog.input('Input Kinopoisk ID', '', type = xbmcgui.INPUT_NUMERIC)
if result:
kp_id = result
return kp_id
示例3: on_numeric_input
# 需要導入模塊: import xbmcgui [as 別名]
# 或者: from xbmcgui import INPUT_NUMERIC [as 別名]
def on_numeric_input(self, title, default=''):
dialog = xbmcgui.Dialog()
result = dialog.input(title, str(default), type=xbmcgui.INPUT_NUMERIC)
if result:
return True, int(result)
return False, None
示例4: dialog_input
# 需要導入模塊: import xbmcgui [as 別名]
# 或者: from xbmcgui import INPUT_NUMERIC [as 別名]
def dialog_input(heading, default='', type=xbmcgui.INPUT_ALPHANUM, option=0, delay=0):
if type not in [xbmcgui.INPUT_ALPHANUM, xbmcgui.INPUT_NUMERIC, xbmcgui.INPUT_DATE, xbmcgui.INPUT_TIME, xbmcgui.INPUT_IPADDRESS, xbmcgui.INPUT_PASSWORD]: type = xbmcgui.INPUT_ALPHANUM
dialog = xbmcgui.Dialog()
return dialog.input(heading, default, type, option, delay)
示例5: show_adult_pin_dialog
# 需要導入模塊: import xbmcgui [as 別名]
# 或者: from xbmcgui import INPUT_NUMERIC [as 別名]
def show_adult_pin_dialog(self):
"""
Asks the user for the adult pin
:returns: int - 4 digit adult pin needed for adult movies
"""
dlg = xbmcgui.Dialog()
dialog = dlg.input(
heading=self.get_local_string(string_id=30002),
type=xbmcgui.INPUT_NUMERIC)
return dialog
示例6: set_userdiscover_method_property
# 需要導入模塊: import xbmcgui [as 別名]
# 或者: from xbmcgui import INPUT_NUMERIC [as 別名]
def set_userdiscover_method_property(self):
method = self.params.get('method')
# Set Input Method
affix = ''
header = 'Search for '
usedetails = False
label = self.params.get('label')
tmdbtype = self.params.get('type')
inputtype = xbmcgui.INPUT_ALPHANUM
if any(i in method for i in ['year', 'vote_', '_runtime', '_networks']):
header = self.addon.getLocalizedString(32114) + ' '
inputtype = xbmcgui.INPUT_NUMERIC
elif '_date' in method:
header = self.addon.getLocalizedString(32114) + ' '
affix = ' YYYY-MM-DD\n' + self.addon.getLocalizedString(32113)
elif '_genres' in method:
label = xbmc.getLocalizedString(515)
tmdbtype = 'genre'
elif '_companies' in method:
label = self.addon.getLocalizedString(32115)
tmdbtype = 'company'
elif '_networks' in method:
label = self.addon.getLocalizedString(32116)
tmdbtype = 'company'
elif '_keywords' in method:
label = self.addon.getLocalizedString(32117)
tmdbtype = 'keyword'
elif any(i in method for i in ['_cast', '_crew', '_people']):
label = self.addon.getLocalizedString(32118)
tmdbtype = 'person'
usedetails = True
header = '{0}{1}{2}'.format(header, label, affix)
old_value = self.get_userdiscover_prop(method) or None
old_label = self.get_userdiscover_prop(method, 'Label') or None
# Route Method
if method == 'with_separator':
self.set_userdiscover_separator_property()
elif '_genres' in method:
self.set_userdiscover_genre_property()
elif 'with_release_type' in method:
self.set_userdiscover_selectlist_properties(constants.USER_DISCOVER_RELEASETYPES, header=self.addon.getLocalizedString(32119))
elif 'region' in method:
self.set_userdiscover_selectlist_properties(constants.USER_DISCOVER_REGIONS, header=self.addon.getLocalizedString(32120), multiselect=False)
elif 'with_original_language' in method:
self.set_userdiscover_selectlist_properties(constants.USER_DISCOVER_LANGUAGES, header=self.addon.getLocalizedString(32159), multiselect=False)
elif 'with_runtime' not in method and 'with_networks' not in method and any(i in method for i in ['with_', 'without_']):
self.add_userdiscover_method_property(header, tmdbtype, usedetails, old_label=old_label, old_value=old_value)
else:
self.new_property_label = self.new_property_value = utils.try_decode_string(
xbmcgui.Dialog().input(header, type=inputtype, defaultt=old_value))