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


Python Feedback.add_item方法代码示例

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


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

示例1: tracking_search

# 需要导入模块: from feedback import Feedback [as 别名]
# 或者: from feedback.Feedback import add_item [as 别名]
	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')
开发者ID:00zl00,项目名称:AlfredWorkflow.com,代码行数:33,代码来源:kuaidi.py

示例2: default_feedback

# 需要导入模块: from feedback import Feedback [as 别名]
# 或者: from feedback.Feedback import add_item [as 别名]
def default_feedback():
    feedback = Feedback()
    feedback.add_item(
        "Write note: <PageNo> <Category> <Note...>",
        "Save a note for a document.",
    )
    return feedback
开发者ID:andrewhead,项目名称:alfred-literature-workflow,代码行数:9,代码来源:note.py

示例3: anime_resource

# 需要导入模块: from feedback import Feedback [as 别名]
# 或者: from feedback.Feedback import add_item [as 别名]
 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)
开发者ID:hotcha,项目名称:bgmlist-alfredworkflow,代码行数:10,代码来源:bangumi.py

示例4: update_json

# 需要导入模块: from feedback import Feedback [as 别名]
# 或者: from feedback.Feedback import add_item [as 别名]
 def update_json(self):
     self.write_json(self.archive_file, True)
     fb = Feedback()
     fb.add_item(
         title='正在更新(/≥▽≤/)',
         valid='no',
         arg='update')
     print(fb)
开发者ID:hotcha,项目名称:bgmlist-alfredworkflow,代码行数:10,代码来源:bangumi.py

示例5: company_search

# 需要导入模块: from feedback import Feedback [as 别名]
# 或者: from feedback.Feedback import add_item [as 别名]
	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
开发者ID:00zl00,项目名称:AlfredWorkflow.com,代码行数:10,代码来源:kuaidi.py

示例6: get_history

# 需要导入模块: from feedback import Feedback [as 别名]
# 或者: from feedback.Feedback import add_item [as 别名]
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
开发者ID:Fogh,项目名称:Sickbeard-Alfred,代码行数:11,代码来源:sickbeardAlfred.py

示例7: search_movie

# 需要导入模块: from feedback import Feedback [as 别名]
# 或者: from feedback.Feedback import add_item [as 别名]
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
开发者ID:Fogh,项目名称:CouchPotato-Alfred,代码行数:11,代码来源:couchpotatoAlfred.py

示例8: search_movie

# 需要导入模块: from feedback import Feedback [as 别名]
# 或者: from feedback.Feedback import add_item [as 别名]
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
开发者ID:jamesstout,项目名称:CouchPotato-Alfred,代码行数:11,代码来源:couchpotatoAlfred.py

示例9: search_shows

# 需要导入模块: from feedback import Feedback [as 别名]
# 或者: from feedback.Feedback import add_item [as 别名]
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
开发者ID:Fogh,项目名称:Sickbeard-Alfred,代码行数:12,代码来源:sickbeardAlfred.py

示例10: get_shows

# 需要导入模块: from feedback import Feedback [as 别名]
# 或者: from feedback.Feedback import add_item [as 别名]
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
开发者ID:Fogh,项目名称:Sickbeard-Alfred,代码行数:13,代码来源:sickbeardAlfred.py

示例11: get_user_timeline

# 需要导入模块: from feedback import Feedback [as 别名]
# 或者: from feedback.Feedback import add_item [as 别名]
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
开发者ID:magicshui,项目名称:maerfu,代码行数:13,代码来源:alfred_weibo.sample.py

示例12: list_wanted_movies

# 需要导入模块: from feedback import Feedback [as 别名]
# 或者: from feedback.Feedback import add_item [as 别名]
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
开发者ID:Fogh,项目名称:CouchPotato-Alfred,代码行数:14,代码来源:couchpotatoAlfred.py

示例13: list_droplets

# 需要导入模块: from feedback import Feedback [as 别名]
# 或者: from feedback.Feedback import add_item [as 别名]
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
开发者ID:Fogh,项目名称:DigitalOcean-Alfred,代码行数:14,代码来源:digitalocean.py

示例14: week_list

# 需要导入模块: from feedback import Feedback [as 别名]
# 或者: from feedback.Feedback import add_item [as 别名]
 def week_list(self, payload):
     """一周番组放送"""
     fb = Feedback()
     for x in payload:
         fb.add_item(title=x['titleCN'],
                     subtitle=' | '.join([
                         self.week_format(x['weekDayCN']),
                         self.time_format(x['timeCN']),
                         ' '.join(self.site(x['onAirSite']))]),
                     valid="no",
                     autocomplete=self.year + self.quarter +
                     'w' + str(self.week) + x['titleCN'])
     print(fb)
开发者ID:hotcha,项目名称:bgmlist-alfredworkflow,代码行数:15,代码来源:bangumi.py

示例15: get_soon_episodes

# 需要导入模块: from feedback import Feedback [as 别名]
# 或者: from feedback.Feedback import add_item [as 别名]
def get_soon_episodes():
    if isAvailable():
        data = get_data("future&type=soon")['data']['soon']
        fb = Feedback()
        for episode in data:
            episode_name = episode['ep_name']
            show_name = episode['show_name']
            airs = episode['airs']
            air_date = episode['airdate']
            full_title = show_name + " - " + episode_name
            full_subtitle = airs + " (" + air_date + ")"
            fb.add_item(full_title, full_subtitle)
        print fb
开发者ID:00zl00,项目名称:AlfredWorkflow.com,代码行数:15,代码来源:sickbeardAlfred.py


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