mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
python3: remove more cStringIO
This commit is contained in:
parent
4919373608
commit
24f504f16b
@ -8,7 +8,7 @@ Device drivers.
|
|||||||
|
|
||||||
import sys, time, pprint
|
import sys, time, pprint
|
||||||
from functools import partial
|
from functools import partial
|
||||||
from StringIO import StringIO
|
from io import BytesIO
|
||||||
|
|
||||||
DAY_MAP = dict(Sun=0, Mon=1, Tue=2, Wed=3, Thu=4, Fri=5, Sat=6)
|
DAY_MAP = dict(Sun=0, Mon=1, Tue=2, Wed=3, Thu=4, Fri=5, Sat=6)
|
||||||
MONTH_MAP = dict(Jan=1, Feb=2, Mar=3, Apr=4, May=5, Jun=6, Jul=7, Aug=8, Sep=9, Oct=10, Nov=11, Dec=12)
|
MONTH_MAP = dict(Jan=1, Feb=2, Mar=3, Apr=4, May=5, Jun=6, Jul=7, Aug=8, Sep=9, Oct=10, Nov=11, Dec=12)
|
||||||
@ -77,7 +77,7 @@ def debug(ioreg_to_tmp=False, buf=None, plugins=None,
|
|||||||
oldo, olde = sys.stdout, sys.stderr
|
oldo, olde = sys.stdout, sys.stderr
|
||||||
|
|
||||||
if buf is None:
|
if buf is None:
|
||||||
buf = StringIO()
|
buf = BytesIO()
|
||||||
sys.stdout = sys.stderr = buf
|
sys.stdout = sys.stderr = buf
|
||||||
out = partial(prints, file=buf)
|
out = partial(prints, file=buf)
|
||||||
|
|
||||||
|
@ -4,7 +4,7 @@ __license__ = 'GPL 3'
|
|||||||
__copyright__ = '2009, John Schember <john@nachtimwald.com>'
|
__copyright__ = '2009, John Schember <john@nachtimwald.com>'
|
||||||
__docformat__ = 'restructuredtext en'
|
__docformat__ = 'restructuredtext en'
|
||||||
|
|
||||||
from cStringIO import StringIO
|
from io import BytesIO
|
||||||
|
|
||||||
from calibre.customize.conversion import InputFormatPlugin
|
from calibre.customize.conversion import InputFormatPlugin
|
||||||
|
|
||||||
@ -24,7 +24,7 @@ class TCRInput(InputFormatPlugin):
|
|||||||
raw_txt = decompress(stream)
|
raw_txt = decompress(stream)
|
||||||
|
|
||||||
log.info('Converting text to OEB...')
|
log.info('Converting text to OEB...')
|
||||||
stream = StringIO(raw_txt)
|
stream = BytesIO(raw_txt)
|
||||||
|
|
||||||
from calibre.customize.ui import plugin_for_input_format
|
from calibre.customize.ui import plugin_for_input_format
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user