mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
string changes
This commit is contained in:
parent
302784a6d9
commit
5aec473530
@ -1481,7 +1481,7 @@ If you turn on dark mode under the Windows Settings->Personalisation->Colors and
|
|||||||
|
|
||||||
- [1656573] Viewer: Fix hang when using --open-at with single instance viewer and the specified location is already open.
|
- [1656573] Viewer: Fix hang when using --open-at with single instance viewer and the specified location is already open.
|
||||||
|
|
||||||
- [1853232] Viewer: Fix opening .txt files in the standalone viewer leaving behind a temporary index.html file in the directory of the txt file.
|
- [1853232] Viewer: Fix opening .txt files in the standalone viewer leaving behind a temporary index.html file in the folder of the txt file.
|
||||||
|
|
||||||
- Linux: Make some cache removal code robust against un-decodeable filenames in the cache directories
|
- Linux: Make some cache removal code robust against un-decodeable filenames in the cache directories
|
||||||
|
|
||||||
|
@ -256,7 +256,7 @@ end:
|
|||||||
|
|
||||||
// }}}
|
// }}}
|
||||||
|
|
||||||
// Find calibre portable directory and install/upgrade into it {{{
|
// Find calibre portable folder and install/upgrade into it {{{
|
||||||
|
|
||||||
static BOOL directory_exists( LPCWSTR path )
|
static BOOL directory_exists( LPCWSTR path )
|
||||||
{
|
{
|
||||||
@ -529,7 +529,7 @@ int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, PWSTR pCmdLine
|
|||||||
hr = CoInitialize(NULL);
|
hr = CoInitialize(NULL);
|
||||||
if (FAILED(hr)) { show_error(L"Failed to initialize COM"); return ret; }
|
if (FAILED(hr)) { show_error(L"Failed to initialize COM"); return ret; }
|
||||||
|
|
||||||
// Get the target directory for installation
|
// Get the target folder for installation
|
||||||
argv = CommandLineToArgvW(GetCommandLine(), &argc);
|
argv = CommandLineToArgvW(GetCommandLine(), &argc);
|
||||||
if (argv == NULL) { show_last_error(L"Failed to get command line"); return ret; }
|
if (argv == NULL) { show_last_error(L"Failed to get command line"); return ret; }
|
||||||
if (argc > 1) {
|
if (argc > 1) {
|
||||||
@ -549,7 +549,7 @@ int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, PWSTR pCmdLine
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!directory_exists(tgt)) {
|
if (!directory_exists(tgt)) {
|
||||||
show_detailed_error(L"The specified directory does not exist: ",
|
show_detailed_error(L"The specified folder does not exist: ",
|
||||||
tgt, 1);
|
tgt, 1);
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
@ -589,10 +589,10 @@ int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, PWSTR pCmdLine
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Make a temp dir to unpack into
|
// Make a temp dir to unpack into
|
||||||
if (!SetCurrentDirectoryW(fdest)) { show_detailed_error(L"Failed to change to unzip directory: ", fdest, 0); goto end; }
|
if (!SetCurrentDirectoryW(fdest)) { show_detailed_error(L"Failed to change to unzip folder: ", fdest, 0); goto end; }
|
||||||
|
|
||||||
if ( (unpack_dir = make_unpack_dir()) == NULL ) goto end;
|
if ( (unpack_dir = make_unpack_dir()) == NULL ) goto end;
|
||||||
if (!SetCurrentDirectoryW(unpack_dir)) { show_detailed_error(L"Failed to change to unpack directory: ", fdest, 0); goto end; }
|
if (!SetCurrentDirectoryW(unpack_dir)) { show_detailed_error(L"Failed to change to unpack folder: ", fdest, 0); goto end; }
|
||||||
|
|
||||||
// Extract files
|
// Extract files
|
||||||
if (!extract(cdata, csz)) goto end;
|
if (!extract(cdata, csz)) goto end;
|
||||||
|
@ -108,7 +108,7 @@ changes, then run::
|
|||||||
git commit -am "Comment describing your changes"
|
git commit -am "Comment describing your changes"
|
||||||
git format-patch origin/master --stdout > my-changes
|
git format-patch origin/master --stdout > my-changes
|
||||||
|
|
||||||
This will create a :file:`my-changes` file in the current directory,
|
This will create a :file:`my-changes` file in the current folder,
|
||||||
simply attach that to a ticket on the calibre `bug tracker <https://bugs.launchpad.net/calibre>`_.
|
simply attach that to a ticket on the calibre `bug tracker <https://bugs.launchpad.net/calibre>`_.
|
||||||
Note that this will include *all* the commits you have made. If you only want
|
Note that this will include *all* the commits you have made. If you only want
|
||||||
to send some commits, you have to change ``origin/master`` above. To send only
|
to send some commits, you have to change ``origin/master`` above. To send only
|
||||||
@ -158,13 +158,13 @@ Windows development environment
|
|||||||
.. note:: You must also get the calibre source code separately as described above.
|
.. note:: You must also get the calibre source code separately as described above.
|
||||||
|
|
||||||
Install calibre normally, using the Windows installer. Then open a Command Prompt and change to
|
Install calibre normally, using the Windows installer. Then open a Command Prompt and change to
|
||||||
the previously checked out calibre code directory. For example::
|
the previously checked out calibre code folder. For example::
|
||||||
|
|
||||||
cd C:\Users\kovid\work\calibre
|
cd C:\Users\kovid\work\calibre
|
||||||
|
|
||||||
calibre is the directory that contains the src and resources sub-directories.
|
calibre is the folder that contains the src and resources sub-folders.
|
||||||
|
|
||||||
The next step is to set the environment variable ``CALIBRE_DEVELOP_FROM`` to the absolute path of the src directory.
|
The next step is to set the environment variable ``CALIBRE_DEVELOP_FROM`` to the absolute path of the src folder.
|
||||||
So, following the example above, it would be ``C:\Users\kovid\work\calibre\src``. `Here is a short
|
So, following the example above, it would be ``C:\Users\kovid\work\calibre\src``. `Here is a short
|
||||||
guide <https://docs.python.org/using/windows.html#excursus-setting-environment-variables>`_ to setting environment
|
guide <https://docs.python.org/using/windows.html#excursus-setting-environment-variables>`_ to setting environment
|
||||||
variables on Windows.
|
variables on Windows.
|
||||||
@ -192,17 +192,17 @@ macOS development environment
|
|||||||
.. note:: You must also get the calibre source code separately as described above.
|
.. note:: You must also get the calibre source code separately as described above.
|
||||||
|
|
||||||
Install calibre normally using the provided .dmg. Then open a Terminal and change to
|
Install calibre normally using the provided .dmg. Then open a Terminal and change to
|
||||||
the previously checked out calibre code directory, for example::
|
the previously checked out calibre code folder, for example::
|
||||||
|
|
||||||
cd /Users/kovid/work/calibre
|
cd /Users/kovid/work/calibre
|
||||||
|
|
||||||
calibre is the directory that contains the src and resources sub-directories.
|
calibre is the folder that contains the src and resources sub-folders.
|
||||||
The calibre command line tools are found inside the calibre app bundle, in
|
The calibre command line tools are found inside the calibre app bundle, in
|
||||||
:file:`/Applications/calibre.app/Contents/MacOS`
|
:file:`/Applications/calibre.app/Contents/MacOS`
|
||||||
you should add this directory to your PATH environment variable, if you want to
|
you should add this folder to your PATH environment variable, if you want to
|
||||||
run the command line tools easily.
|
run the command line tools easily.
|
||||||
|
|
||||||
The next step is to create a bash script that will set the environment variable ``CALIBRE_DEVELOP_FROM`` to the absolute path of the src directory when running calibre in debug mode.
|
The next step is to create a bash script that will set the environment variable ``CALIBRE_DEVELOP_FROM`` to the absolute path of the src folder when running calibre in debug mode.
|
||||||
|
|
||||||
Create a plain text file::
|
Create a plain text file::
|
||||||
|
|
||||||
@ -233,13 +233,13 @@ used in Windows and macOS. Alternatively, you can install calibre from source. I
|
|||||||
environment from source are in the INSTALL file in the source tree. Here we will address using the binary as a runtime, which is the
|
environment from source are in the INSTALL file in the source tree. Here we will address using the binary as a runtime, which is the
|
||||||
recommended method.
|
recommended method.
|
||||||
|
|
||||||
Install calibre using the binary installer. Then open a terminal and change to the previously checked out calibre code directory, for example::
|
Install calibre using the binary installer. Then open a terminal and change to the previously checked out calibre code folder, for example::
|
||||||
|
|
||||||
cd /home/kovid/work/calibre
|
cd /home/kovid/work/calibre
|
||||||
|
|
||||||
calibre is the directory that contains the src and resources sub-directories.
|
calibre is the folder that contains the src and resources sub-folders.
|
||||||
|
|
||||||
The next step is to set the environment variable ``CALIBRE_DEVELOP_FROM`` to the absolute path of the src directory.
|
The next step is to set the environment variable ``CALIBRE_DEVELOP_FROM`` to the absolute path of the src folder.
|
||||||
So, following the example above, it would be ``/home/kovid/work/calibre/src``. How to set environment variables depends on
|
So, following the example above, it would be ``/home/kovid/work/calibre/src``. How to set environment variables depends on
|
||||||
your Linux distribution and what shell you are using.
|
your Linux distribution and what shell you are using.
|
||||||
|
|
||||||
@ -350,10 +350,10 @@ Using the debugger in your favorite Python IDE
|
|||||||
|
|
||||||
It is possible to use the builtin debugger in your favorite Python IDE, if it
|
It is possible to use the builtin debugger in your favorite Python IDE, if it
|
||||||
supports remote debugging. The first step is to add the calibre src checkout to
|
supports remote debugging. The first step is to add the calibre src checkout to
|
||||||
the ``PYTHONPATH`` in your IDE. In other words, the directory you set as
|
the ``PYTHONPATH`` in your IDE. In other words, the folder you set as
|
||||||
``CALIBRE_DEVELOP_FROM`` above, must also be in the ``PYTHONPATH`` of your IDE.
|
``CALIBRE_DEVELOP_FROM`` above, must also be in the ``PYTHONPATH`` of your IDE.
|
||||||
|
|
||||||
Then place the IDE's remote debugger module into the :file:`src` subdirectory
|
Then place the IDE's remote debugger module into the :file:`src` sub-folder
|
||||||
of the calibre source code checkout. Add whatever code is needed to launch the
|
of the calibre source code checkout. Add whatever code is needed to launch the
|
||||||
remote debugger to calibre at the point of interest, for example in the main
|
remote debugger to calibre at the point of interest, for example in the main
|
||||||
function. Then run calibre as normal. Your IDE should now be able to connect to
|
function. Then run calibre as normal. Your IDE should now be able to connect to
|
||||||
|
@ -45,9 +45,9 @@ Add books
|
|||||||
|adbi| The :guilabel:`Add books` action has seven variations accessed by doing a right-click on the button.
|
|adbi| The :guilabel:`Add books` action has seven variations accessed by doing a right-click on the button.
|
||||||
|
|
||||||
|
|
||||||
1. **Add books from a single directory**: Opens a file chooser dialog and allows you to specify which books in a directory should be added. This action is *context sensitive*, i.e. it depends on which :ref:`catalog <catalogs>` you have selected. If you have selected the :guilabel:`Library`, books will be added to the library. If you have selected the e-book reader device, the books will be uploaded to the device, and so on.
|
1. **Add books from a single folder**: Opens a file chooser dialog and allows you to specify which books in a folder should be added. This action is *context sensitive*, i.e. it depends on which :ref:`catalog <catalogs>` you have selected. If you have selected the :guilabel:`Library`, books will be added to the library. If you have selected the e-book reader device, the books will be uploaded to the device, and so on.
|
||||||
|
|
||||||
2. **Add books from directories and sub-directories**: Allows you to choose a directory. The directory and all its sub-directories are scanned recursively, and any e-books found are added to the library. You can choose whether to have calibre add all files present in a single directory to a single book record or multiple book records. calibre assumes that each directory contains a single book. All e-book files in a directory are assumed to be the same book in different formats. This action is the inverse of the :ref:`Save to disk <save_to_disk_multiple>` action, i.e. you can :guilabel:`Save to disk`, delete the books and re-add them in single book per directory mode, with no lost information except for the date (this assumes you have not changed any of the setting for the Save to disk action).
|
2. **Add books from folders and sub-folders**: Allows you to choose a folder. The folder and all its sub-folders are scanned recursively, and any e-books found are added to the library. You can choose whether to have calibre add all files present in a single folder to a single book record or multiple book records. calibre assumes that each folder contains a single book. All e-book files in a folder are assumed to be the same book in different formats. This action is the inverse of the :ref:`Save to disk <save_to_disk_multiple>` action, i.e. you can :guilabel:`Save to disk`, delete the books and re-add them in single book per folder mode, with no lost information except for the date (this assumes you have not changed any of the setting for the Save to disk action).
|
||||||
|
|
||||||
3. **Add multiple books from archive (ZIP/RAR)**: Allows you to add multiple e-books that are stored inside the selected ZIP or RAR files. It is a convenient shortcut that avoids having to first unzip the archive and then add the books via one of the above two options.
|
3. **Add multiple books from archive (ZIP/RAR)**: Allows you to add multiple e-books that are stored inside the selected ZIP or RAR files. It is a convenient shortcut that avoids having to first unzip the archive and then add the books via one of the above two options.
|
||||||
|
|
||||||
@ -211,7 +211,7 @@ Save to disk
|
|||||||
|
|
||||||
.. _save_to_disk_multiple:
|
.. _save_to_disk_multiple:
|
||||||
|
|
||||||
1. **Save to disk**: Saves the selected books to disk organized in directories. The directory structure looks like::
|
1. **Save to disk**: Saves the selected books to disk organized in folders. The folder structure looks like::
|
||||||
|
|
||||||
Author_(sort)
|
Author_(sort)
|
||||||
Title
|
Title
|
||||||
@ -222,15 +222,15 @@ Save to disk
|
|||||||
|
|
||||||
.. _save_to_disk_single:
|
.. _save_to_disk_single:
|
||||||
|
|
||||||
2. **Save to disk in a single directory**: Saves the selected books to disk in a single directory.
|
2. **Save to disk in a single folder**: Saves the selected books to disk in a single folder.
|
||||||
|
|
||||||
For 1. and 2., all available formats, as well as metadata, are stored to disk for each selected book. Metadata is stored in an OPF file. Saved books can be re-imported to the library without any loss of information by using the :ref:`Add books <add_books>` action.
|
For 1. and 2., all available formats, as well as metadata, are stored to disk for each selected book. Metadata is stored in an OPF file. Saved books can be re-imported to the library without any loss of information by using the :ref:`Add books <add_books>` action.
|
||||||
|
|
||||||
3. **Save only *<your preferred>* format to disk**: Saves the selected books to disk in the directory structure as shown in (1.) but only in your preferred e-book format. You can set your preferred format in :guilabel:`Preferences->Interface->Behaviour->Preferred output format`
|
3. **Save only *<your preferred>* format to disk**: Saves the selected books to disk in the folder structure as shown in (1.) but only in your preferred e-book format. You can set your preferred format in :guilabel:`Preferences->Interface->Behaviour->Preferred output format`
|
||||||
|
|
||||||
4. **Save only *<your preferred>* format to disk in a single directory**: Saves the selected books to disk in a single directory but only in your preferred e-book format. You can set your preferred format in :guilabel:`Preferences->Interface->Behaviour->Preferred output format`
|
4. **Save only *<your preferred>* format to disk in a single folder**: Saves the selected books to disk in a single folder but only in your preferred e-book format. You can set your preferred format in :guilabel:`Preferences->Interface->Behaviour->Preferred output format`
|
||||||
|
|
||||||
5. **Save single format to disk...**: Saves the selected books to disk in the directory structure as shown in (1.) but only in the format you select from the pop-out list.
|
5. **Save single format to disk...**: Saves the selected books to disk in the folder structure as shown in (1.) but only in the format you select from the pop-out list.
|
||||||
|
|
||||||
.. _connect_share:
|
.. _connect_share:
|
||||||
|
|
||||||
|
@ -307,8 +307,8 @@ def option_parser(get_parser, args):
|
|||||||
'''\
|
'''\
|
||||||
%prog add [options] file1 file2 file3 ...
|
%prog add [options] file1 file2 file3 ...
|
||||||
|
|
||||||
Add the specified files as books to the database. You can also specify directories, see
|
Add the specified files as books to the database. You can also specify folders, see
|
||||||
the directory related options below.
|
the folder related options below.
|
||||||
'''
|
'''
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
@ -413,7 +413,7 @@ the directory related options below.
|
|||||||
action='store_true',
|
action='store_true',
|
||||||
default=False,
|
default=False,
|
||||||
help=_(
|
help=_(
|
||||||
'Assume that each directory has only a single logical book and that all files in it are different e-book formats of that book'
|
'Assume that each folder has only a single logical book and that all files in it are different e-book formats of that book'
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
g.add_option(
|
g.add_option(
|
||||||
@ -421,7 +421,7 @@ the directory related options below.
|
|||||||
'--recurse',
|
'--recurse',
|
||||||
action='store_true',
|
action='store_true',
|
||||||
default=False,
|
default=False,
|
||||||
help=_('Process directories recursively')
|
help=_('Process folders recursively')
|
||||||
)
|
)
|
||||||
|
|
||||||
def fadd(opt, action, help):
|
def fadd(opt, action, help):
|
||||||
@ -441,14 +441,14 @@ the directory related options below.
|
|||||||
fadd(
|
fadd(
|
||||||
'--ignore', 'ignore',
|
'--ignore', 'ignore',
|
||||||
_(
|
_(
|
||||||
'A filename (glob) pattern, files matching this pattern will be ignored when scanning directories for files.'
|
'A filename (glob) pattern, files matching this pattern will be ignored when scanning folders for files.'
|
||||||
' Can be specified multiple times for multiple patterns. For e.g.: *.pdf will ignore all pdf files'
|
' Can be specified multiple times for multiple patterns. For e.g.: *.pdf will ignore all pdf files'
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
fadd(
|
fadd(
|
||||||
'--add', 'add',
|
'--add', 'add',
|
||||||
_(
|
_(
|
||||||
'A filename (glob) pattern, files matching this pattern will be added when scanning directories for files,'
|
'A filename (glob) pattern, files matching this pattern will be added when scanning folders for files,'
|
||||||
' even if they are not of a known e-book file type. Can be specified multiple times for multiple patterns.'
|
' even if they are not of a known e-book file type. Can be specified multiple times for multiple patterns.'
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
@ -59,14 +59,14 @@ an opf file). You can get id numbers from the search command.
|
|||||||
'--to-dir',
|
'--to-dir',
|
||||||
default='.',
|
default='.',
|
||||||
help=(
|
help=(
|
||||||
_('Export books to the specified directory. Default is') + ' %default'
|
_('Export books to the specified folder. Default is') + ' %default'
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
parser.add_option(
|
parser.add_option(
|
||||||
'--single-dir',
|
'--single-dir',
|
||||||
default=False,
|
default=False,
|
||||||
action='store_true',
|
action='store_true',
|
||||||
help=_('Export all books into a single directory')
|
help=_('Export all books into a single folder')
|
||||||
)
|
)
|
||||||
parser.add_option(
|
parser.add_option(
|
||||||
'--progress',
|
'--progress',
|
||||||
|
@ -22,7 +22,7 @@ def option_parser(get_parser, args):
|
|||||||
%prog restore_database [options]
|
%prog restore_database [options]
|
||||||
|
|
||||||
Restore this database from the metadata stored in OPF files in each
|
Restore this database from the metadata stored in OPF files in each
|
||||||
directory of the calibre library. This is useful if your metadata.db file
|
folder of the calibre library. This is useful if your metadata.db file
|
||||||
has been corrupted.
|
has been corrupted.
|
||||||
|
|
||||||
WARNING: This command completely regenerates your database. You will lose
|
WARNING: This command completely regenerates your database. You will lose
|
||||||
|
@ -73,7 +73,7 @@ Everything after the -- is passed to the script.
|
|||||||
parser.add_option('-t', '--edit-book', action='store_true',
|
parser.add_option('-t', '--edit-book', action='store_true',
|
||||||
help=_('Launch the calibre "Edit book" tool in debug mode.'))
|
help=_('Launch the calibre "Edit book" tool in debug mode.'))
|
||||||
parser.add_option('-x', '--explode-book', default=False, action='store_true',
|
parser.add_option('-x', '--explode-book', default=False, action='store_true',
|
||||||
help=_('Explode the book into the specified directory.\nUsage: '
|
help=_('Explode the book into the specified folder.\nUsage: '
|
||||||
'-x file.epub output_dir\n'
|
'-x file.epub output_dir\n'
|
||||||
'Exports the book as a collection of HTML '
|
'Exports the book as a collection of HTML '
|
||||||
'files and metadata, which you can edit using standard HTML '
|
'files and metadata, which you can edit using standard HTML '
|
||||||
@ -85,9 +85,9 @@ Everything after the -- is passed to the script.
|
|||||||
' specify the same file type as was used when exploding.'))
|
' specify the same file type as was used when exploding.'))
|
||||||
parser.add_option('--export-all-calibre-data', default=False, action='store_true',
|
parser.add_option('--export-all-calibre-data', default=False, action='store_true',
|
||||||
help=_('Export all calibre data (books/settings/plugins). Normally, you will'
|
help=_('Export all calibre data (books/settings/plugins). Normally, you will'
|
||||||
' be asked for the export dir and the libraries to export. You can also specify them'
|
' be asked for the export folder and the libraries to export. You can also specify them'
|
||||||
' as command line arguments to skip the questions.'
|
' as command line arguments to skip the questions.'
|
||||||
' Use absolute paths for the export directory and libraries.'
|
' Use absolute paths for the export folder and libraries.'
|
||||||
' The special keyword "all" can be used to export all libraries.'))
|
' The special keyword "all" can be used to export all libraries.'))
|
||||||
parser.add_option('--import-calibre-data', default=False, action='store_true',
|
parser.add_option('--import-calibre-data', default=False, action='store_true',
|
||||||
help=_('Import previously exported calibre data'))
|
help=_('Import previously exported calibre data'))
|
||||||
|
@ -199,7 +199,7 @@ class BookUploadsGroupBox(DeviceOptionsGroupBox):
|
|||||||
_("Modify CSS"),
|
_("Modify CSS"),
|
||||||
_('This allows addition of user CSS rules and removal of some CSS. '
|
_('This allows addition of user CSS rules and removal of some CSS. '
|
||||||
'When sending a book, the driver adds the contents of {0} to all stylesheets in the EPUB. '
|
'When sending a book, the driver adds the contents of {0} to all stylesheets in the EPUB. '
|
||||||
'This file is searched for in the root directory of the main memory of the device. '
|
'This file is searched for in the root folder of the main memory of the device. '
|
||||||
'As well as this, if the file contains settings for the "orphans" or "widows", '
|
'As well as this, if the file contains settings for the "orphans" or "widows", '
|
||||||
'these are removed for all styles in the original stylesheet.').format(device.KOBO_EXTRA_CSSFILE),
|
'these are removed for all styles in the original stylesheet.').format(device.KOBO_EXTRA_CSSFILE),
|
||||||
device.get_pref('modify_css')
|
device.get_pref('modify_css')
|
||||||
|
@ -43,7 +43,7 @@ class DOCXOutput(OutputFormatPlugin):
|
|||||||
|
|
||||||
OptionRecommendation(name='extract_to',
|
OptionRecommendation(name='extract_to',
|
||||||
help=_('Extract the contents of the generated %s file to the '
|
help=_('Extract the contents of the generated %s file to the '
|
||||||
'specified directory. The contents of the directory are first '
|
'specified folder. The contents of the folder are first '
|
||||||
'deleted, so be careful.') % 'DOCX'),
|
'deleted, so be careful.') % 'DOCX'),
|
||||||
|
|
||||||
OptionRecommendation(name='docx_page_margin_left', recommended_value=72.0,
|
OptionRecommendation(name='docx_page_margin_left', recommended_value=72.0,
|
||||||
|
@ -54,7 +54,7 @@ class EPUBOutput(OutputFormatPlugin):
|
|||||||
options = {
|
options = {
|
||||||
OptionRecommendation(name='extract_to',
|
OptionRecommendation(name='extract_to',
|
||||||
help=_('Extract the contents of the generated %s file to the '
|
help=_('Extract the contents of the generated %s file to the '
|
||||||
'specified directory. The contents of the directory are first '
|
'specified folder. The contents of the folder are first '
|
||||||
'deleted, so be careful.') % 'EPUB'),
|
'deleted, so be careful.') % 'EPUB'),
|
||||||
|
|
||||||
OptionRecommendation(name='dont_split_on_page_breaks',
|
OptionRecommendation(name='dont_split_on_page_breaks',
|
||||||
|
@ -36,7 +36,7 @@ class HTMLOutput(OutputFormatPlugin):
|
|||||||
|
|
||||||
OptionRecommendation(name='extract_to',
|
OptionRecommendation(name='extract_to',
|
||||||
help=_('Extract the contents of the generated ZIP file to the '
|
help=_('Extract the contents of the generated ZIP file to the '
|
||||||
'specified directory. WARNING: The contents of the directory '
|
'specified folder. WARNING: The contents of the folder '
|
||||||
'will be deleted.')
|
'will be deleted.')
|
||||||
),
|
),
|
||||||
}
|
}
|
||||||
|
@ -81,7 +81,7 @@ class MOBIOutput(OutputFormatPlugin):
|
|||||||
),
|
),
|
||||||
OptionRecommendation(name='extract_to',
|
OptionRecommendation(name='extract_to',
|
||||||
help=_('Extract the contents of the generated %s file to the '
|
help=_('Extract the contents of the generated %s file to the '
|
||||||
'specified directory. The contents of the directory are first '
|
'specified folder. The contents of the folder are first '
|
||||||
'deleted, so be careful.') % 'MOBI'
|
'deleted, so be careful.') % 'MOBI'
|
||||||
),
|
),
|
||||||
OptionRecommendation(name='share_not_sync', recommended_value=False,
|
OptionRecommendation(name='share_not_sync', recommended_value=False,
|
||||||
@ -298,7 +298,7 @@ class AZW3Output(OutputFormatPlugin):
|
|||||||
),
|
),
|
||||||
OptionRecommendation(name='extract_to',
|
OptionRecommendation(name='extract_to',
|
||||||
help=_('Extract the contents of the generated %s file to the '
|
help=_('Extract the contents of the generated %s file to the '
|
||||||
'specified directory. The contents of the directory are first '
|
'specified folder. The contents of the folder are first '
|
||||||
'deleted, so be careful.') % 'AZW3'),
|
'deleted, so be careful.') % 'AZW3'),
|
||||||
OptionRecommendation(name='share_not_sync', recommended_value=False,
|
OptionRecommendation(name='share_not_sync', recommended_value=False,
|
||||||
help=_('Enable sharing of book content via Facebook etc. '
|
help=_('Enable sharing of book content via Facebook etc. '
|
||||||
|
@ -23,23 +23,23 @@ from calibre.constants import __version__
|
|||||||
from polyglot.builtins import unicode_type, string_or_bytes, map
|
from polyglot.builtins import unicode_type, string_or_bytes, map
|
||||||
|
|
||||||
DEBUG_README=b'''
|
DEBUG_README=b'''
|
||||||
This debug directory contains snapshots of the e-book as it passes through the
|
This debug folder contains snapshots of the e-book as it passes through the
|
||||||
various stages of conversion. The stages are:
|
various stages of conversion. The stages are:
|
||||||
|
|
||||||
1. input - This is the result of running the input plugin on the source
|
1. input - This is the result of running the input plugin on the source
|
||||||
file. Use this directory to debug the input plugin.
|
file. Use this folder to debug the input plugin.
|
||||||
|
|
||||||
2. parsed - This is the result of preprocessing and parsing the output of
|
2. parsed - This is the result of preprocessing and parsing the output of
|
||||||
the input plugin. Note that for some input plugins this will be identical to
|
the input plugin. Note that for some input plugins this will be identical to
|
||||||
the input sub-directory. Use this directory to debug structure detection,
|
the input sub-folder. Use this folder to debug structure detection,
|
||||||
etc.
|
etc.
|
||||||
|
|
||||||
3. structure - This corresponds to the stage in the pipeline when structure
|
3. structure - This corresponds to the stage in the pipeline when structure
|
||||||
detection has run, but before the CSS is flattened. Use this directory to
|
detection has run, but before the CSS is flattened. Use this folder to
|
||||||
debug the CSS flattening, font size conversion, etc.
|
debug the CSS flattening, font size conversion, etc.
|
||||||
|
|
||||||
4. processed - This corresponds to the e-book as it is passed to the output
|
4. processed - This corresponds to the e-book as it is passed to the output
|
||||||
plugin. Use this directory to debug the output plugin.
|
plugin. Use this folder to debug the output plugin.
|
||||||
|
|
||||||
'''
|
'''
|
||||||
|
|
||||||
@ -89,7 +89,7 @@ class Plumber(object):
|
|||||||
override_input_metadata=False, for_regex_wizard=False, view_kepub=False):
|
override_input_metadata=False, for_regex_wizard=False, view_kepub=False):
|
||||||
'''
|
'''
|
||||||
:param input: Path to input file.
|
:param input: Path to input file.
|
||||||
:param output: Path to output file/directory
|
:param output: Path to output file/folder
|
||||||
'''
|
'''
|
||||||
if isbytestring(input):
|
if isbytestring(input):
|
||||||
input = input.decode(filesystem_encoding)
|
input = input.decode(filesystem_encoding)
|
||||||
@ -123,7 +123,7 @@ OptionRecommendation(name='debug_pipeline',
|
|||||||
short_switch='d',
|
short_switch='d',
|
||||||
help=_('Save the output from different stages of the conversion '
|
help=_('Save the output from different stages of the conversion '
|
||||||
'pipeline to the specified '
|
'pipeline to the specified '
|
||||||
'directory. Useful if you are unsure at which stage '
|
'folder. Useful if you are unsure at which stage '
|
||||||
'of the conversion process a bug is occurring.')
|
'of the conversion process a bug is occurring.')
|
||||||
),
|
),
|
||||||
|
|
||||||
|
@ -142,7 +142,7 @@ class UniqueFilenames(object): # {{{
|
|||||||
|
|
||||||
class FlatFilenames(object): # {{{
|
class FlatFilenames(object): # {{{
|
||||||
|
|
||||||
'Ensure that every item in the manifest has a unique filename without subdirectories.'
|
'Ensure that every item in the manifest has a unique filename without subfolders.'
|
||||||
|
|
||||||
def __call__(self, oeb, opts):
|
def __call__(self, oeb, opts):
|
||||||
self.log = oeb.logger
|
self.log = oeb.logger
|
||||||
|
@ -53,7 +53,7 @@ class AddAction(InterfaceAction):
|
|||||||
, _('A'))
|
, _('A'))
|
||||||
action_type = 'current'
|
action_type = 'current'
|
||||||
action_add_menu = True
|
action_add_menu = True
|
||||||
action_menu_clone_qaction = _('Add books from a single directory')
|
action_menu_clone_qaction = _('Add books from a single folder')
|
||||||
|
|
||||||
def genesis(self):
|
def genesis(self):
|
||||||
self._add_filesystem_book = self.Dispatcher(self.__add_filesystem_book)
|
self._add_filesystem_book = self.Dispatcher(self.__add_filesystem_book)
|
||||||
@ -262,7 +262,7 @@ class AddAction(InterfaceAction):
|
|||||||
|
|
||||||
def add_from_archive(self):
|
def add_from_archive(self):
|
||||||
single = question_dialog(self.gui, _('Type of archive'), _(
|
single = question_dialog(self.gui, _('Type of archive'), _(
|
||||||
'Will the archive have a single book per internal directory?'))
|
'Will the archive have a single book per internal folder?'))
|
||||||
paths = choose_files(
|
paths = choose_files(
|
||||||
self.gui, 'recursive-archive-add', _('Choose archive file'),
|
self.gui, 'recursive-archive-add', _('Choose archive file'),
|
||||||
filters=[(_('Archives'), ('zip', 'rar'))], all_files=False, select_only_single_file=False)
|
filters=[(_('Archives'), ('zip', 'rar'))], all_files=False, select_only_single_file=False)
|
||||||
@ -301,7 +301,7 @@ class AddAction(InterfaceAction):
|
|||||||
|
|
||||||
def add_recursive_question(self):
|
def add_recursive_question(self):
|
||||||
single = question_dialog(self.gui, _('Multi-file books?'), _(
|
single = question_dialog(self.gui, _('Multi-file books?'), _(
|
||||||
'Assume all e-book files in a single directory are the same book in different formats?'))
|
'Assume all e-book files in a single folder are the same book in different formats?'))
|
||||||
self.add_recursive(single)
|
self.add_recursive(single)
|
||||||
|
|
||||||
def add_empty(self, *args):
|
def add_empty(self, *args):
|
||||||
|
@ -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 Folder'),
|
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:
|
||||||
|
@ -28,13 +28,13 @@ class SaveToDiskAction(InterfaceAction):
|
|||||||
self.qaction.triggered.connect(self.save_to_disk)
|
self.qaction.triggered.connect(self.save_to_disk)
|
||||||
self.save_menu = self.qaction.menu()
|
self.save_menu = self.qaction.menu()
|
||||||
cm = partial(self.create_menu_action, self.save_menu)
|
cm = partial(self.create_menu_action, self.save_menu)
|
||||||
cm('single dir', _('Save to disk in a single directory'),
|
cm('single dir', _('Save to disk in a single folder'),
|
||||||
triggered=partial(self.save_to_single_dir, False))
|
triggered=partial(self.save_to_single_dir, False))
|
||||||
cm('single format', _('Save only %s format to disk')%
|
cm('single format', _('Save only %s format to disk')%
|
||||||
prefs['output_format'].upper(),
|
prefs['output_format'].upper(),
|
||||||
triggered=partial(self.save_single_format_to_disk, False))
|
triggered=partial(self.save_single_format_to_disk, False))
|
||||||
cm('single dir and format',
|
cm('single dir and format',
|
||||||
_('Save only %s format to disk in a single directory')%
|
_('Save only %s format to disk in a single folder')%
|
||||||
prefs['output_format'].upper(),
|
prefs['output_format'].upper(),
|
||||||
triggered=partial(self.save_single_fmt_to_single_dir, False))
|
triggered=partial(self.save_single_fmt_to_single_dir, False))
|
||||||
cm('specific format', _('Save single format to disk...'),
|
cm('specific format', _('Save single format to disk...'),
|
||||||
@ -50,7 +50,7 @@ class SaveToDiskAction(InterfaceAction):
|
|||||||
_('Save only %s format to disk')%
|
_('Save only %s format to disk')%
|
||||||
prefs['output_format'].upper())
|
prefs['output_format'].upper())
|
||||||
self.save_menu.actions()[3].setText(
|
self.save_menu.actions()[3].setText(
|
||||||
_('Save only %s format to disk in a single directory')%
|
_('Save only %s format to disk in a single folder')%
|
||||||
prefs['output_format'].upper())
|
prefs['output_format'].upper())
|
||||||
|
|
||||||
def save_single_format_to_disk(self, checked):
|
def save_single_format_to_disk(self, checked):
|
||||||
@ -83,7 +83,7 @@ class SaveToDiskAction(InterfaceAction):
|
|||||||
return error_dialog(self.gui, _('Cannot save to disk'),
|
return error_dialog(self.gui, _('Cannot save to disk'),
|
||||||
_('No books selected'), show=True)
|
_('No books selected'), show=True)
|
||||||
path = choose_dir(self.gui, 'save to disk dialog',
|
path = choose_dir(self.gui, 'save to disk dialog',
|
||||||
_('Choose destination directory'))
|
_('Choose destination folder'))
|
||||||
if not path:
|
if not path:
|
||||||
return
|
return
|
||||||
dpath = os.path.abspath(path).replace('/', os.sep)+os.sep
|
dpath = os.path.abspath(path).replace('/', os.sep)+os.sep
|
||||||
|
@ -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-folders 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 folder.</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Use sub-directories</string>
|
<string>Use sub-directories</string>
|
||||||
|
@ -167,7 +167,7 @@ class EximDialog(Dialog):
|
|||||||
w.l = l = QVBoxLayout(w)
|
w.l = l = QVBoxLayout(w)
|
||||||
w.la = la = QLabel('<p>' + _(
|
w.la = la = QLabel('<p>' + _(
|
||||||
'You can export all calibre data, including your books, settings and plugins'
|
'You can export all calibre data, including your books, settings and plugins'
|
||||||
' into a single directory. Then, you can use this tool to re-import all that'
|
' into a single folder. Then, you can use this tool to re-import all that'
|
||||||
' data into a different calibre install, for example, on another computer.') + '<p>' +
|
' data into a different calibre install, for example, on another computer.') + '<p>' +
|
||||||
_(
|
_(
|
||||||
'This is a simple way to move your calibre installation with all its data to'
|
'This is a simple way to move your calibre installation with all its data to'
|
||||||
@ -342,12 +342,12 @@ class EximDialog(Dialog):
|
|||||||
self.stack.setCurrentIndex({'export':1, 'import':2}.get(which, 0))
|
self.stack.setCurrentIndex({'export':1, 'import':2}.get(which, 0))
|
||||||
|
|
||||||
def validate_export(self):
|
def validate_export(self):
|
||||||
path = choose_dir(self, 'export-calibre-dir', _('Choose a directory to export to'))
|
path = choose_dir(self, 'export-calibre-dir', _('Choose a folder to export to'))
|
||||||
if not path:
|
if not path:
|
||||||
return False
|
return False
|
||||||
if os.listdir(path):
|
if os.listdir(path):
|
||||||
error_dialog(self, _('Export dir not empty'), _(
|
error_dialog(self, _('Export folder not empty'), _(
|
||||||
'The directory you choose to export the data to must be empty.'), show=True)
|
'The folder you choose to export the data to must be empty.'), show=True)
|
||||||
return False
|
return False
|
||||||
self.export_dir = path
|
self.export_dir = path
|
||||||
return True
|
return True
|
||||||
|
@ -56,7 +56,7 @@ class EPUB_MOBI(CatalogPlugin):
|
|||||||
action=None,
|
action=None,
|
||||||
help=_("Save the output from different stages of the conversion "
|
help=_("Save the output from different stages of the conversion "
|
||||||
"pipeline to the specified "
|
"pipeline to the specified "
|
||||||
"directory. Useful if you are unsure at which stage "
|
"folder. Useful if you are unsure at which stage "
|
||||||
"of the conversion process a bug is occurring.\n"
|
"of the conversion process a bug is occurring.\n"
|
||||||
"Default: '%default'\n"
|
"Default: '%default'\n"
|
||||||
"Applies to: AZW3, EPUB, MOBI output formats")),
|
"Applies to: AZW3, EPUB, MOBI output formats")),
|
||||||
|
@ -94,16 +94,16 @@ def config(defaults=None):
|
|||||||
help=_('Comma separated list of formats to save for each book.'
|
help=_('Comma separated list of formats to save for each book.'
|
||||||
' By default all available formats are saved.'))
|
' By default all available formats are saved.'))
|
||||||
x('template', default=DEFAULT_TEMPLATE,
|
x('template', default=DEFAULT_TEMPLATE,
|
||||||
help=_('The template to control the filename and directory structure of the saved files. '
|
help=_('The template to control the filename and folder structure of the saved files. '
|
||||||
'Default is "%(templ)s" which will save books into a per-author '
|
'Default is "%(templ)s" which will save books into a per-author '
|
||||||
'subdirectory with filenames containing title and author. '
|
'subfolder with filenames containing title and author. '
|
||||||
'Available controls are: {%(controls)s}')%dict(
|
'Available controls are: {%(controls)s}')%dict(
|
||||||
templ=DEFAULT_TEMPLATE, controls=', '.join(sorted(FORMAT_ARGS))))
|
templ=DEFAULT_TEMPLATE, controls=', '.join(sorted(FORMAT_ARGS))))
|
||||||
x('send_template', default=DEFAULT_SEND_TEMPLATE,
|
x('send_template', default=DEFAULT_SEND_TEMPLATE,
|
||||||
help=_('The template to control the filename and directory structure of files '
|
help=_('The template to control the filename and folder structure of files '
|
||||||
'sent to the device. '
|
'sent to the device. '
|
||||||
'Default is "%(templ)s" which will save books into a per-author '
|
'Default is "%(templ)s" which will save books into a per-author '
|
||||||
'directory with filenames containing title and author. '
|
'folder with filenames containing title and author. '
|
||||||
'Available controls are: {%(controls)s}')%dict(
|
'Available controls are: {%(controls)s}')%dict(
|
||||||
templ=DEFAULT_SEND_TEMPLATE, controls=', '.join(FORMAT_ARGS)))
|
templ=DEFAULT_SEND_TEMPLATE, controls=', '.join(FORMAT_ARGS)))
|
||||||
x('asciiize', default=False,
|
x('asciiize', default=False,
|
||||||
@ -123,8 +123,8 @@ def config(defaults=None):
|
|||||||
x('replace_whitespace', default=False,
|
x('replace_whitespace', default=False,
|
||||||
help=_('Replace whitespace with underscores.'))
|
help=_('Replace whitespace with underscores.'))
|
||||||
x('single_dir', default=False,
|
x('single_dir', default=False,
|
||||||
help=_('Save into a single directory, ignoring the template'
|
help=_('Save into a single folder, ignoring the template'
|
||||||
' directory structure'))
|
' folder structure'))
|
||||||
return c
|
return c
|
||||||
|
|
||||||
|
|
||||||
|
@ -398,7 +398,7 @@ def input_unicode(prompt):
|
|||||||
def run_exporter(export_dir=None, args=None):
|
def run_exporter(export_dir=None, args=None):
|
||||||
if args:
|
if args:
|
||||||
if len(args) < 2:
|
if len(args) < 2:
|
||||||
raise SystemExit('You must specify the export dir and libraries to export')
|
raise SystemExit('You must specify the export folder and libraries to export')
|
||||||
export_dir = args[0]
|
export_dir = args[0]
|
||||||
if not os.path.exists(export_dir):
|
if not os.path.exists(export_dir):
|
||||||
os.makedirs(export_dir)
|
os.makedirs(export_dir)
|
||||||
|
@ -412,8 +412,7 @@ class BuiltinAssign(BuiltinFormatterFunction):
|
|||||||
arg_count = 2
|
arg_count = 2
|
||||||
category = 'Other'
|
category = 'Other'
|
||||||
__doc__ = doc = _('assign(id, val) -- assigns val to id, then returns val. '
|
__doc__ = doc = _('assign(id, val) -- assigns val to id, then returns val. '
|
||||||
'id must be an identifier, not an expression. In most cases you can '
|
'id must be an identifier, not an expression. '
|
||||||
'use the ``=`` operator instead of this function. '
|
|
||||||
'This function can often be replaced with the = operator.')
|
'This function can often be replaced with the = operator.')
|
||||||
|
|
||||||
def evaluate(self, formatter, kwargs, mi, locals, target, value):
|
def evaluate(self, formatter, kwargs, mi, locals, target, value):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user