Python xbmcgui.INPUT_NUMERIC Examples

The following are 6 code examples of xbmcgui.INPUT_NUMERIC(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module xbmcgui , or try the search function .
Example #1
Source File: main.py    From plugin.video.iptv.recorder with GNU General Public License v3.0 6 votes vote down vote up
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() 
Example #2
Source File: plugin.py    From kodi with GNU General Public License v3.0 5 votes vote down vote up
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 
Example #3
Source File: xbmc_context_ui.py    From plugin.video.youtube with GNU General Public License v2.0 5 votes vote down vote up
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 
Example #4
Source File: ui.py    From plugin.git.browser with GNU General Public License v3.0 5 votes vote down vote up
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) 
Example #5
Source File: Dialogs.py    From plugin.video.netflix with MIT License 5 votes vote down vote up
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 
Example #6
Source File: container.py    From plugin.video.themoviedb.helper with GNU General Public License v3.0 4 votes vote down vote up
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))