mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Amazon plugin: Use latin1 rather than utf-8 as URL encoding
This commit is contained in:
parent
0c755dedf1
commit
624bb54a49
@ -1038,6 +1038,17 @@ class Server(PreferencesPlugin):
|
|||||||
'give you access to your calibre library from anywhere, '
|
'give you access to your calibre library from anywhere, '
|
||||||
'on any device, over the internet')
|
'on any device, over the internet')
|
||||||
|
|
||||||
|
class MetadataSources(PreferencesPlugin):
|
||||||
|
name = 'Metadata download'
|
||||||
|
icon = I('metadata.png')
|
||||||
|
gui_name = _('Metadata download')
|
||||||
|
category = 'Sharing'
|
||||||
|
gui_category = _('Sharing')
|
||||||
|
category_order = 4
|
||||||
|
name_order = 3
|
||||||
|
config_widget = 'calibre.gui2.preferences.metadata_sources'
|
||||||
|
description = _('Control how calibre downloads ebook metadata from the net')
|
||||||
|
|
||||||
class Plugins(PreferencesPlugin):
|
class Plugins(PreferencesPlugin):
|
||||||
name = 'Plugins'
|
name = 'Plugins'
|
||||||
icon = I('plugins.png')
|
icon = I('plugins.png')
|
||||||
@ -1076,6 +1087,9 @@ plugins += [LookAndFeel, Behavior, Columns, Toolbar, Search, InputOptions,
|
|||||||
CommonOptions, OutputOptions, Adding, Saving, Sending, Plugboard,
|
CommonOptions, OutputOptions, Adding, Saving, Sending, Plugboard,
|
||||||
Email, Server, Plugins, Tweaks, Misc, TemplateFunctions]
|
Email, Server, Plugins, Tweaks, Misc, TemplateFunctions]
|
||||||
|
|
||||||
|
if test_eight_code:
|
||||||
|
plugins.append(MetadataSources)
|
||||||
|
|
||||||
#}}}
|
#}}}
|
||||||
|
|
||||||
|
|
||||||
|
@ -341,9 +341,9 @@ class Amazon(Source):
|
|||||||
# Insufficient metadata to make an identify query
|
# Insufficient metadata to make an identify query
|
||||||
return None
|
return None
|
||||||
|
|
||||||
utf8q = dict([(x.encode('utf-8'), y.encode('utf-8')) for x, y in
|
latin1q = dict([(x.encode('latin1'), y.encode('latin1')) for x, y in
|
||||||
q.iteritems()])
|
q.iteritems()])
|
||||||
url = 'http://www.amazon.%s/s/?'%domain + urlencode(utf8q)
|
url = 'http://www.amazon.%s/s/?'%domain + urlencode(latin1q)
|
||||||
return url
|
return url
|
||||||
|
|
||||||
# }}}
|
# }}}
|
||||||
|
@ -7,5 +7,14 @@ __license__ = 'GPL v3'
|
|||||||
__copyright__ = '2011, Kovid Goyal <kovid@kovidgoyal.net>'
|
__copyright__ = '2011, Kovid Goyal <kovid@kovidgoyal.net>'
|
||||||
__docformat__ = 'restructuredtext en'
|
__docformat__ = 'restructuredtext en'
|
||||||
|
|
||||||
|
from calibre.gui2.preferences import ConfigWidgetBase, test_widget
|
||||||
|
from calibre.gui2.preferences.metadata_sources_ui import Ui_Form
|
||||||
|
|
||||||
|
class ConfigWidget(ConfigWidgetBase, Ui_Form):
|
||||||
|
pass
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
from PyQt4.Qt import QApplication
|
||||||
|
app = QApplication([])
|
||||||
|
test_widget('Interface', 'Behavior')
|
||||||
|
|
||||||
|
@ -1,116 +1,125 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<ui version="4.0">
|
<ui version="4.0">
|
||||||
<class>StackedWidget</class>
|
<class>Form</class>
|
||||||
<widget class="QStackedWidget" name="StackedWidget">
|
<widget class="QWidget" name="Form">
|
||||||
<property name="geometry">
|
<property name="geometry">
|
||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>766</width>
|
<width>781</width>
|
||||||
<height>447</height>
|
<height>300</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
<string>StackedWidget</string>
|
<string>Form</string>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QWidget" name="page">
|
<layout class="QVBoxLayout" name="verticalLayout">
|
||||||
<layout class="QGridLayout" name="gridLayout">
|
<property name="margin">
|
||||||
<item row="0" column="0" rowspan="5">
|
<number>0</number>
|
||||||
<widget class="QGroupBox" name="groupBox">
|
</property>
|
||||||
<property name="title">
|
<item>
|
||||||
<string>Metadata sources</string>
|
<widget class="QStackedWidget" name="stack">
|
||||||
</property>
|
<widget class="QWidget" name="page">
|
||||||
<layout class="QVBoxLayout" name="verticalLayout">
|
<layout class="QGridLayout" name="gridLayout">
|
||||||
<item>
|
<item row="0" column="0" rowspan="5">
|
||||||
<widget class="QLabel" name="label">
|
<widget class="QGroupBox" name="groupBox">
|
||||||
<property name="text">
|
<property name="title">
|
||||||
<string><p>Disable any metadata sources you do not want by unchecking them. You can also set the cover priority. Covers from sources that have a higher (smaller) priority will be preferred when bulk downloading metadata.
|
<string>Metadata sources</string>
|
||||||
|
</property>
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout_3">
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="label">
|
||||||
|
<property name="text">
|
||||||
|
<string><p>Disable any metadata sources you do not want by unchecking them. You can also set the cover priority. Covers from sources that have a higher (smaller) priority will be preferred when bulk downloading metadata.
|
||||||
<p>Double click on a metadata source to customize it.</string>
|
<p>Double click on a metadata source to customize it.</string>
|
||||||
|
</property>
|
||||||
|
<property name="wordWrap">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QTableView" name="sources_list"/>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="1" colspan="2">
|
||||||
|
<widget class="QGroupBox" name="groupBox_2">
|
||||||
|
<property name="title">
|
||||||
|
<string>Downloaded metadata fields</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="wordWrap">
|
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||||
<bool>true</bool>
|
<item>
|
||||||
|
<widget class="QListView" name="fields_list">
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>If you uncheck any fields, metadata for those fields will not be downloaded</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="1" colspan="2">
|
||||||
|
<widget class="QCheckBox" name="opt_txt_comments">
|
||||||
|
<property name="text">
|
||||||
|
<string>Convert all downloaded comments to plain &text</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item row="2" column="1">
|
||||||
<widget class="QTableView" name="sources_list"/>
|
<widget class="QLabel" name="label_2">
|
||||||
|
<property name="text">
|
||||||
|
<string>Max. number of &tags to download:</string>
|
||||||
|
</property>
|
||||||
|
<property name="buddy">
|
||||||
|
<cstring>opt_max_tags</cstring>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
<item row="2" column="2">
|
||||||
</widget>
|
<widget class="QSpinBox" name="opt_max_tags"/>
|
||||||
</item>
|
</item>
|
||||||
<item row="0" column="1" colspan="2">
|
<item row="3" column="1">
|
||||||
<widget class="QGroupBox" name="groupBox_2">
|
<widget class="QLabel" name="label_3">
|
||||||
<property name="title">
|
<property name="text">
|
||||||
<string>Downloaded metadata fields</string>
|
<string>Max. &time to wait after first match is found:</string>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
<property name="buddy">
|
||||||
<item>
|
<cstring>opt_wait_after_first_identify_result</cstring>
|
||||||
<widget class="QListView" name="fields_list">
|
</property>
|
||||||
<property name="toolTip">
|
</widget>
|
||||||
<string>If you uncheck any fields, metadata for those fields will not be downloaded</string>
|
</item>
|
||||||
|
<item row="3" column="2">
|
||||||
|
<widget class="QSpinBox" name="opt_wait_after_first_identify_result">
|
||||||
|
<property name="suffix">
|
||||||
|
<string> secs</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="4" column="1">
|
||||||
|
<widget class="QLabel" name="label_4">
|
||||||
|
<property name="text">
|
||||||
|
<string>Max. time to wait after &cover is found:</string>
|
||||||
|
</property>
|
||||||
|
<property name="buddy">
|
||||||
|
<cstring>opt_wait_after_first_cover_result</cstring>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="4" column="2">
|
||||||
|
<widget class="QSpinBox" name="opt_wait_after_first_cover_result">
|
||||||
|
<property name="suffix">
|
||||||
|
<string> secs</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
<widget class="QWidget" name="page_2"/>
|
||||||
<item row="1" column="1" colspan="2">
|
</widget>
|
||||||
<widget class="QCheckBox" name="opt_txt_comments">
|
</item>
|
||||||
<property name="text">
|
</layout>
|
||||||
<string>Convert all downloaded comments to plain &text</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="2" column="1">
|
|
||||||
<widget class="QLabel" name="label_2">
|
|
||||||
<property name="text">
|
|
||||||
<string>Max. number of &tags to download:</string>
|
|
||||||
</property>
|
|
||||||
<property name="buddy">
|
|
||||||
<cstring>opt_max_tags</cstring>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="2" column="2">
|
|
||||||
<widget class="QSpinBox" name="opt_max_tags"/>
|
|
||||||
</item>
|
|
||||||
<item row="3" column="1">
|
|
||||||
<widget class="QLabel" name="label_3">
|
|
||||||
<property name="text">
|
|
||||||
<string>Max. &time to wait after first match is found:</string>
|
|
||||||
</property>
|
|
||||||
<property name="buddy">
|
|
||||||
<cstring>opt_wait_after_first_identify_result</cstring>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="3" column="2">
|
|
||||||
<widget class="QSpinBox" name="opt_wait_after_first_identify_result">
|
|
||||||
<property name="suffix">
|
|
||||||
<string> secs</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="4" column="1">
|
|
||||||
<widget class="QLabel" name="label_4">
|
|
||||||
<property name="text">
|
|
||||||
<string>Max. time to wait after &cover is found:</string>
|
|
||||||
</property>
|
|
||||||
<property name="buddy">
|
|
||||||
<cstring>opt_wait_after_first_cover_result</cstring>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="4" column="2">
|
|
||||||
<widget class="QSpinBox" name="opt_wait_after_first_cover_result">
|
|
||||||
<property name="suffix">
|
|
||||||
<string> secs</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</widget>
|
|
||||||
<widget class="QWidget" name="page"/>
|
|
||||||
</widget>
|
</widget>
|
||||||
<resources/>
|
<resources/>
|
||||||
<connections/>
|
<connections/>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user