本文整理汇总了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 ###
######################
######################
示例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
示例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))
示例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 ""
示例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]})
示例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
示例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
示例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
示例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
##################################################################################
示例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
#
示例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.
示例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=最新发布
##################################################################################
示例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 ""
示例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
示例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 ###
######################
######################