本文整理汇总了Python中feedback.Feedback类的典型用法代码示例。如果您正苦于以下问题:Python Feedback类的具体用法?Python Feedback怎么用?Python Feedback使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Feedback类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: default_feedback
def default_feedback():
feedback = Feedback()
feedback.add_item(
"Write note: <PageNo> <Category> <Note...>",
"Save a note for a document.",
)
return feedback
示例2: tracking_search
def tracking_search(self, number, company=''):
if number <= 0:
sys.exit('\033[33m[Error]\033[0m Tracking number must more than zero')
dataset = None
company = self._company_match(company)
if company:
url = 'http://m.kuaidi100.com/query?type=%s&postid=%s&id=1' % (company, number)
r = requests.get(url)
dataset = r.json()
if not self.is_terminal:
fb = Feedback()
if dataset['status'] == '200':
for step in dataset['data']:
time = step['time']
content = step['context'].replace(' ', '')
if self.is_terminal:
print '%s\t%s' % (time, content)
else:
arg = '%s %s' % (time, content)
fb.add_item(content, time, arg=arg, valid='no')
if not self.is_terminal:
print fb
else:
if self.is_terminal:
print '\033[33m[Error]\033[0m %s' % dataset['message']
else:
fb.add_item(dataset['message'], valid='no')
示例3: get_feedback_pkt
def get_feedback_pkt(self):
fd_pkt = Feedback()
fd_pkt.mode = self.mode
fd_pkt.mcs = self.mcs
fd_pkt.succ = self.succ
fd_pkt.plen = self.rxv.length
return fd_pkt
示例4: company_search
def company_search(self, company_name):
fb = Feedback()
company_codes = []
for company in self.companies:
if re.search(company_name, company['url']):
company = self._format_company_filter(company)
fb.add_item(company['title'], company['subtitle'], arg=company['arg'], valid='no', autocomplete=company['autocomplete'])
print fb
示例5: anime_resource
def anime_resource(self, payload):
"""番组资源列表, 放送站点, 介绍链接, 下载地址"""
fb = Feedback()
for x in payload:
fb.add_item(
title=x['site'],
subtitle=' | '.join([x['name'], x['url']]), arg=x['url'])
print(fb)
示例6: update_json
def update_json(self):
self.write_json(self.archive_file, True)
fb = Feedback()
fb.add_item(
title='正在更新(/≥▽≤/)',
valid='no',
arg='update')
print(fb)
示例7: get_history
def get_history():
if isAvailable():
data = get_data("history&limit=10&type=downloaded")['data']
fb = Feedback()
for item in data:
resource = item['resource']
date = item['date']
fb.add_item(resource, date, resource)
print fb
示例8: search_movie
def search_movie(query):
data = get_data("movie.search" + "?q=" + query)
fb = Feedback()
for movie in data["movies"]:
movieTitle = movie["titles"][0]
movieYear = str(movie["year"])
identifier = movie["imdb"]
fb.add_item(movieTitle, movieYear, identifier)
print fb
示例9: search_movie
def search_movie(query):
data = get_data("movie.search" + "?q=" + urllib.quote(query))
fb = Feedback()
for movie in data['movies']:
movieTitle = movie['titles'][0]
movieYear = str(movie['year'])
identifier = movie['imdb']
fb.add_item(movieTitle, movieYear, identifier)
print fb
示例10: search_shows
def search_shows(query):
if isAvailable():
results = get_data("sb.searchtvdb&name=" + urllib.quote(query))['data']['results']
fb = Feedback()
for result in results:
show_name = result['name']
first_aired = "First aired: " + str(result['first_aired'])
tvdbid = str(result['tvdbid'])
fb.add_item(show_name, first_aired, tvdbid)
print fb
示例11: autocomplete
def autocomplete(sect, pg, note):
feedback = Feedback()
add = lambda s: feedback.add_item(
title='[%s] Write note' % s.title(),
subtitle="pg %s, Category: %s, \": %s...\"" % (pg, s, note[:20]),
arg='\\t'.join([s, pg, note])
)
[add(s) for s in SECTIONS if sect.lower() in s.lower()]
add(sect)
return feedback
示例12: get_shows
def get_shows():
if isAvailable():
data = get_data("shows")['data']
fb = Feedback()
for key in data.keys():
show = data[key]
subtitle_text = "Next episode: " + show['next_ep_airdate']
if show['status'] == "Ended":
subtitle_text = "Ended"
fb.add_item(show['show_name'], subtitle_text, key)
print fb
示例13: get_user_timeline
def get_user_timeline():
with open ('setting.pickle','rb') as f:
setting = pickle.load(f)
client.set_access_token(setting['access_token'], setting['expires_in'])
data=client.statuses.home_timeline.get()
fb = Feedback()
for x in data.statuses:
fb.add_item(u'%s'%x.user.screen_name,
subtitle=x.text,
arg=str(x.user.id)+','+str(x.id),icon=u'24.png')
return fb
示例14: list_wanted_movies
def list_wanted_movies():
data = get_data("movie.list?status=active")
fb = Feedback()
if data['total'] > 0:
for movie in data['movies']:
movieTitle = movie['library']['titles'][0]['title']
movieYear = str(movie['library']['year'])
identifier = movie['library']['identifier']
fb.add_item(movieTitle, movieYear, identifier)
else:
fb.add_item("No movies on the wanted list")
print fb
示例15: list_droplets
def list_droplets():
data = get_data("droplets")
fb = Feedback()
if len(data['droplets']) > 0:
for droplet in data['droplets']:
name = droplet['name']
ip_address = droplet['ip_address']
#status = droplet['status']
fb.add_item(name, ip_address, ip_address)
else:
fb.add_item("No droplets")
print fb