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
baa6524c0f
commit
8d244b4a45
@ -202,9 +202,9 @@ class InputFormatPlugin(Plugin):
|
|||||||
'''
|
'''
|
||||||
This method must be implemented in sub-classes. It must return
|
This method must be implemented in sub-classes. It must return
|
||||||
the path to the created OPF file or an :class:`OEBBook` instance.
|
the path to the created OPF file or an :class:`OEBBook` instance.
|
||||||
All output should be contained in the current directory.
|
All output should be contained in the current folder.
|
||||||
If this plugin creates files outside the current
|
If this plugin creates files outside the current
|
||||||
directory they must be deleted/marked for deletion before this method
|
folder they must be deleted/marked for deletion before this method
|
||||||
returns.
|
returns.
|
||||||
|
|
||||||
:param stream: A file like object that contains the input file.
|
:param stream: A file like object that contains the input file.
|
||||||
@ -328,7 +328,7 @@ class OutputFormatPlugin(Plugin):
|
|||||||
|
|
||||||
: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 folder 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 folder. 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
|
||||||
the conversion pipeline.
|
the conversion pipeline.
|
||||||
|
@ -21,7 +21,7 @@ def option_parser(get_parser, args):
|
|||||||
%prog backup_metadata [options]
|
%prog backup_metadata [options]
|
||||||
|
|
||||||
Backup the metadata stored in the database into individual OPF files in each
|
Backup the metadata stored in the database into individual OPF files in each
|
||||||
books directory. This normally happens automatically, but you can run this
|
books folder. This normally happens automatically, but you can run this
|
||||||
command to force re-generation of the OPF files, with the --all option.
|
command to force re-generation of the OPF files, with the --all option.
|
||||||
|
|
||||||
Note that there is normally no need to do this, as the OPF files are backed up
|
Note that there is normally no need to do this, as the OPF files are backed up
|
||||||
|
@ -49,7 +49,7 @@ def main(opts, args, dbctx):
|
|||||||
if not empty:
|
if not empty:
|
||||||
raise SystemExit(
|
raise SystemExit(
|
||||||
_(
|
_(
|
||||||
'%s is not empty. You must choose an empty directory for the new library.'
|
'%s is not empty. You must choose an empty folder for the new library.'
|
||||||
) % loc
|
) % loc
|
||||||
)
|
)
|
||||||
if iswindows and len(loc) > LibraryDatabase.WINDOWS_LIBRARY_PATH_LIMIT:
|
if iswindows and len(loc) > LibraryDatabase.WINDOWS_LIBRARY_PATH_LIMIT:
|
||||||
|
@ -258,7 +258,7 @@ def main():
|
|||||||
for book in dev.books(oncard='cardb'):
|
for book in dev.books(oncard='cardb'):
|
||||||
print(book)
|
print(book)
|
||||||
elif command == "mkdir":
|
elif command == "mkdir":
|
||||||
parser = OptionParser(usage="usage: %prog mkdir [options] path\nCreate a directory on the device\n\npath must begin with / or card:/")
|
parser = OptionParser(usage="usage: %prog mkdir [options] path\nCreate a folder on the device\n\npath must begin with / or card:/")
|
||||||
if len(args) != 1:
|
if len(args) != 1:
|
||||||
parser.print_help()
|
parser.print_help()
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
@ -268,7 +268,7 @@ def main():
|
|||||||
parser.add_option(
|
parser.add_option(
|
||||||
"-l", help="In addition to the name of each file, print the file type, permissions, and timestamp (the modification time, in the local timezone). Times are local.", # noqa
|
"-l", help="In addition to the name of each file, print the file type, permissions, and timestamp (the modification time, in the local timezone). Times are local.", # noqa
|
||||||
dest="ll", action="store_true", default=False)
|
dest="ll", action="store_true", default=False)
|
||||||
parser.add_option("-R", help="Recursively list subdirectories encountered. /dev and /proc are omitted",
|
parser.add_option("-R", help="Recursively list subfolders encountered. /dev and /proc are omitted",
|
||||||
dest="recurse", action="store_true", default=False)
|
dest="recurse", action="store_true", default=False)
|
||||||
parser.remove_option("-h")
|
parser.remove_option("-h")
|
||||||
parser.add_option("-h", "--human-readable", help="show sizes in human readable format", dest="hrs", action="store_true", default=False)
|
parser.add_option("-h", "--human-readable", help="show sizes in human readable format", dest="hrs", action="store_true", default=False)
|
||||||
@ -285,7 +285,7 @@ def main():
|
|||||||
"dev:mountpoint/my/path\n"+\
|
"dev:mountpoint/my/path\n"+\
|
||||||
"where mountpoint is one of / or carda: or cardb:/\n\n"+\
|
"where mountpoint is one of / or carda: or cardb:/\n\n"+\
|
||||||
"source must point to a file for which you have read permissions\n"+\
|
"source must point to a file for which you have read permissions\n"+\
|
||||||
"destination must point to a file or directory for which you have write permissions"
|
"destination must point to a file or folder for which you have write permissions"
|
||||||
parser = OptionParser(usage=usage)
|
parser = OptionParser(usage=usage)
|
||||||
parser.add_option('-f', '--force', dest='force', action='store_true', default=False,
|
parser.add_option('-f', '--force', dest='force', action='store_true', default=False,
|
||||||
help='Overwrite the destination file if it exists already.')
|
help='Overwrite the destination file if it exists already.')
|
||||||
@ -336,7 +336,7 @@ def main():
|
|||||||
outfile = sys.stdout
|
outfile = sys.stdout
|
||||||
dev.get_file(path, outfile)
|
dev.get_file(path, outfile)
|
||||||
elif command == "rm":
|
elif command == "rm":
|
||||||
parser = OptionParser(usage="usage: %prog rm path\nDelete files from the device\n\npath should point to a file or empty directory on the device "+
|
parser = OptionParser(usage="usage: %prog rm path\nDelete files from the device\n\npath should point to a file or empty folder on the device "+
|
||||||
"and must begin with / or card:/\n\n"+
|
"and must begin with / or card:/\n\n"+
|
||||||
"rm will DELETE the file. Be very CAREFUL")
|
"rm will DELETE the file. Be very CAREFUL")
|
||||||
options, args = parser.parse_args(args)
|
options, args = parser.parse_args(args)
|
||||||
|
@ -986,7 +986,7 @@ class KOBO(USBMS):
|
|||||||
'''
|
'''
|
||||||
Upload book cover to the device. Default implementation does nothing.
|
Upload book cover to the device. Default implementation does nothing.
|
||||||
|
|
||||||
:param path: The full path to the directory where the associated book is located.
|
:param path: The full path to the folder where the associated book is located.
|
||||||
:param filename: The name of the book file without the extension.
|
:param filename: The name of the book file without the extension.
|
||||||
:param metadata: metadata belonging to the book. Use metadata.thumbnail
|
:param metadata: metadata belonging to the book. Use metadata.thumbnail
|
||||||
for cover
|
for cover
|
||||||
@ -2585,7 +2585,7 @@ class KOBOTOUCH(KOBO):
|
|||||||
'''
|
'''
|
||||||
Upload book cover to the device. Default implementation does nothing.
|
Upload book cover to the device. Default implementation does nothing.
|
||||||
|
|
||||||
:param path: The full path to the directory where the associated book is located.
|
:param path: The full path to the folder where the associated book is located.
|
||||||
:param filename: The name of the book file without the extension.
|
:param filename: The name of the book file without the extension.
|
||||||
:param metadata: metadata belonging to the book. Use metadata.thumbnail
|
:param metadata: metadata belonging to the book. Use metadata.thumbnail
|
||||||
for cover
|
for cover
|
||||||
@ -2747,7 +2747,7 @@ class KOBOTOUCH(KOBO):
|
|||||||
|
|
||||||
image_dir = os.path.dirname(os.path.abspath(path))
|
image_dir = os.path.dirname(os.path.abspath(path))
|
||||||
if not os.path.exists(image_dir):
|
if not os.path.exists(image_dir):
|
||||||
debug_print("KoboTouch:_upload_cover - Image directory does not exist. Creating path='%s'" % (image_dir))
|
debug_print("KoboTouch:_upload_cover - Image folder does not exist. Creating path='%s'" % (image_dir))
|
||||||
os.makedirs(image_dir)
|
os.makedirs(image_dir)
|
||||||
|
|
||||||
with lopen(cover, 'rb') as f:
|
with lopen(cover, 'rb') as f:
|
||||||
|
@ -33,8 +33,8 @@ output_file. output_file can also be of the special format .EXT where \
|
|||||||
EXT is the output file extension. In this case, the name of the output \
|
EXT is the output file extension. In this case, the name of the output \
|
||||||
file is derived from the name of the input file. Note that the filenames must \
|
file is derived from the name of the input file. Note that the filenames must \
|
||||||
not start with a hyphen. Finally, if output_file has no extension, then \
|
not start with a hyphen. Finally, if output_file has no extension, then \
|
||||||
it is treated as a directory and an "open e-book" (OEB) consisting of HTML \
|
it is treated as a folder and an "open e-book" (OEB) consisting of HTML \
|
||||||
files is written to that directory. These files are the files that would \
|
files is written to that folder. These files are the files that would \
|
||||||
normally have been passed to the output plugin.
|
normally have been passed to the output plugin.
|
||||||
|
|
||||||
After specifying the input \
|
After specifying the input \
|
||||||
|
@ -43,7 +43,7 @@ class Link(object):
|
|||||||
def __init__(self, url, base):
|
def __init__(self, url, base):
|
||||||
'''
|
'''
|
||||||
:param url: The url this link points to. Must be an unquoted unicode string.
|
:param url: The url this link points to. Must be an unquoted unicode string.
|
||||||
:param base: The base directory that relative URLs are with respect to.
|
:param base: The base folder that relative URLs are with respect to.
|
||||||
Must be a unicode string.
|
Must be a unicode string.
|
||||||
'''
|
'''
|
||||||
assert isinstance(url, unicode_type) and isinstance(base, unicode_type)
|
assert isinstance(url, unicode_type) and isinstance(base, unicode_type)
|
||||||
|
@ -32,7 +32,7 @@ class OEB2HTML(object):
|
|||||||
content. Also, callers should use oeb2html to get the transformed html.
|
content. Also, callers should use oeb2html to get the transformed html.
|
||||||
links and images can be retrieved after calling oeb2html to get the mapping
|
links and images can be retrieved after calling oeb2html to get the mapping
|
||||||
of OEB links and images to the new names used in the html returned by oeb2html.
|
of OEB links and images to the new names used in the html returned by oeb2html.
|
||||||
Images will always be referenced as if they are in an images directory.
|
Images will always be referenced as if they are in an images folder.
|
||||||
|
|
||||||
Use get_css to get the CSS classes for the OEB document as a string.
|
Use get_css to get the CSS classes for the OEB document as a string.
|
||||||
'''
|
'''
|
||||||
|
@ -68,7 +68,7 @@ class CSSPreProcessor(cssp):
|
|||||||
|
|
||||||
|
|
||||||
def clone_dir(src, dest):
|
def clone_dir(src, dest):
|
||||||
' Clone a directory using hard links for the files, dest must already exist '
|
' Clone a folder using hard links for the files, dest must already exist '
|
||||||
for x in os.listdir(src):
|
for x in os.listdir(src):
|
||||||
dpath = os.path.join(dest, x)
|
dpath = os.path.join(dest, x)
|
||||||
spath = os.path.join(src, x)
|
spath = os.path.join(src, x)
|
||||||
@ -222,17 +222,17 @@ class ContainerBase(object): # {{{
|
|||||||
class Container(ContainerBase): # {{{
|
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 folder full of files and an
|
||||||
opf file. There are two important concepts:
|
opf file. There are two important concepts:
|
||||||
|
|
||||||
* The root folder. 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 folder or in its sub-folders.
|
files are inside this folder or in its sub-folders.
|
||||||
|
|
||||||
* Names: These are paths to the books' files relative to the root
|
* Names: These are paths to the books' files relative to the root
|
||||||
directory. They always contain POSIX separators and are unquoted. They
|
folder. They always contain POSIX separators and are unquoted. They
|
||||||
can be thought of as canonical identifiers for files in the book.
|
can be thought of as canonical identifiers for files in the book.
|
||||||
Most methods on the container object work with names. Names are always
|
Most methods on the container object work with names. Names are always
|
||||||
in the NFC unicode normal form.
|
in the NFC Unicode normal form.
|
||||||
|
|
||||||
* Clones: the container object supports efficient on-disk cloning, which is used to
|
* Clones: the container object supports efficient on-disk cloning, which is used to
|
||||||
implement checkpoints in the e-book editor. In order to make this work, you should
|
implement checkpoints in the e-book editor. In order to make this work, you should
|
||||||
@ -507,7 +507,7 @@ class Container(ContainerBase): # {{{
|
|||||||
'''
|
'''
|
||||||
Convert an absolute path to a canonical name relative to :attr:`root`
|
Convert an absolute path to a canonical name relative to :attr:`root`
|
||||||
|
|
||||||
:param root: The base directory. By default the root for this container object is used.
|
:param root: The base folder. By default the root for this container object is used.
|
||||||
'''
|
'''
|
||||||
# OS X silently changes all file names to NFD form. The EPUB
|
# OS X silently changes all file names to NFD form. The EPUB
|
||||||
# spec requires all text including filenames to be in NFC form.
|
# spec requires all text including filenames to be in NFC form.
|
||||||
@ -524,7 +524,7 @@ class Container(ContainerBase): # {{{
|
|||||||
return name_to_abspath(name, self.root)
|
return name_to_abspath(name, self.root)
|
||||||
|
|
||||||
def exists(self, name):
|
def exists(self, name):
|
||||||
''' True iff a file/directory corresponding to the canonical name exists. Note
|
''' True iff a file/folder corresponding to the canonical name exists. Note
|
||||||
that this function suffers from the limitations of the underlying OS
|
that this function suffers from the limitations of the underlying OS
|
||||||
filesystem, in particular case (in)sensitivity. So on a case
|
filesystem, in particular case (in)sensitivity. So on a case
|
||||||
insensitive filesystem this will return True even if the case of name
|
insensitive filesystem this will return True even if the case of name
|
||||||
|
@ -804,8 +804,8 @@ def show_temp_dir_error(err):
|
|||||||
extra = _('Click "Show details" for more information.')
|
extra = _('Click "Show details" for more information.')
|
||||||
if 'CALIBRE_TEMP_DIR' in os.environ:
|
if 'CALIBRE_TEMP_DIR' in os.environ:
|
||||||
extra = _('The %s environment variable is set. Try unsetting it.') % 'CALIBRE_TEMP_DIR'
|
extra = _('The %s environment variable is set. Try unsetting it.') % 'CALIBRE_TEMP_DIR'
|
||||||
error_dialog(None, _('Could not create temporary directory'), _(
|
error_dialog(None, _('Could not create temporary folder'), _(
|
||||||
'Could not create temporary directory, calibre cannot start.') + ' ' + extra, det_msg=traceback.format_exc(), show=True)
|
'Could not create temporary folder, calibre cannot start.') + ' ' + extra, det_msg=traceback.format_exc(), show=True)
|
||||||
|
|
||||||
|
|
||||||
def setup_hidpi():
|
def setup_hidpi():
|
||||||
@ -908,7 +908,7 @@ class Application(QApplication):
|
|||||||
except EnvironmentError as err:
|
except EnvironmentError as err:
|
||||||
if not headless:
|
if not headless:
|
||||||
show_temp_dir_error(err)
|
show_temp_dir_error(err)
|
||||||
raise SystemExit('Failed to create temporary directory')
|
raise SystemExit('Failed to create temporary folder')
|
||||||
if DEBUG and not headless:
|
if DEBUG and not headless:
|
||||||
prints('devicePixelRatio:', self.devicePixelRatio())
|
prints('devicePixelRatio:', self.devicePixelRatio())
|
||||||
s = self.primaryScreen()
|
s = self.primaryScreen()
|
||||||
|
@ -231,7 +231,7 @@ class InterfaceAction(QObject):
|
|||||||
:param text: The text of the action.
|
:param text: The text of the action.
|
||||||
:param icon: Either a QIcon or a file name. The file name is passed to
|
:param icon: Either a QIcon or a file name. The file name is passed to
|
||||||
the I() builtin, so you do not need to pass the full path to the images
|
the I() builtin, so you do not need to pass the full path to the images
|
||||||
directory.
|
folder.
|
||||||
:param shortcut: A string, a list of strings, None or False. If False,
|
:param shortcut: A string, a list of strings, None or False. If False,
|
||||||
no keyboard shortcut is registered for this action. If None, a keyboard
|
no keyboard shortcut is registered for this action. If None, a keyboard
|
||||||
shortcut with no default keybinding is registered. String and list of
|
shortcut with no default keybinding is registered. String and list of
|
||||||
|
@ -49,7 +49,7 @@ class DebugWidget(Widget, Ui_Form):
|
|||||||
import traceback
|
import traceback
|
||||||
det_msg = traceback.format_exc()
|
det_msg = traceback.format_exc()
|
||||||
error_dialog(self, _('Invalid debug folder'),
|
error_dialog(self, _('Invalid debug folder'),
|
||||||
_('Failed to create debug directory')+': '+ unicode_type(self.opt_debug_pipeline.text()),
|
_('Failed to create debug folder')+': '+ unicode_type(self.opt_debug_pipeline.text()),
|
||||||
det_msg=det_msg, show=True)
|
det_msg=det_msg, show=True)
|
||||||
return False
|
return False
|
||||||
return True
|
return True
|
||||||
|
@ -87,13 +87,13 @@ class TrimImage(QDialog):
|
|||||||
w = rect.width()
|
w = rect.width()
|
||||||
h = rect.height()
|
h = rect.height()
|
||||||
text = f'{int(w)}x{int(h)}'
|
text = f'{int(w)}x{int(h)}'
|
||||||
text = _('Size: {0} Aspect ratio: {1:.2g}').format(text, w / h)
|
text = _('Size: {0}px Aspect ratio: {1:.2g}').format(text, w / h)
|
||||||
else:
|
else:
|
||||||
text = ''
|
text = ''
|
||||||
self.tr_sz.setText(text)
|
self.tr_sz.setText(text)
|
||||||
|
|
||||||
def image_changed(self, qimage):
|
def image_changed(self, qimage):
|
||||||
self.sz.setText('\xa0' + _('Size:') + ' ' + '%dx%d' % (qimage.width(), qimage.height()))
|
self.sz.setText('\xa0' + _('Size: {0}x{1}px').format(qimage.width(), qimage.height()))
|
||||||
|
|
||||||
def cleanup(self):
|
def cleanup(self):
|
||||||
self.canvas.break_cycles()
|
self.canvas.break_cycles()
|
||||||
|
@ -107,7 +107,7 @@
|
|||||||
<item row="9" column="0" colspan="2">
|
<item row="9" column="0" colspan="2">
|
||||||
<widget class="QPushButton" name="button_open_config_dir">
|
<widget class="QPushButton" name="button_open_config_dir">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Open calibre &configuration directory</string>
|
<string>Open calibre &configuration folder</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
@ -400,7 +400,7 @@ class Diff(Dialog):
|
|||||||
|
|
||||||
def dir_diff(self, left, right, identical_msg=None):
|
def dir_diff(self, left, right, identical_msg=None):
|
||||||
with self:
|
with self:
|
||||||
identical = self.apply_diff(identical_msg or _('The directories are identical'), *dir_diff(left, right))
|
identical = self.apply_diff(identical_msg or _('The folders are identical'), *dir_diff(left, right))
|
||||||
self.view.finalize()
|
self.view.finalize()
|
||||||
if identical:
|
if identical:
|
||||||
self.reject()
|
self.reject()
|
||||||
|
@ -166,7 +166,7 @@ raw_options = (
|
|||||||
_('Path to user database'),
|
_('Path to user database'),
|
||||||
'userdb', None,
|
'userdb', None,
|
||||||
_('Path to a file in which to store the user and password information. Normally a'
|
_('Path to a file in which to store the user and password information. Normally a'
|
||||||
' file in the calibre configuration directory is used.'),
|
' file in the calibre configuration folder is used.'),
|
||||||
|
|
||||||
_('Choose the type of authentication used'), 'auth_mode', Choices('auto', 'basic', 'digest'),
|
_('Choose the type of authentication used'), 'auth_mode', Choices('auto', 'basic', 'digest'),
|
||||||
_('Set the HTTP authentication mode used by the server. Set to "basic" if you are'
|
_('Set the HTTP authentication mode used by the server. Set to "basic" if you are'
|
||||||
|
@ -484,7 +484,7 @@ def create_global_prefs(conf_obj=None):
|
|||||||
c.add_opt('network_timeout', default=5,
|
c.add_opt('network_timeout', default=5,
|
||||||
help=_('Default timeout for network operations (seconds)'))
|
help=_('Default timeout for network operations (seconds)'))
|
||||||
c.add_opt('library_path', default=None,
|
c.add_opt('library_path', default=None,
|
||||||
help=_('Path to directory in which your library of books is stored'))
|
help=_('Path to folder in which your library of books is stored'))
|
||||||
c.add_opt('language', default=None,
|
c.add_opt('language', default=None,
|
||||||
help=_('The language in which to display the user interface'))
|
help=_('The language in which to display the user interface'))
|
||||||
c.add_opt('output_format', default='EPUB',
|
c.add_opt('output_format', default='EPUB',
|
||||||
|
@ -597,7 +597,7 @@ class RecursiveFetcher(object):
|
|||||||
def option_parser(usage=_('%prog URL\n\nWhere URL is for example https://google.com')):
|
def option_parser(usage=_('%prog URL\n\nWhere URL is for example https://google.com')):
|
||||||
parser = OptionParser(usage=usage)
|
parser = OptionParser(usage=usage)
|
||||||
parser.add_option('-d', '--base-dir',
|
parser.add_option('-d', '--base-dir',
|
||||||
help=_('Base directory into which URL is saved. Default is %default'),
|
help=_('Base folder into which URL is saved. Default is %default'),
|
||||||
default='.', type='string', dest='dir')
|
default='.', type='string', dest='dir')
|
||||||
parser.add_option('-t', '--timeout',
|
parser.add_option('-t', '--timeout',
|
||||||
help=_('Timeout in seconds to wait for a response from the server. Default: %default s'),
|
help=_('Timeout in seconds to wait for a response from the server. Default: %default s'),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user