当前位置: 首页>>代码示例>>Python>>正文


Python xbmc.Keyboard方法代码示例

本文整理汇总了Python中xbmc.Keyboard方法的典型用法代码示例。如果您正苦于以下问题:Python xbmc.Keyboard方法的具体用法?Python xbmc.Keyboard怎么用?Python xbmc.Keyboard使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在xbmc的用法示例。


在下文中一共展示了xbmc.Keyboard方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: Search_Anime

# 需要导入模块: import xbmc [as 别名]
# 或者: from xbmc import Keyboard [as 别名]
def Search_Anime():  # 29
    keyb = xbmc.Keyboard('', 'Search')
    keyb.doModal()
    if (keyb.isConfirmed()):
        search = urllib.quote_plus(keyb.getText())

        url = ANIME + "buscar?t=todo&q=" + search
        An_Todo(url)
    else:
        return


######################
######################
###   TOOLS MENU   ###
######################
###################### 
开发者ID:bugatsinho,项目名称:bugatsinho.github.io,代码行数:19,代码来源:default.py

示例2: editFilemask

# 需要导入模块: import xbmc [as 别名]
# 或者: from xbmc import Keyboard [as 别名]
def editFilemask(self, controlId, enterString, pathComplete):
        control = self.getControlById(controlId)
        filemask = util.getLabel(control)

        keyboard = xbmc.Keyboard()
        keyboard.setHeading(util.localize(32132) % enterString)
        keyboard.setDefault(filemask)
        keyboard.doModal()
        if keyboard.isConfirmed():
            filemask = keyboard.getText()

        util.setLabel(filemask, control)

        pathParts = os.path.split(pathComplete)
        path = pathParts[0]
        pathComplete = os.path.join(path, filemask.strip())

        return pathComplete 
开发者ID:maloep,项目名称:romcollectionbrowser,代码行数:20,代码来源:dialogbase.py

示例3: go_to_id

# 需要导入模块: import xbmc [as 别名]
# 或者: from xbmc import Keyboard [as 别名]
def go_to_id(p2p_type):
	if p2p_type=='ace':
		keyb = xbmc.Keyboard('', translate(30022))
		keyb.doModal()
		if (keyb.isConfirmed()):
			search = keyb.getText()
			if search=='': sys.exit(0)
			else:
				channel_id = search
				ace.acestreams(translate(30020) + ' ( ' + str(channel_id) + ')','',str(channel_id))
	elif p2p_type=='sop_id':
		channel_id = xbmcgui.Dialog().numeric(0, translate(30018))
		sop.sopstreams(translate(30020) + ' ( ' + str(channel_id) + ')','',str(channel_id))
	elif p2p_type=='sop_url':
		keyb = xbmc.Keyboard('sop://', translate(30019) + ' sop://')
		keyb.doModal()
		if (keyb.isConfirmed()):
			search = keyb.getText()
			if search=='': sys.exit(0)
			else:
				channel_id = search
				sop.sopstreams(translate(30021) + ' ( ' + str(channel_id) + ')','',str(channel_id)) 
开发者ID:tvaddonsco,项目名称:program.plexus,代码行数:24,代码来源:resolver.py

示例4: _edit_db_string

# 需要导入模块: import xbmc [as 别名]
# 或者: from xbmc import Keyboard [as 别名]
def _edit_db_string( self,preset,type,label ):
        keyboard = xbmc.Keyboard(preset)
        keyboard.doModal()
        if (keyboard.isConfirmed()):
            try:
                InputLabel=keyboard.getText()
                conv=time.strptime(InputLabel,"%d/%m/%Y")
              #  InputLabel = Time.strftime('%Y-%m-%d')
                InputLabel = time.strftime("%Y-%m-%d",conv)
            except Exception:
                sys.exc_clear()
            if ((type == "Song") or (type == "Album") or (type == "Artist")):
                xbmc.executeJSONRPC('{"jsonrpc": "2.0", "id": 1, "method": "AudioLibrary.Set%sDetails", "params": { "%s": "%s", "%sid":%s }}' % (type,label,InputLabel,type.lower(),self.DBID))
            else:
                xbmc.executeJSONRPC('{"jsonrpc": "2.0", "id": 1, "method": "VideoLibrary.Set%sDetails", "params": { "%s": "%s", "%sid":%s }}' % (type,label,InputLabel,type.lower(),self.DBID))
        else:
            return "" 
开发者ID:Guilouz,项目名称:repository.guilouz,代码行数:19,代码来源:default.py

示例5: add_bookmark_in

# 需要导入模块: import xbmc [as 别名]
# 或者: from xbmc import Keyboard [as 别名]
def add_bookmark_in(self, params):
        response = self.get_bookmarks()[1]
        if(len(response['data']) == 0):
            return
        folders = [xbmcup.app.lang[30157]]
        hrefs = ['add_dir']
        for movie in response['data']:
            hrefs.append(movie['url'])
            folders.append(movie['name'])
        ret = xbmcup.gui.select(xbmcup.app.lang[30156], folders)
        if (ret != None):
            if(hrefs[ret] == 'add_dir'):
                keyboard = xbmc.Keyboard()
                keyboard.setHeading(xbmcup.app.lang[30112])
                keyboard.doModal()
                dirname = keyboard.getText(0)
                if not dirname: return False
                self.ajax('%s/users/profile/addbookmark?name=%s' % (SITE_URL, dirname))
                self.add_bookmark_in(params)
                return False
            else:
                self.add_bookmark({'id' : params['id'], 'dir' : hrefs[ret]}) 
开发者ID:evgen-dev,项目名称:repository.evgen_dev.xbmc-addons,代码行数:24,代码来源:context.py

示例6: getUserInput

# 需要导入模块: import xbmc [as 别名]
# 或者: from xbmc import Keyboard [as 别名]
def getUserInput(title=u"Input", default=u"", hidden=False):
    log("", 5)
    result = None

    # Fix for when this functions is called with default=None
    if not default:
        default = u""

    keyboard = xbmc.Keyboard(default, title)
    keyboard.setHiddenInput(hidden)
    keyboard.doModal()

    if keyboard.isConfirmed():
        result = keyboard.getText()

    log(repr(result), 5)
    return result


# This function raises a keyboard numpad for user input 
开发者ID:dandygithub,项目名称:kodi,代码行数:22,代码来源:XbmcHelpers.py

示例7: getUserInput

# 需要导入模块: import xbmc [as 别名]
# 或者: from xbmc import Keyboard [as 别名]
def getUserInput(self):
        kbd = xbmc.Keyboard()
        kbd.setDefault('')
        kbd.setHeading(self.language(4000))
        kbd.doModal()
        keyword = None

        if kbd.isConfirmed():
            if self.addon.getSetting('translit') == 'true':
                keyword = translit.rus(kbd.getText())
            else:
                keyword = kbd.getText()
            
            history.add_to_history(keyword)
           
        return keyword 
开发者ID:dandygithub,项目名称:kodi,代码行数:18,代码来源:default.py

示例8: getUserInput

# 需要导入模块: import xbmc [as 别名]
# 或者: from xbmc import Keyboard [as 别名]
def getUserInput(self):
        kbd = xbmc.Keyboard()
        kbd.setDefault('')
        kbd.setHeading(self.language(1000))
        kbd.doModal()
        keyword = None

        if kbd.isConfirmed():
            if self.addon.getSetting('translit') == 'true':
                keyword = transliterate.rus(kbd.getText())
            else:
                keyword = kbd.getText()

            history.add_to_history(keyword)
             
        return keyword 
开发者ID:dandygithub,项目名称:kodi,代码行数:18,代码来源:default.py

示例9: searchPPS

# 需要导入模块: import xbmc [as 别名]
# 或者: from xbmc import Keyboard [as 别名]
def searchPPS():
    result=''
    keyboard = Apps('','请输入搜索内容')
    xbmc.sleep( 1500 )
    keyboard.doModal()
    if (keyboard.isConfirmed()):
        keyword = keyboard.getText()

        # url='http://so.pps.tv/search?k='+urllib.quote(keyword)+'&from=1'
        url='http://so.iqiyi.com/pps/?q=%s' % urllib.quote(keyword)
        ppsSearchList(keyword,url,'1')
    else: return
        
##################################################################################
# Routine to search PPS site based on user given keyword for:
# a. video episode List for each found provider
# b. movie from each found provider
# c. ugc for each found provider
################################################################################## 
开发者ID:taxigps,项目名称:xbmc-addons-chinese,代码行数:21,代码来源:default.py

示例10: driller

# 需要导入模块: import xbmc [as 别名]
# 或者: from xbmc import Keyboard [as 别名]
def driller(tree, lCont):
    #global item
    global context_params
    if not isinstance(lCont, list):
        lCont = [lCont]
    for cont in lCont:
        result = None
        context_params = cont.get('context', {})
        items = tree.find_all(*cont['tag'])
        #print("to find:", cont)
        for item in items:
            #print('found')
            if cont.get('vect', None):
                try:
                    result = cont['vect'](item)
                except:
                    pass
            if result != 'DRILLER_NO_DEEPER':
                if cont.get('child', None):
                    driller(item, cont['child'])

#
# Keyboard for search
# 
开发者ID:taxigps,项目名称:xbmc-addons-chinese,代码行数:26,代码来源:default.py

示例11: searchChineseKeyboard

# 需要导入模块: import xbmc [as 别名]
# 或者: from xbmc import Keyboard [as 别名]
def searchChineseKeyboard(key=None, mode='all', pn=0):
    if key:
        url = make_param({"key":key, 'type':mode}, 'http://sou.kuwo.cn/ws/NSearch')
        processSearch(url)
    else:
        # Somehow, current chinese keyboard implementation works differently than the default keyboard.
        # The doModal doesn't prevent xbmcplugin from popping up the directory-scanning window, which
        # covers up the keyboard window.
        # A workaround is to terminate the directory, doModal, pass in keyboard input as new param of 
        # the container, then relaunch the container.
        xbmcplugin.endOfDirectory(int(sys.argv[1]))
        #中文输入法
        keyboard = ChineseKeyboard.Keyboard('', '搜索')
        keyboard.doModal()
        if keyboard.isConfirmed():
            keyword = keyboard.getText()
            if keyword:
                u = make_param({"url":'',"mode":'search("%s")' % keyword})
                xbmc.executebuiltin('Container.Update(%s,replace)' % u)

# Choose ChineseKeyboard if script.module.keyboard.chinese is installed. 
开发者ID:taxigps,项目名称:xbmc-addons-chinese,代码行数:23,代码来源:default.py

示例12: searchSohu

# 需要导入模块: import xbmc [as 别名]
# 或者: from xbmc import Keyboard [as 别名]
def searchSohu():
    result=''
    if (__addon__.getSetting('keyboard')=='0'):
        keyboard = xbmc.Keyboard('','请输入搜索内容')
    else:
        keyboard = ChineseKeyboard.Keyboard('','请输入搜索内容')
    xbmc.sleep( 1500 )
    keyboard.doModal()
    if (keyboard.isConfirmed()):
        keyword = keyboard.getText()
        p_url = 'http://so.tv.sohu.com/mts?chl=&tvType=-2&wd='
        url = p_url + urllib.quote_plus(keyword.decode('utf-8').encode('gb2312'))
        sohuSearchList(keyword,url,'1')
    else: return
        
##################################################################################
# Routine to search Sohu site based on user given keyword for:
# http://so.tv.sohu.com/mts?chl=&tvType=-2&wd=love&whole=1&m=1&box=1&c=100&o=1&p=2
# c: 类型:''=全部 100=电影 101=电视剧 106=综艺 121=音乐 122=新闻 112=娱乐 0=其它 
# o:排序方式: ''=相关程度 1=最多播放 3=最新发布
################################################################################## 
开发者ID:taxigps,项目名称:xbmc-addons-chinese,代码行数:23,代码来源:default.py

示例13: inputbox

# 需要导入模块: import xbmc [as 别名]
# 或者: from xbmc import Keyboard [as 别名]
def inputbox():
	skbd = xbmc.Keyboard()
	skbd.setHeading('Поиск:')
	skbd.doModal()
	if skbd.isConfirmed():
		SearchStr = skbd.getText()
		return SearchStr
	else:
		return "" 
开发者ID:tdw1980,项目名称:tdw,代码行数:11,代码来源:krasfs.py

示例14: inputbox

# 需要导入模块: import xbmc [as 别名]
# 或者: from xbmc import Keyboard [as 别名]
def inputbox(t):
	skbd = xbmc.Keyboard(t, 'Название:')
	skbd.doModal()
	if skbd.isConfirmed():
		SearchStr = skbd.getText()
		return SearchStr
	else:
		return t 
开发者ID:tdw1980,项目名称:tdw,代码行数:10,代码来源:default.py

示例15: Search_Pelis

# 需要导入模块: import xbmc [as 别名]
# 或者: from xbmc import Keyboard [as 别名]
def Search_Pelis():#6
    keyb = xbmc.Keyboard('', 'Search')
    keyb.doModal()
    if keyb.isConfirmed():
            search = urllib.quote_plus(keyb.getText())
            url = BASEURL + "search/?s=" + search
            Get_content(url)
    else:
        return

######################
######################
###  ANIMEHD MENU  ###
######################
###################### 
开发者ID:bugatsinho,项目名称:bugatsinho.github.io,代码行数:17,代码来源:default.py


注:本文中的xbmc.Keyboard方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。