first step in python3 support
This commit is contained in:
parent
7c1e08eb96
commit
6fcac89dd5
25 changed files with 302 additions and 208 deletions
|
|
@ -18,6 +18,8 @@
|
|||
# along with weboob. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
from __future__ import print_function
|
||||
|
||||
import os
|
||||
import sys
|
||||
import subprocess
|
||||
|
|
@ -118,7 +120,7 @@ class IFormatter(object):
|
|||
|
||||
if isinstance(line, unicode):
|
||||
line = line.encode('utf-8')
|
||||
print line
|
||||
print(line)
|
||||
self.print_lines += 1
|
||||
|
||||
def start_format(self, **kwargs):
|
||||
|
|
|
|||
|
|
@ -18,6 +18,8 @@
|
|||
# along with weboob. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
from __future__ import print_function
|
||||
|
||||
from weboob.capabilities.base import NotAvailable, NotLoaded
|
||||
from weboob.tools.json import json
|
||||
|
||||
|
|
@ -52,7 +54,7 @@ class JsonFormatter(IFormatter):
|
|||
self.queue = []
|
||||
|
||||
def flush(self):
|
||||
print json.dumps(self.queue, cls=Encoder)
|
||||
print(json.dumps(self.queue, cls=Encoder))
|
||||
|
||||
def format_dict(self, item):
|
||||
self.queue.append(item)
|
||||
|
|
@ -64,4 +66,4 @@ class JsonLineFormatter(IFormatter):
|
|||
The advantage is that it can be streamed.
|
||||
"""
|
||||
def format_dict(self, item):
|
||||
print json.dumps(item, cls=Encoder)
|
||||
print(json.dumps(item, cls=Encoder))
|
||||
|
|
|
|||
|
|
@ -18,6 +18,8 @@
|
|||
# along with weboob. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
from __future__ import print_function
|
||||
|
||||
from prettytable import PrettyTable
|
||||
|
||||
from weboob.capabilities.base import empty
|
||||
|
|
@ -40,7 +42,7 @@ class TableFormatter(IFormatter):
|
|||
def flush(self):
|
||||
s = self.get_formatted_table()
|
||||
if s is not None:
|
||||
print s.encode('utf-8')
|
||||
print(s.encode('utf-8'))
|
||||
|
||||
def get_formatted_table(self):
|
||||
if len(self.queue) == 0:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue