This commit is contained in:
Kovid Goyal 2008-01-14 02:49:23 +00:00
parent 98ab7260ec
commit cb7c0609be
2 changed files with 8 additions and 4 deletions

View File

@ -68,7 +68,8 @@ def get_metadata(stream):
""" Return metadata as a L{MetaInfo} object """
stream.seek(0)
if stream.read(5) != r'{\rtf':
raise Exception('Not a valid RTF file')
name = stream.name if hasattr(stream, 'name') else repr(stream)
raise Exception('Not a valid RTF file: '+name)
block = get_document_info(stream)[0]
if not block:
return MetaInformation(None, None)

View File

@ -247,7 +247,10 @@
<item row="2" column="0" >
<widget class="QCheckBox" name="gui_use_metadata_cover" >
<property name="text" >
<string>Use &amp;metadata cover</string>
<string>Use cover from &amp;source file</string>
</property>
<property name="checked" >
<bool>true</bool>
</property>
</widget>
</item>
@ -923,8 +926,8 @@
<property name="html" >
<string>&lt;html>&lt;head>&lt;meta name="qrichtext" content="1" />&lt;style type="text/css">
p, li { white-space: pre-wrap; }
&lt;/style>&lt;/head>&lt;body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;">
&lt;p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">&lt;/p>&lt;/body>&lt;/html></string>
&lt;/style>&lt;/head>&lt;body style=" font-family:'DejaVu Sans'; font-size:9pt; font-weight:400; font-style:normal;">
&lt;p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Sans Serif';">&lt;/p>&lt;/body>&lt;/html></string>
</property>
</widget>
</item>