我们从Python开源项目中,提取了以下7个代码示例,用于说明如何使用xbmcgui.INPUT_NUMERIC。
def parentalCheck(self, parental_rating, play=False): if parental_rating == 0: return True ask_pin = addon.getSetting('js_askforpin') max_rating = addon.getSetting('js_maxrating') if max_rating.isdigit(): if int(max_rating) < 0: return True if int(max_rating) < parental_rating: if ask_pin == 'false' or not play: return False else: dlg = xbmcgui.Dialog() code = dlg.input('PIN Code', type=xbmcgui.INPUT_NUMERIC) if code == password: return True else: return False return True
def showParentalSettings(): fsk_list = ['Deaktiviert', '0', '6', '12', '16', '18'] dlg = xbmcgui.Dialog() code = dlg.input('PIN Code', type=xbmcgui.INPUT_NUMERIC) if code == xbmcaddon.Addon().getSetting('password'): idx = dlg.select('Wähle maximale FSK Alterstufe', fsk_list) if idx >= 0: fsk_code = fsk_list[idx] if fsk_code == 'Deaktiviert': xbmcaddon.Addon().setSetting('js_maxrating', '-1') else: xbmcaddon.Addon().setSetting('js_maxrating', fsk_list[idx]) if idx > 0: if dlg.yesno('Jugendschutz', 'Sollen Inhalte mit einer Alterseinstufung über ', 'FSK ' + fsk_list[idx] + ' angezeigt werden?'): xbmcaddon.Addon().setSetting('js_showall', 'true') else: xbmcaddon.Addon().setSetting('js_showall', 'false') else: xbmcgui.Dialog().notification('SkyGo - Jugendschutz', 'Fehlerhafte PIN', xbmcgui.NOTIFICATION_ERROR, 2000, True)
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
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
def root_menu(params): if params['conclave'] == 'True': pin = xbmcgui.Dialog().input(translation(30006) + params['alias'], type=xbmcgui.INPUT_NUMERIC) if pin == '': return # valida el pin path = 'perfil/{0}/clave/{1}'.format(PID, pin) response = json_request(path) valid = response['valid'] if not valid: xbmcgui.Dialog().ok(translation(30007), translation(30008)) return # Home / Inicio add_directory_item(translation(30009), 'list_tiras', 'folder.png') # Últimas vistas add_directory_item(translation(30010), 'list_prods&url=%s' % quote('tira/histoprods'), 'folder-movies.png') # Películas, Series, Cortos, Especiales para perfiles no infantiles categories = json_request('navbar?perfil={0}'.format(PID)) for tipo in sorted(categories['tipos'], key=lambda cat: cat['orden']): add_directory_item(tipo['text'], 'list_prods&url=%s' % quote('tipo/' + tipo['tag']), 'folder-movies.png') # Explorar add_directory_item(translation(30011), 'list_generos', 'folder.png') # Mi sala add_directory_item(translation(30012), 'list_prods&url=%s' % quote('tira/misala'), 'folder-movies.png') # Búsqueda add_directory_item(translation(30013), 'search', 'search.png') # Cerrar sesión add_directory_item(translation(30014), 'close_session', 'close-session.png', False) xbmcplugin.endOfDirectory(addon_handle)
def editInteger(self, mli, setting): result = xbmcgui.Dialog().input(T(32417, 'Enter Port Number'), str(setting.get()), xbmcgui.INPUT_NUMERIC) if not result: return setting.set(int(result)) mli.setLabel2(result)