From 22862fd194db6338720e50aba5c599d159bdcac7 Mon Sep 17 00:00:00 2001 From: Ori Avtalion Date: Sat, 24 May 2008 23:06:54 +0300 Subject: [PATCH 1/2] Fix typo --- src/calibre/devices/prs500/prstypes.py | 4 ++-- src/calibre/ebooks/lrf/__init__.py | 4 ++-- src/calibre/ebooks/metadata/isbndb.py | 4 ++-- src/calibre/web/feeds/recipes/__init__.py | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/calibre/devices/prs500/prstypes.py b/src/calibre/devices/prs500/prstypes.py index 28498a7942..4e1294fc1c 100755 --- a/src/calibre/devices/prs500/prstypes.py +++ b/src/calibre/devices/prs500/prstypes.py @@ -353,7 +353,7 @@ class SetTime(Command): class ShortCommand(Command): - """ A L{Command} whoose data section is 4 bytes long """ + """ A L{Command} whose data section is 4 bytes long """ SIZE = 20 #: Packet size in bytes # Usually carries additional information @@ -431,7 +431,7 @@ class UnlockDevice(Command): class LongCommand(Command): - """ A L{Command} whoose data section is 16 bytes long """ + """ A L{Command} whose data section is 16 bytes long """ SIZE = 32 #: Size in bytes of C{LongCommand} packets diff --git a/src/calibre/ebooks/lrf/__init__.py b/src/calibre/ebooks/lrf/__init__.py index 91330b44aa..4498ee6400 100644 --- a/src/calibre/ebooks/lrf/__init__.py +++ b/src/calibre/ebooks/lrf/__init__.py @@ -161,7 +161,7 @@ def option_parser(usage, gui_mode=False): '''links. A value of 0 means thats links are not followed. ''' '''A negative value means that tags are ignored.''')) link.add_option('--link-exclude', dest='link_exclude', default='@', - help=_('''A regular expression. tags whoose href ''' + help=_('''A regular expression. tags whose href ''' '''matches will be ignored. Defaults to %default''')) link.add_option('--no-links-in-toc', action='store_true', default=False, dest='no_links_in_toc', @@ -186,7 +186,7 @@ def option_parser(usage, gui_mode=False): '''turn performance of the LRF. Thus this option is ignored ''' '''if the current page has only a few elements.''')) chapter.add_option('--force-page-break-before-tag', dest='force_page_break', - default='$', help=_('Force a page break before tags whoose names match this regular expression.')) + default='$', help=_('Force a page break before tags whose names match this regular expression.')) chapter.add_option('--force-page-break-before-attr', dest='force_page_break_attr', default='$,,$', help=_('Force a page break before an element having the specified attribute. The format for this option is tagname regexp,attribute name,attribute value regexp. For example to match all heading tags that have the attribute class="chapter" you would use "h\d,class,chapter". Default is %default''')) chapter.add_option('--add-chapters-to-toc', action='store_true', diff --git a/src/calibre/ebooks/metadata/isbndb.py b/src/calibre/ebooks/metadata/isbndb.py index b713ca5ea5..19ca54e282 100644 --- a/src/calibre/ebooks/metadata/isbndb.py +++ b/src/calibre/ebooks/metadata/isbndb.py @@ -105,7 +105,7 @@ key is the account key you generate after signing up for a free account from isb parser.add_option('-i', '--isbn', default=None, dest='isbn', help=_('The ISBN ID of the book you want metadata for.')) parser.add_option('-a', '--author', dest='author', - default=None, help=_('The author whoose book to search for.')) + default=None, help=_('The author whose book to search for.')) parser.add_option('-t', '--title', dest='title', default=None, help=_('The title of the book to search for.')) parser.add_option('-p', '--publisher', default=None, dest='publisher', @@ -145,4 +145,4 @@ def main(args=sys.argv): return 0 if __name__ == '__main__': - sys.exit(main()) \ No newline at end of file + sys.exit(main()) diff --git a/src/calibre/web/feeds/recipes/__init__.py b/src/calibre/web/feeds/recipes/__init__.py index 8ffb3ca147..81ba7f730a 100644 --- a/src/calibre/web/feeds/recipes/__init__.py +++ b/src/calibre/web/feeds/recipes/__init__.py @@ -81,7 +81,7 @@ def compile_recipe(src): def get_builtin_recipe(title): ''' - Return a builtin recipe/profile class whoose title == C{title} or None if no such + Return a builtin recipe/profile class whose title == C{title} or None if no such recipe exists. Also returns a flag that is True iff the found recipe is really an old-style Profile. @@ -117,4 +117,4 @@ class BasicUserRecipe%d(AutomaticNewsRecipe): '''%(int(time.time()), repr(profile.title), profile.oldest_article, profile.max_articles_per_feed, profile.summary_length, repr(profile.feeds)) - \ No newline at end of file + From e3e999bc3741b5da081877b35f413ebfae874431 Mon Sep 17 00:00:00 2001 From: Ori Avtalion Date: Sat, 24 May 2008 23:17:22 +0300 Subject: [PATCH 2/2] only follow links on the local machine --- src/calibre/ebooks/lrf/html/convert_from.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/calibre/ebooks/lrf/html/convert_from.py b/src/calibre/ebooks/lrf/html/convert_from.py index adfa7b37eb..bd6ca9cab5 100644 --- a/src/calibre/ebooks/lrf/html/convert_from.py +++ b/src/calibre/ebooks/lrf/html/convert_from.py @@ -45,7 +45,9 @@ def update_css(ncss, ocss): ocss[key] = ncss[key] def munge_paths(basepath, url): - purl = urlparse(unquote(url),) + purl = urlparse(unquote(url)) + if purl[0] not in ('', 'file'): + return ('','') path, fragment = purl[2], purl[5] if path: path = path.replace('/', os.sep)