no more need to print format result
This commit is contained in:
parent
57b2243ada
commit
0c425a2e9b
6 changed files with 12 additions and 18 deletions
|
|
@ -42,7 +42,7 @@ class Boobank(ConsoleApplication):
|
|||
def command_list(self):
|
||||
try:
|
||||
for backend, account in self.weboob.do('iter_accounts'):
|
||||
print self.format(account)
|
||||
self.format(account)
|
||||
except weboob.CallErrors, errors:
|
||||
for backend, error, backtrace in errors:
|
||||
if isinstance(error, weboob.tools.browser.BrowserIncorrectPassword):
|
||||
|
|
@ -60,7 +60,7 @@ class Boobank(ConsoleApplication):
|
|||
|
||||
try:
|
||||
for backend, operation in self.weboob.do(do):
|
||||
print self.format(operation)
|
||||
self.format(operation)
|
||||
total += operation.amount
|
||||
except weboob.CallErrors, errors:
|
||||
for backend, error, backtrace in errors:
|
||||
|
|
|
|||
|
|
@ -38,9 +38,9 @@ class Travel(ConsoleApplication):
|
|||
@ConsoleApplication.command('Search stations')
|
||||
def command_stations(self, pattern):
|
||||
for backend, station in self.weboob.do('iter_station_search', pattern):
|
||||
print self.format(station)
|
||||
self.format(station)
|
||||
|
||||
@ConsoleApplication.command('List all departures on a special station')
|
||||
def command_departures(self, station, arrival=None):
|
||||
for backend, departure in self.weboob.do('iter_station_departures', station, arrival):
|
||||
print self.format(departure)
|
||||
self.format(departure)
|
||||
|
|
|
|||
|
|
@ -44,14 +44,10 @@ class Videoob(ConsoleApplication):
|
|||
for backend, video in self.weboob.do('get_video', id):
|
||||
if video is None:
|
||||
continue
|
||||
s = self.format(video)
|
||||
if s:
|
||||
print s
|
||||
self.format(video)
|
||||
|
||||
@ConsoleApplication.command('Search videos')
|
||||
def command_search(self, pattern=None):
|
||||
print u'Search pattern: %s' % pattern if pattern else u'Last videos'
|
||||
for backend, video in self.weboob.do('iter_search_results', pattern=pattern, nsfw=self.options.nsfw):
|
||||
s = self.format(video)
|
||||
if s:
|
||||
print s
|
||||
self.format(video)
|
||||
|
|
|
|||
|
|
@ -62,7 +62,7 @@ class Weboorrents(ConsoleApplication):
|
|||
if not torrent:
|
||||
logging.error('Torrent "%s" not found' % id)
|
||||
return 1
|
||||
print self.format(torrent)
|
||||
self.format(torrent)
|
||||
|
||||
@ConsoleApplication.command('Get the torrent file')
|
||||
def command_getfile(self, id, dest):
|
||||
|
|
@ -86,4 +86,4 @@ class Weboorrents(ConsoleApplication):
|
|||
def command_search(self, pattern=None):
|
||||
print u'Search pattern: %s' % pattern if pattern else u'Last torrents'
|
||||
for backend, torrent in self.weboob.do('iter_torrents', pattern=pattern):
|
||||
print self.format(torrent)
|
||||
self.format(torrent)
|
||||
|
|
|
|||
|
|
@ -41,13 +41,13 @@ class WetBoobs(ConsoleApplication):
|
|||
@ConsoleApplication.command('search cities')
|
||||
def command_search(self, pattern):
|
||||
for backend, city in self.weboob.do('iter_city_search', pattern):
|
||||
print self.format(city)
|
||||
self.format(city)
|
||||
|
||||
@ConsoleApplication.command('get current weather')
|
||||
def command_current(self, city):
|
||||
try:
|
||||
for backend, current in self.weboob.do('get_current', city):
|
||||
print self.format(current)
|
||||
self.format(current)
|
||||
except CallErrors, e:
|
||||
for error in e:
|
||||
if isinstance(error, CityNotFound):
|
||||
|
|
@ -59,7 +59,7 @@ class WetBoobs(ConsoleApplication):
|
|||
def command_forecasts(self, city):
|
||||
try:
|
||||
for backend, forecast in self.weboob.do('iter_forecast', city):
|
||||
print self.format(forecast)
|
||||
self.format(forecast)
|
||||
except CallErrors, e:
|
||||
for error in e:
|
||||
if isinstance(error, CityNotFound):
|
||||
|
|
|
|||
|
|
@ -154,9 +154,7 @@ class ConsoleApplication(BaseApplication):
|
|||
|
||||
# Process result
|
||||
if isinstance(command_result, Results):
|
||||
s = self.format(command_result)
|
||||
if s:
|
||||
print s
|
||||
self.format(command_result)
|
||||
return 0
|
||||
elif isinstance(command_result, (str, unicode)):
|
||||
print command_result
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue