remove useless calls to ReplApplication.flush() (closes #812)
This commit is contained in:
parent
8b803e7c39
commit
bdf4c13f4e
22 changed files with 0 additions and 74 deletions
|
|
@ -329,7 +329,6 @@ class Boobank(ReplApplication):
|
|||
self.start_format()
|
||||
for backend, recipient in self.do('iter_transfer_recipients', id_from, backends=names):
|
||||
self.cached_format(recipient)
|
||||
self.flush()
|
||||
return 0
|
||||
|
||||
id_to, backend_name_to = self.parse_id(id_to)
|
||||
|
|
@ -361,7 +360,6 @@ class Boobank(ReplApplication):
|
|||
self.start_format()
|
||||
for backend, transfer in self.do('transfer', id_from, id_to, amount, reason, backends=names):
|
||||
self.format(transfer)
|
||||
self.flush()
|
||||
|
||||
def do_investment(self, id):
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -73,7 +73,6 @@ class Boobill(ReplApplication):
|
|||
self.start_format()
|
||||
for backend, result in self.do(method, id, backends=names):
|
||||
self.format(result)
|
||||
self.flush()
|
||||
|
||||
def do_subscriptions(self, line):
|
||||
"""
|
||||
|
|
@ -84,7 +83,6 @@ class Boobill(ReplApplication):
|
|||
self.start_format()
|
||||
for subscription in self.get_object_list('iter_subscription'):
|
||||
self.format(subscription)
|
||||
self.flush()
|
||||
|
||||
def do_details(self, id):
|
||||
"""
|
||||
|
|
@ -117,7 +115,6 @@ class Boobill(ReplApplication):
|
|||
mysum.price = detail.price + mysum.price
|
||||
|
||||
self.format(mysum)
|
||||
self.flush()
|
||||
|
||||
def do_balance(self, id):
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -90,7 +90,6 @@ class Booblyrics(ReplApplication):
|
|||
|
||||
self.start_format()
|
||||
self.format(songlyrics)
|
||||
self.flush()
|
||||
|
||||
def complete_search(self, text, line, *ignored):
|
||||
args = line.split(' ')
|
||||
|
|
@ -112,4 +111,3 @@ class Booblyrics(ReplApplication):
|
|||
self.start_format(pattern=pattern)
|
||||
for backend, songlyrics in self.do('iter_lyrics', criteria, pattern):
|
||||
self.cached_format(songlyrics)
|
||||
self.flush()
|
||||
|
|
|
|||
|
|
@ -418,7 +418,6 @@ class Boobmsg(ReplApplication):
|
|||
else:
|
||||
self.threads.append(thread)
|
||||
self.format(thread)
|
||||
self.flush()
|
||||
|
||||
def do_export_all(self, arg):
|
||||
"""
|
||||
|
|
@ -438,7 +437,6 @@ class Boobmsg(ReplApplication):
|
|||
self.start_format()
|
||||
for backend, msg in self.do(func):
|
||||
self.format(msg)
|
||||
self.flush()
|
||||
|
||||
def do_export_thread(self, arg):
|
||||
"""
|
||||
|
|
@ -453,7 +451,6 @@ class Boobmsg(ReplApplication):
|
|||
if thread is not None :
|
||||
for msg in thread.iter_all_messages():
|
||||
self.format(msg)
|
||||
self.flush()
|
||||
|
||||
def do_show(self, arg):
|
||||
"""
|
||||
|
|
@ -477,7 +474,6 @@ class Boobmsg(ReplApplication):
|
|||
if message is not None:
|
||||
self.start_format()
|
||||
self.format(message)
|
||||
self.flush()
|
||||
self.weboob.do('set_message_read', message, backends=message.backend)
|
||||
return
|
||||
else:
|
||||
|
|
@ -500,8 +496,6 @@ class Boobmsg(ReplApplication):
|
|||
|
||||
if not found:
|
||||
self.logger.error(u'Profile not found')
|
||||
else:
|
||||
self.flush()
|
||||
|
||||
def do_photos(self, id):
|
||||
"""
|
||||
|
|
@ -535,5 +529,3 @@ class Boobmsg(ReplApplication):
|
|||
|
||||
if not found:
|
||||
self.logger.error(u'Profile not found')
|
||||
else:
|
||||
self.flush()
|
||||
|
|
|
|||
|
|
@ -69,4 +69,3 @@ class Boobooks(ReplApplication):
|
|||
|
||||
for backend, renew in self.do('renew_book', id, backends=names):
|
||||
self.format(renew)
|
||||
self.flush()
|
||||
|
|
|
|||
|
|
@ -134,7 +134,6 @@ class BoobTracker(ReplApplication):
|
|||
for backend, issue in self.do('iter_issues', query, backends=backends):
|
||||
self.add_object(issue)
|
||||
self.format(issue)
|
||||
self.flush()
|
||||
|
||||
def complete_get(self, text, line, *ignored):
|
||||
args = line.split(' ')
|
||||
|
|
@ -156,7 +155,6 @@ class BoobTracker(ReplApplication):
|
|||
print >>sys.stderr, 'Issue not found: %s' % line
|
||||
return 3
|
||||
self.format(issue)
|
||||
self.flush()
|
||||
|
||||
def complete_comment(self, text, line, *ignored):
|
||||
args = line.split(' ')
|
||||
|
|
@ -346,7 +344,6 @@ class BoobTracker(ReplApplication):
|
|||
if i:
|
||||
print 'Issue %s%s@%s%s updated' % (self.BOLD, issue.id, issue.backend, self.NC)
|
||||
self.format(i)
|
||||
self.flush()
|
||||
|
||||
def complete_attach(self, text, line, *ignored):
|
||||
args = line.split(' ')
|
||||
|
|
|
|||
|
|
@ -244,18 +244,15 @@ class Cineoob(ReplApplication):
|
|||
lid1 = []
|
||||
for backend, id in self.do('iter_person_movies_ids', person1.id, caps=ICapCinema):
|
||||
lid1.append(id)
|
||||
self.flush()
|
||||
lid2 = []
|
||||
for backend, id in self.do('iter_person_movies_ids', person2.id, caps=ICapCinema):
|
||||
lid2.append(id)
|
||||
self.flush()
|
||||
self.options.count = initial_count
|
||||
inter = list(set(lid1) & set(lid2))
|
||||
for common in inter:
|
||||
movie = self.get_object(common, 'get_movie', caps=ICapCinema)
|
||||
if movie:
|
||||
self.cached_format(movie)
|
||||
self.flush()
|
||||
|
||||
def do_persons_in_common(self, line):
|
||||
"""
|
||||
|
|
@ -264,7 +261,6 @@ class Cineoob(ReplApplication):
|
|||
Get the list of common persons between two movies.
|
||||
"""
|
||||
id1, id2 = self.parse_command_args(line, 2, 1)
|
||||
self.flush()
|
||||
|
||||
movie1 = self.get_object(id1, 'get_movie', caps=ICapCinema)
|
||||
if not movie1:
|
||||
|
|
@ -281,17 +277,14 @@ class Cineoob(ReplApplication):
|
|||
lid1 = []
|
||||
for backend, id in self.do('iter_movie_persons_ids', movie1.id, caps=ICapCinema):
|
||||
lid1.append(id)
|
||||
self.flush()
|
||||
lid2 = []
|
||||
for backend, id in self.do('iter_movie_persons_ids', movie2.id, caps=ICapCinema):
|
||||
lid2.append(id)
|
||||
self.flush()
|
||||
self.options.count = initial_count
|
||||
inter = list(set(lid1) & set(lid2))
|
||||
for common in inter:
|
||||
person = self.get_object(common, 'get_person', caps=ICapCinema)
|
||||
self.cached_format(person)
|
||||
self.flush()
|
||||
|
||||
def do_info_movie(self, id):
|
||||
"""
|
||||
|
|
@ -307,7 +300,6 @@ class Cineoob(ReplApplication):
|
|||
|
||||
self.start_format()
|
||||
self.format(movie)
|
||||
self.flush()
|
||||
|
||||
def do_info_person(self, id):
|
||||
"""
|
||||
|
|
@ -323,7 +315,6 @@ class Cineoob(ReplApplication):
|
|||
|
||||
self.start_format()
|
||||
self.format(person)
|
||||
self.flush()
|
||||
|
||||
@defaultcount(10)
|
||||
def do_search_movie(self, pattern):
|
||||
|
|
@ -339,7 +330,6 @@ class Cineoob(ReplApplication):
|
|||
self.start_format(pattern=pattern)
|
||||
for backend, movie in self.do('iter_movies', pattern=pattern, caps=ICapCinema):
|
||||
self.cached_format(movie)
|
||||
self.flush()
|
||||
|
||||
@defaultcount(10)
|
||||
def do_search_person(self, pattern):
|
||||
|
|
@ -355,7 +345,6 @@ class Cineoob(ReplApplication):
|
|||
self.start_format(pattern=pattern)
|
||||
for backend, person in self.do('iter_persons', pattern=pattern, caps=ICapCinema):
|
||||
self.cached_format(person)
|
||||
self.flush()
|
||||
|
||||
def do_casting(self, line):
|
||||
"""
|
||||
|
|
@ -373,7 +362,6 @@ class Cineoob(ReplApplication):
|
|||
|
||||
for backend, person in self.do('iter_movie_persons', movie.id, role, backends=movie.backend, caps=ICapCinema):
|
||||
self.cached_format(person)
|
||||
self.flush()
|
||||
|
||||
def do_filmography(self, line):
|
||||
"""
|
||||
|
|
@ -391,7 +379,6 @@ class Cineoob(ReplApplication):
|
|||
|
||||
for backend, movie in self.do('iter_person_movies', person.id, role, backends=person.backend, caps=ICapCinema):
|
||||
self.cached_format(movie)
|
||||
self.flush()
|
||||
|
||||
def do_biography(self, person_id):
|
||||
"""
|
||||
|
|
@ -406,7 +393,6 @@ class Cineoob(ReplApplication):
|
|||
|
||||
self.start_format()
|
||||
self.format(person)
|
||||
self.flush()
|
||||
|
||||
def complete_releases(self, text, line, *ignored):
|
||||
args = line.split(' ')
|
||||
|
|
@ -436,7 +422,6 @@ class Cineoob(ReplApplication):
|
|||
return 3
|
||||
self.start_format()
|
||||
self.format(movie)
|
||||
self.flush()
|
||||
|
||||
#================== TORRENT ==================
|
||||
|
||||
|
|
@ -459,7 +444,6 @@ class Cineoob(ReplApplication):
|
|||
|
||||
self.start_format()
|
||||
self.format(torrent)
|
||||
self.flush()
|
||||
|
||||
def complete_getfile_torrent(self, text, line, *ignored):
|
||||
args = line.split(' ', 2)
|
||||
|
|
@ -523,7 +507,6 @@ class Cineoob(ReplApplication):
|
|||
self.start_format(pattern=pattern)
|
||||
for backend, torrent in self.do('iter_torrents', pattern=pattern, caps=ICapTorrent):
|
||||
self.cached_format(torrent)
|
||||
self.flush()
|
||||
|
||||
@defaultcount(10)
|
||||
def do_search_movie_torrent(self, id):
|
||||
|
|
@ -546,7 +529,6 @@ class Cineoob(ReplApplication):
|
|||
self.start_format(pattern=pattern)
|
||||
for backend, torrent in self.do('iter_torrents', pattern=pattern, caps=ICapTorrent):
|
||||
self.cached_format(torrent)
|
||||
self.flush()
|
||||
|
||||
#================== SUBTITLE ==================
|
||||
|
||||
|
|
@ -569,7 +551,6 @@ class Cineoob(ReplApplication):
|
|||
|
||||
self.start_format()
|
||||
self.format(subtitle)
|
||||
self.flush()
|
||||
|
||||
def complete_getfile_subtitle(self, text, line, *ignored):
|
||||
args = line.split(' ', 2)
|
||||
|
|
@ -648,7 +629,6 @@ class Cineoob(ReplApplication):
|
|||
self.start_format(pattern=pattern)
|
||||
for backend, subtitle in self.do('iter_subtitles', language=language, pattern=pattern, caps=ICapSubtitle):
|
||||
self.cached_format(subtitle)
|
||||
self.flush()
|
||||
|
||||
@defaultcount(10)
|
||||
def do_search_movie_subtitle(self, line):
|
||||
|
|
@ -691,4 +671,3 @@ class Cineoob(ReplApplication):
|
|||
self.start_format(pattern=pattern)
|
||||
for backend, subtitle in self.do('iter_subtitles', language=language, pattern=pattern, caps=ICapSubtitle):
|
||||
self.cached_format(subtitle)
|
||||
self.flush()
|
||||
|
|
|
|||
|
|
@ -125,7 +125,6 @@ class Comparoob(ReplApplication):
|
|||
products.append(price)
|
||||
for price in sorted(products, key=self._get_price):
|
||||
self.cached_format(price)
|
||||
self.flush()
|
||||
|
||||
def _get_price(self, price):
|
||||
return price.cost
|
||||
|
|
@ -147,4 +146,3 @@ class Comparoob(ReplApplication):
|
|||
|
||||
self.start_format()
|
||||
self.format(price)
|
||||
self.flush()
|
||||
|
|
|
|||
|
|
@ -105,7 +105,6 @@ class Cookboob(ReplApplication):
|
|||
|
||||
self.start_format()
|
||||
self.format(recipe)
|
||||
self.flush()
|
||||
|
||||
def complete_export(self, text, line, *ignored):
|
||||
args = line.split(' ', 2)
|
||||
|
|
@ -159,4 +158,3 @@ class Cookboob(ReplApplication):
|
|||
self.start_format(pattern=pattern)
|
||||
for backend, recipe in self.do('iter_recipes', pattern=pattern):
|
||||
self.cached_format(recipe)
|
||||
self.flush()
|
||||
|
|
|
|||
|
|
@ -143,7 +143,6 @@ class Flatboob(ReplApplication):
|
|||
self.start_format()
|
||||
for backend, housing in self.do('search_housings', query):
|
||||
self.cached_format(housing)
|
||||
self.flush()
|
||||
|
||||
def ask_int(self, txt):
|
||||
r = self.ask(txt, default='', regexp='(\d+|)')
|
||||
|
|
@ -168,4 +167,3 @@ class Flatboob(ReplApplication):
|
|||
|
||||
self.start_format()
|
||||
self.format(housing)
|
||||
self.flush()
|
||||
|
|
|
|||
|
|
@ -75,7 +75,6 @@ class Galleroob(ReplApplication):
|
|||
for backend, gallery in self.do('search_gallery', pattern=pattern,
|
||||
max_results=self.options.count):
|
||||
self.cached_format(gallery)
|
||||
self.flush()
|
||||
|
||||
def do_download(self, line):
|
||||
"""
|
||||
|
|
@ -157,4 +156,3 @@ class Galleroob(ReplApplication):
|
|||
|
||||
self.start_format()
|
||||
self.format(gallery)
|
||||
self.flush()
|
||||
|
|
|
|||
|
|
@ -98,7 +98,6 @@ class Handjoob(ReplApplication):
|
|||
self.start_format(pattern=pattern)
|
||||
for backend, job_advert in self.do('search_job', pattern):
|
||||
self.cached_format(job_advert)
|
||||
self.flush()
|
||||
|
||||
def complete_info(self, text, line, *ignored):
|
||||
args = line.split(' ')
|
||||
|
|
@ -123,4 +122,3 @@ class Handjoob(ReplApplication):
|
|||
|
||||
self.start_format()
|
||||
self.format(job_advert)
|
||||
self.flush()
|
||||
|
|
|
|||
|
|
@ -245,7 +245,6 @@ class HaveDate(Boobmsg):
|
|||
status = ''
|
||||
line.append((b, status))
|
||||
self.format(tuple(line))
|
||||
self.flush()
|
||||
return
|
||||
print >>sys.stderr, "No such command '%s'" % cmd
|
||||
return 1
|
||||
|
|
@ -260,4 +259,3 @@ class HaveDate(Boobmsg):
|
|||
self.start_format()
|
||||
for backend, event in self.do('iter_events'):
|
||||
self.cached_format(event)
|
||||
self.flush()
|
||||
|
|
|
|||
|
|
@ -117,7 +117,6 @@ class Radioob(ReplApplication):
|
|||
print >>sys.stderr, 'Radio not found:', _id
|
||||
return 3
|
||||
self.format(radio)
|
||||
self.flush()
|
||||
|
||||
@defaultcount(10)
|
||||
def do_search(self, pattern=None):
|
||||
|
|
@ -133,7 +132,6 @@ class Radioob(ReplApplication):
|
|||
for backend, radio in self.do('iter_radios_search', pattern=pattern):
|
||||
self.add_object(radio)
|
||||
self.format(radio)
|
||||
self.flush()
|
||||
|
||||
def do_ls(self, line):
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -119,7 +119,6 @@ class Suboob(ReplApplication):
|
|||
|
||||
self.start_format()
|
||||
self.format(subtitle)
|
||||
self.flush()
|
||||
|
||||
def complete_download(self, text, line, *ignored):
|
||||
args = line.split(' ', 2)
|
||||
|
|
@ -199,4 +198,3 @@ class Suboob(ReplApplication):
|
|||
self.start_format(pattern=pattern)
|
||||
for backend, subtitle in self.do('iter_subtitles', language=language, pattern=pattern):
|
||||
self.cached_format(subtitle)
|
||||
self.flush()
|
||||
|
|
|
|||
|
|
@ -114,7 +114,6 @@ class Translaboob(ReplApplication):
|
|||
self.start_format(source=text)
|
||||
for backend, translation in self.do('translate', self.LANGUAGE[lan_from], self.LANGUAGE[lan_to], text):
|
||||
self.format(translation)
|
||||
self.flush()
|
||||
except (TranslationFail, LanguageNotSupported) as error:
|
||||
print >>sys.stderr, error
|
||||
pass
|
||||
|
|
|
|||
|
|
@ -51,7 +51,6 @@ class Traveloob(ReplApplication):
|
|||
"""
|
||||
for backend, station in self.do('iter_station_search', pattern):
|
||||
self.format(station)
|
||||
self.flush()
|
||||
|
||||
@defaultcount(10)
|
||||
def do_departures(self, line):
|
||||
|
|
@ -80,7 +79,6 @@ class Traveloob(ReplApplication):
|
|||
|
||||
for backend, departure in self.do('iter_station_departures', station_id, arrival_id, backends=backends):
|
||||
self.format(departure)
|
||||
self.flush()
|
||||
|
||||
def do_roadmap(self, line):
|
||||
"""
|
||||
|
|
@ -110,7 +108,6 @@ class Traveloob(ReplApplication):
|
|||
|
||||
for backend, route in self.do('iter_roadmap', departure, arrival, filters):
|
||||
self.format(route)
|
||||
self.flush()
|
||||
|
||||
def parse_datetime(self, text):
|
||||
if text is None:
|
||||
|
|
|
|||
|
|
@ -179,7 +179,6 @@ class Videoob(ReplApplication):
|
|||
|
||||
self.start_format()
|
||||
self.format(video)
|
||||
self.flush()
|
||||
|
||||
def complete_nsfw(self, text, line, begidx, endidx):
|
||||
return ['on', 'off']
|
||||
|
|
@ -220,4 +219,3 @@ class Videoob(ReplApplication):
|
|||
for backend, video in self.do('search_videos', pattern=pattern, nsfw=self.nsfw,
|
||||
max_results=self.options.count):
|
||||
self.cached_format(video)
|
||||
self.flush()
|
||||
|
|
|
|||
|
|
@ -162,7 +162,6 @@ class WebContentEdit(ReplApplication):
|
|||
self.start_format()
|
||||
for backend, revision in self.do('iter_revisions', _id, max_results=self.options.count, backends=backend_names):
|
||||
self.format(revision)
|
||||
self.flush()
|
||||
|
||||
def do_get(self, line):
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -134,7 +134,6 @@ class WeboobCfg(ReplApplication):
|
|||
for key, value in params.iteritems())),
|
||||
])
|
||||
self.format(row)
|
||||
self.flush()
|
||||
|
||||
def do_remove(self, instance_name):
|
||||
"""
|
||||
|
|
@ -195,7 +194,6 @@ class WeboobCfg(ReplApplication):
|
|||
('Description', info.description),
|
||||
])
|
||||
self.format(row)
|
||||
self.flush()
|
||||
|
||||
def do_info(self, line):
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -104,7 +104,6 @@ class Weboorrents(ReplApplication):
|
|||
|
||||
self.start_format()
|
||||
self.format(torrent)
|
||||
self.flush()
|
||||
|
||||
def complete_getfile(self, text, line, *ignored):
|
||||
args = line.split(' ', 2)
|
||||
|
|
@ -168,4 +167,3 @@ class Weboorrents(ReplApplication):
|
|||
self.start_format(pattern=pattern)
|
||||
for backend, torrent in self.do('iter_torrents', pattern=pattern):
|
||||
self.cached_format(torrent)
|
||||
self.flush()
|
||||
|
|
|
|||
|
|
@ -91,7 +91,6 @@ class WetBoobs(ReplApplication):
|
|||
self.start_format()
|
||||
for backend, city in self.do('iter_city_search', pattern, caps=ICapWeather):
|
||||
self.cached_format(city)
|
||||
self.flush()
|
||||
|
||||
def complete_current(self, text, line, *ignored):
|
||||
args = line.split(' ')
|
||||
|
|
@ -124,7 +123,6 @@ class WetBoobs(ReplApplication):
|
|||
for backend, current in self.do('get_current', _id, backends=backend_name, caps=ICapWeather):
|
||||
if current:
|
||||
self.format(current)
|
||||
self.flush()
|
||||
|
||||
def complete_forecasts(self, text, line, *ignored):
|
||||
args = line.split(' ')
|
||||
|
|
@ -149,7 +147,6 @@ class WetBoobs(ReplApplication):
|
|||
|
||||
for backend, forecast in self.do('iter_forecast', _id, backends=backend_name, caps=ICapWeather):
|
||||
self.format(forecast)
|
||||
self.flush()
|
||||
|
||||
def do_gauges(self, pattern):
|
||||
"""
|
||||
|
|
@ -161,7 +158,6 @@ class WetBoobs(ReplApplication):
|
|||
self.start_format()
|
||||
for backend, gauge in self.do('iter_gauges', pattern or None, caps=ICapGauge):
|
||||
self.cached_format(gauge)
|
||||
self.flush()
|
||||
|
||||
def complete_gauge(self, text, line, *ignored):
|
||||
args = line.split(' ')
|
||||
|
|
@ -180,7 +176,6 @@ class WetBoobs(ReplApplication):
|
|||
self.start_format()
|
||||
for backend, measure in self.do('iter_gauge_history', _id, backends=backend_name, caps=ICapGauge):
|
||||
self.format(measure)
|
||||
self.flush()
|
||||
|
||||
def complete_last_sensor_measure(self, text, line, *ignored):
|
||||
args = line.split(' ')
|
||||
|
|
@ -199,7 +194,6 @@ class WetBoobs(ReplApplication):
|
|||
self.start_format()
|
||||
for backend, measure in self.do('get_last_measure', _id, backends=backend_name, caps=ICapGauge):
|
||||
self.format(measure)
|
||||
self.flush()
|
||||
|
||||
def do_sensors(self, line):
|
||||
"""
|
||||
|
|
@ -213,4 +207,3 @@ class WetBoobs(ReplApplication):
|
|||
self.start_format()
|
||||
for backend, sensor in self.do('iter_sensors', _id, pattern=pattern, backends=backend_name, caps=ICapGauge):
|
||||
self.format(sensor)
|
||||
self.flush()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue