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


Python feedback.Feedback类代码示例

本文整理汇总了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
开发者ID:andrewhead,项目名称:alfred-literature-workflow,代码行数:7,代码来源:note.py

示例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')
开发者ID:00zl00,项目名称:AlfredWorkflow.com,代码行数:31,代码来源:kuaidi.py

示例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
开发者ID:yichao0319,项目名称:Energy-Aware-RA-Simulator,代码行数:8,代码来源:receiver.py

示例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
开发者ID:00zl00,项目名称:AlfredWorkflow.com,代码行数:8,代码来源:kuaidi.py

示例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)
开发者ID:hotcha,项目名称:bgmlist-alfredworkflow,代码行数:8,代码来源:bangumi.py

示例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)
开发者ID:hotcha,项目名称:bgmlist-alfredworkflow,代码行数:8,代码来源:bangumi.py

示例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
开发者ID:Fogh,项目名称:Sickbeard-Alfred,代码行数:9,代码来源:sickbeardAlfred.py

示例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
开发者ID:jamesstout,项目名称:CouchPotato-Alfred,代码行数:9,代码来源:couchpotatoAlfred.py

示例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
开发者ID:Fogh,项目名称:CouchPotato-Alfred,代码行数:9,代码来源:couchpotatoAlfred.py

示例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
开发者ID:Fogh,项目名称:Sickbeard-Alfred,代码行数:10,代码来源:sickbeardAlfred.py

示例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
开发者ID:andrewhead,项目名称:alfred-literature-workflow,代码行数:10,代码来源:note.py

示例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
开发者ID:Fogh,项目名称:Sickbeard-Alfred,代码行数:11,代码来源:sickbeardAlfred.py

示例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
开发者ID:magicshui,项目名称:maerfu,代码行数:11,代码来源:alfred_weibo.sample.py

示例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
开发者ID:Fogh,项目名称:CouchPotato-Alfred,代码行数:12,代码来源:couchpotatoAlfred.py

示例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
开发者ID:Fogh,项目名称:DigitalOcean-Alfred,代码行数:12,代码来源:digitalocean.py


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