mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-05-08 20:24:49 +02:00
Include .text in TXTZ.
This commit is contained in:
parent
ab8734c701
commit
bcb47ac6b3
2 changed files with 2 additions and 3 deletions
|
|
@ -92,7 +92,7 @@ class TXT2TXTZ(FileTypePlugin):
|
|||
'containing Markdown or Textile references to images. The referenced '
|
||||
'images as well as the TXT file are added to the archive.')
|
||||
version = numeric_version
|
||||
file_types = set(['txt'])
|
||||
file_types = set(['txt', 'text'])
|
||||
supported_platforms = ['windows', 'osx', 'linux']
|
||||
on_import = True
|
||||
|
||||
|
|
|
|||
|
|
@ -65,7 +65,6 @@ def convert(self, stream, options, file_ext, log,
|
|||
txt = ''
|
||||
log.debug('Reading text from file...')
|
||||
length = 0
|
||||
# [(u'path', mime),]
|
||||
|
||||
# Extract content from zip archive.
|
||||
if file_ext == 'txtz':
|
||||
|
|
@ -73,7 +72,7 @@ def convert(self, stream, options, file_ext, log,
|
|||
zf.extractall('.')
|
||||
|
||||
for x in walk('.'):
|
||||
if os.path.splitext(x)[1].lower() == '.txt':
|
||||
if os.path.splitext(x)[1].lower() in ('.txt', '.text'):
|
||||
with open(x, 'rb') as tf:
|
||||
txt += tf.read() + '\n\n'
|
||||
else:
|
||||
|
|
|
|||
Loading…
Reference in a new issue