Use class attributes as much as possible for application output

refs #803
This commit is contained in:
Laurent Bachelier 2014-09-03 01:22:18 +02:00
commit c07e23cafc
35 changed files with 228 additions and 260 deletions

View file

@ -19,7 +19,6 @@
import sys
import codecs
from weboob.capabilities.recipe import CapRecipe
@ -100,7 +99,7 @@ class Cookboob(ReplApplication):
"""
recipe = self.get_object(id, 'get_recipe')
if not recipe:
print >>sys.stderr, 'Recipe not found: %s' % id
print >>self.stderr, 'Recipe not found: %s' % id
return 3
self.start_format()
@ -141,10 +140,10 @@ class Cookboob(ReplApplication):
with codecs.open(dest, 'w', 'utf-8') as f:
f.write(xmlstring)
except IOError as e:
print >>sys.stderr, 'Unable to write .kreml in "%s": %s' % (dest, e)
print >>self.stderr, 'Unable to write .kreml in "%s": %s' % (dest, e)
return 1
return
print >>sys.stderr, 'Recipe "%s" not found' % id
print >>self.stderr, 'Recipe "%s" not found' % id
return 3
@defaultcount(10)