String changes

This commit is contained in:
Kovid Goyal 2021-03-08 17:08:16 +05:30
parent bc1fda2a1f
commit 54c56b9d0e
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
10 changed files with 14 additions and 14 deletions

View File

@ -30,7 +30,7 @@ and enter the following Python code into it:
:lines: 10- :lines: 10-
That's all. To add this code to calibre as a plugin, simply run the following in That's all. To add this code to calibre as a plugin, simply run the following in
the directory in which you created :file:`__init__.py`:: the folder in which you created :file:`__init__.py`::
calibre-customize -b . calibre-customize -b .
@ -71,7 +71,7 @@ The first thing to note is that this ZIP file has a lot more files in it, explai
The prefix ``calibre_plugins`` must always be present. ``some_name`` comes from the filename of the empty text file. The prefix ``calibre_plugins`` must always be present. ``some_name`` comes from the filename of the empty text file.
``some_module`` refers to :file:`some_module.py` file inside the ZIP file. Note that this importing is just as ``some_module`` refers to :file:`some_module.py` file inside the ZIP file. Note that this importing is just as
powerful as regular Python imports. You can create packages and subpackages of .py modules inside the ZIP file, powerful as regular Python imports. You can create packages and subpackages of .py modules inside the ZIP file,
just like you would normally (by defining __init__.py in each sub-directory), and everything should "just work". just like you would normally (by defining __init__.py in each sub-folder), and everything should "just work".
The name you use for ``some_name`` enters a global namespace shared by all plugins, **so make it as unique as possible**. The name you use for ``some_name`` enters a global namespace shared by all plugins, **so make it as unique as possible**.
But remember that it must be a valid Python identifier (only alphabets, numbers and the underscore). But remember that it must be a valid Python identifier (only alphabets, numbers and the underscore).
@ -139,7 +139,7 @@ calibre's plugin loading system defines a couple of built-in functions that allo
**get_resources(name_or_list_of_names)** **get_resources(name_or_list_of_names)**
This function should be called with a list of paths to files inside the ZIP file. For example to access the file icon.png in This function should be called with a list of paths to files inside the ZIP file. For example to access the file icon.png in
the directory images in the ZIP file, you would use: ``images/icon.png``. Always use a forward slash as the path separator, the folder images in the ZIP file, you would use: ``images/icon.png``. Always use a forward slash as the path separator,
even on Windows. When you pass in a single name, the function will return the raw bytes of that file or None if the name even on Windows. When you pass in a single name, the function will return the raw bytes of that file or None if the name
was not found in the ZIP file. If you pass in more than one name then it returns a dict mapping the names to bytes. was not found in the ZIP file. If you pass in more than one name then it returns a dict mapping the names to bytes.
If a name is not found, it will not be present in the returned dict. If a name is not found, it will not be present in the returned dict.
@ -254,7 +254,7 @@ Running User Interface plugins in a separate process
If you are writing a user interface plugin that needs to make use If you are writing a user interface plugin that needs to make use
of Qt WebEngine, it cannot be run in the main calibre process as it of Qt WebEngine, it cannot be run in the main calibre process as it
is not possible to use WebEngine there. Instead you can copy the data is not possible to use WebEngine there. Instead you can copy the data
your plugin needs to a temporary directory and run the plugin with that your plugin needs to a temporary folder and run the plugin with that
data in a separate process. A simple example plugin follows that shows how data in a separate process. A simple example plugin follows that shows how
to do this. to do this.
@ -338,7 +338,7 @@ You can insert print statements anywhere in your plugin code, they will be outpu
You can quickly test changes to your plugin by using the following command You can quickly test changes to your plugin by using the following command
line:: line::
calibre-debug -s; calibre-customize -b /path/to/your/plugin/directory; calibre calibre-debug -s; calibre-customize -b /path/to/your/plugin/folder; calibre
This will shutdown a running calibre, wait for the shutdown to complete, then update your plugin in calibre and relaunch calibre. This will shutdown a running calibre, wait for the shutdown to complete, then update your plugin in calibre and relaunch calibre.

View File

@ -83,7 +83,7 @@ choose to install calibre.
You should not change the files in this resources folder, as your changes will You should not change the files in this resources folder, as your changes will
get overwritten the next time you update calibre. Instead, go to get overwritten the next time you update calibre. Instead, go to
:guilabel:`Preferences->Advanced->Miscellaneous` and click :guilabel:`Preferences->Advanced->Miscellaneous` and click
:guilabel:`Open calibre configuration directory`. In this configuration directory, create a :guilabel:`Open calibre configuration folder`. In this configuration directory, create a
sub-folder called resources and place the files you want to override in it. sub-folder called resources and place the files you want to override in it.
Place the files in the appropriate sub folders, for example place images in Place the files in the appropriate sub folders, for example place images in
:file:`resources/images`, etc. calibre will automatically use your custom file :file:`resources/images`, etc. calibre will automatically use your custom file

View File

@ -103,5 +103,5 @@ that carry both DRMed as well as DRM-free books, not knowing if they carry DRM
or not make it a point to leave a comment or review on the website informing or not make it a point to leave a comment or review on the website informing
future buyers of its DRM status. Many sellers do not think it important to future buyers of its DRM status. Many sellers do not think it important to
clearly indicate to their buyers if an e-book carries DRM or not. `Here clearly indicate to their buyers if an e-book carries DRM or not. `Here
<https://www.defectivebydesign.org/guide/ebooks>` you will find a Guide to <https://www.defectivebydesign.org/guide/ebooks>` you will find a guide to
DRM-free living. DRM-free living.

View File

@ -441,7 +441,7 @@ In General Program Mode the functions described in `Single Function Mode` requir
* ``ondevice()`` -- return the string ``'Yes'`` if ``ondevice`` is set, otherwise return the empty string. * ``ondevice()`` -- return the string ``'Yes'`` if ``ondevice`` is set, otherwise return the empty string.
* ``or(value, value, ...)`` -- returns the string ``"1"`` if any value is not empty, otherwise returns the empty string. You can have as many values as you want. This function can usually be replaced by the ``||`` operator. A reason it cannot be replaced is if short-circuiting will change the results because of side effects. * ``or(value, value, ...)`` -- returns the string ``"1"`` if any value is not empty, otherwise returns the empty string. You can have as many values as you want. This function can usually be replaced by the ``||`` operator. A reason it cannot be replaced is if short-circuiting will change the results because of side effects.
* ``print(a, b, ...)`` -- prints the arguments to standard output. Unless you start calibre from the command line (``calibre-debug -g``), the output will go to a black hole. The ``print`` function always returns the empty string. * ``print(a, b, ...)`` -- prints the arguments to standard output. Unless you start calibre from the command line (``calibre-debug -g``), the output will go to a black hole. The ``print`` function always returns the empty string.
* ``raw_field(lookup_name [, optional_default]))`` -- returns the metadata field named by ``lookup_name`` without applying any formatting. It evaluates and returns the optional second argument ``optional_default`` if the field's value is undefined (``None``). * ``raw_field(lookup_name [, optional_default])`` -- returns the metadata field named by ``lookup_name`` without applying any formatting. It evaluates and returns the optional second argument ``optional_default`` if the field's value is undefined (``None``).
* ``raw_list(lookup_name, separator)`` -- returns the metadata list named by ``lookup_name`` without applying any formatting or sorting, with the items separated by separator. * ``raw_list(lookup_name, separator)`` -- returns the metadata list named by ``lookup_name`` without applying any formatting or sorting, with the items separated by separator.
* ``re_group(value, pattern, template_for_group_1, for_group_2, ...)`` -- return a string made by applying the regular expression pattern to ``value`` and replacing each matched instance with the the value returned by the corresponding template. In Template Program Mode, like for the ``template`` and the ``eval`` functions, you use ``[[`` for ``{`` and ``]]`` for ``}``. * ``re_group(value, pattern, template_for_group_1, for_group_2, ...)`` -- return a string made by applying the regular expression pattern to ``value`` and replacing each matched instance with the the value returned by the corresponding template. In Template Program Mode, like for the ``template`` and the ``eval`` functions, you use ``[[`` for ``{`` and ``]]`` for ``}``.

View File

@ -327,7 +327,7 @@ class OutputFormatPlugin(Plugin):
:class:`calibre.ebooks.oeb.OEBBook`) to the file specified by output. :class:`calibre.ebooks.oeb.OEBBook`) to the file specified by output.
:param output: Either a file like object or a string. If it is a string :param output: Either a file like object or a string. If it is a string
it is the path to a directory that may or may not exist. The output it is the path to a folder that may or may not exist. The output
plugin should write its output into that directory. If it is a file like plugin should write its output into that directory. If it is a file like
object, the output plugin should write its output into the file. object, the output plugin should write its output into the file.
:param input_plugin: The input plugin that was used at the beginning of :param input_plugin: The input plugin that was used at the beginning of

View File

@ -225,7 +225,7 @@ class Container(ContainerBase): # {{{
A container represents an Open E-Book as a directory full of files and an A container represents an Open E-Book as a directory full of files and an
opf file. There are two important concepts: opf file. There are two important concepts:
* The root directory. This is the base of the e-book. All the e-books * The root folder. This is the base of the e-book. All the e-books
files are inside this directory or in its sub-directories. files are inside this directory or in its sub-directories.
* Names: These are paths to the books' files relative to the root * Names: These are paths to the books' files relative to the root

View File

@ -92,7 +92,7 @@ class GenerateCatalogAction(InterfaceAction):
self.gui.status_bar.show_message(_('Catalog generated.'), 3000) self.gui.status_bar.show_message(_('Catalog generated.'), 3000)
self.gui.sync_catalogs() self.gui.sync_catalogs()
if not dynamic.get('catalog_add_to_library', True) or job.fmt not in {'EPUB','MOBI', 'AZW3'}: if not dynamic.get('catalog_add_to_library', True) or job.fmt not in {'EPUB','MOBI', 'AZW3'}:
export_dir = choose_dir(self.gui, _('Export Catalog Directory'), export_dir = choose_dir(self.gui, _('Export Catalog Folder'),
_('Select destination for %(title)s.%(fmt)s') % dict( _('Select destination for %(title)s.%(fmt)s') % dict(
title=job.catalog_title, fmt=job.fmt.lower())) title=job.catalog_title, fmt=job.fmt.lower()))
if export_dir: if export_dir:

View File

@ -86,7 +86,7 @@
<item row="2" column="0"> <item row="2" column="0">
<widget class="QCheckBox" name="opt_use_subdirs"> <widget class="QCheckBox" name="opt_use_subdirs">
<property name="toolTip"> <property name="toolTip">
<string>If checked, books are placed into sub-directories based on their metadata on the device. If unchecked, books are all put into the top level directory.</string> <string>If checked, books are placed into sub-folders based on their metadata on the device. If unchecked, books are all put into the top level directory.</string>
</property> </property>
<property name="text"> <property name="text">
<string>Use sub-directories</string> <string>Use sub-directories</string>

View File

@ -964,7 +964,7 @@ class EditRules(QWidget): # {{{
hb.addWidget(b) hb.addWidget(b)
hb.addStretch(10) hb.addStretch(10)
self.open_icon_folder_button = b = QPushButton(QIcon(I('icon_choose.png')), self.open_icon_folder_button = b = QPushButton(QIcon(I('icon_choose.png')),
_('Open icon directory'), self) _('Open icon folder'), self)
connect_lambda(b.clicked, self, connect_lambda(b.clicked, self,
lambda _: open_local_file(os.path.join(config_dir, 'cc_icons'))) lambda _: open_local_file(os.path.join(config_dir, 'cc_icons')))
hb.addWidget(b) hb.addWidget(b)

View File

@ -623,7 +623,7 @@ A value of zero means calculate automatically.</string>
<item row="4" column="1"> <item row="4" column="1">
<widget class="QPushButton" name="cover_grid_open_cache"> <widget class="QPushButton" name="cover_grid_open_cache">
<property name="text"> <property name="text">
<string>&amp;Open cache directory</string> <string>&amp;Open cache folder</string>
</property> </property>
</widget> </widget>
</item> </item>