avoid space titles

This commit is contained in:
j 2016-03-18 18:35:41 +01:00
parent 992dc568c2
commit e877371a0b
2 changed files with 6 additions and 0 deletions

View file

@ -178,6 +178,9 @@ def info(epub):
data['date'] = data['date'].split('T')[0]
if 'language' in data and isinstance(data['language'], str):
data['language'] = get_language(data['language'])
for key in list(data):
if isinstance(data[key], str) and not data[key].strip():
del data[key]
return data
def extract_text(path):

View file

@ -224,6 +224,9 @@ def info(pdf):
for key in ('title', 'author', 'producer', 'creator'):
if key in data:
del data[key]
for key in list(data):
if isinstance(data[key], str) and not data[key].strip():
del data[key]
return data
'''