From 23c08d60172901e1f1dc335481a41a4b8a4b7415 Mon Sep 17 00:00:00 2001 From: Christophe Benz Date: Sun, 11 Jul 2010 02:10:10 +0200 Subject: [PATCH] use logging --- weboob/applications/havesex/havesex.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/weboob/applications/havesex/havesex.py b/weboob/applications/havesex/havesex.py index d8b7de5e..7087e5a5 100644 --- a/weboob/applications/havesex/havesex.py +++ b/weboob/applications/havesex/havesex.py @@ -18,6 +18,7 @@ from __future__ import with_statement +import logging import sys import weboob @@ -57,11 +58,11 @@ class HaveSex(PromptApplication): found = 0 for backend, profile in self.weboob.do_backends(backend_name, 'get_profile', _id): if profile: - print profile.get_profile_text() + print profile.get_profile_text().encode('utf-8') found = 1 if not found: - print >>sys.stderr, 'Profile not found' + logging.error(u'Profile not found') return True @@ -80,7 +81,7 @@ class HaveSex(PromptApplication): except weboob.core.CallErrors, errors: for backend, error, backtrace in errors: if isinstance(error, OptimizationNotFound): - print 'Optimization "%s" not found' % optim + logging.error(u'Optimization "%s" not found' % optim) @PromptApplication.command("start optimizations") def command_start(self, *optims):