diff --git a/src/calibre/constants.py b/src/calibre/constants.py index aebcb35dc0..913c54bffe 100644 --- a/src/calibre/constants.py +++ b/src/calibre/constants.py @@ -2,7 +2,7 @@ __license__ = 'GPL v3' __copyright__ = '2008, Kovid Goyal kovid@kovidgoyal.net' __docformat__ = 'restructuredtext en' __appname__ = 'calibre' -__version__ = '0.4.143' +__version__ = '0.5.0' __author__ = "Kovid Goyal " ''' Various run time constants. diff --git a/src/calibre/ebooks/lrf/comic/convert_from.py b/src/calibre/ebooks/lrf/comic/convert_from.py index 45254f7b87..50f5e1e72e 100755 --- a/src/calibre/ebooks/lrf/comic/convert_from.py +++ b/src/calibre/ebooks/lrf/comic/convert_from.py @@ -143,7 +143,8 @@ class PageProcessor(list): MagickRotateImage(wand, pw, -90) # 25 percent fuzzy trim? - MagickTrimImage(wand, 25*65535/100) + if not self.opts.disable_trim: + MagickTrimImage(wand, 25*65535/100) MagickSetImagePage(wand, 0,0,0,0) #Clear page after trim, like a "+repage" # Do the Photoshop "Auto Levels" equivalent if not self.opts.dont_normalize: @@ -303,6 +304,9 @@ def config(defaults=None,output_format='lrf'): help=_('Maintain picture aspect ratio. Default is to fill the screen.')) c.add_opt('dont_sharpen', ['-s', '--disable-sharpen'], default=False, help=_('Disable sharpening.')) + c.add_opt('disable_trim', ['--disable-trim'], default=False, + help=_('Disable trimming of comic pages. For some comics, ' + 'trimming might remove content as well as borders.')) c.add_opt('landscape', ['-l', '--landscape'], default=False, help=_("Don't split landscape images into two portrait images")) c.add_opt('wide', ['-w', '--wide-aspect'], default=False, diff --git a/src/calibre/ebooks/lrf/lrs/convert_from.py b/src/calibre/ebooks/lrf/lrs/convert_from.py index 495d9adb50..86a97aa70b 100644 --- a/src/calibre/ebooks/lrf/lrs/convert_from.py +++ b/src/calibre/ebooks/lrf/lrs/convert_from.py @@ -28,8 +28,9 @@ class LrsParser(object): def __init__(self, stream, logger): self.logger = logger src = stream.read() - self.soup = BeautifulStoneSoup(xml_to_unicode(src)[0], - selfClosingTags=self.SELF_CLOSING_TAGS) + self.soup = BeautifulStoneSoup(xml_to_unicode(src)[0], + convertEntities=BeautifulStoneSoup.XML_ENTITIES, + selfClosingTags=self.SELF_CLOSING_TAGS) self.objects = {} for obj in self.soup.findAll(objid=True): self.objects[obj['objid']] = obj diff --git a/src/calibre/ebooks/metadata/isbndb.py b/src/calibre/ebooks/metadata/isbndb.py index 3cf5f92eaf..487a52335b 100644 --- a/src/calibre/ebooks/metadata/isbndb.py +++ b/src/calibre/ebooks/metadata/isbndb.py @@ -112,7 +112,8 @@ key is the account key you generate after signing up for a free account from isb default=None, help=_('The title of the book to search for.')) parser.add_option('-p', '--publisher', default=None, dest='publisher', help=_('The publisher of the book to search for.')) - parser.add_option('--verbose', default=False, action='store_true', help=_('Verbose processing')) + parser.add_option('-v', '--verbose', default=False, + action='store_true', help=_('Verbose processing')) return parser diff --git a/src/calibre/gui2/dialogs/comicconf.ui b/src/calibre/gui2/dialogs/comicconf.ui index 36af85764a..acab125d57 100644 --- a/src/calibre/gui2/dialogs/comicconf.ui +++ b/src/calibre/gui2/dialogs/comicconf.ui @@ -1,154 +1,162 @@ - + + Dialog - - + + 0 0 646 - 468 + 503 - + Dialog - - + + :/images/convert.svg:/images/convert.svg - - - - + + + + &Title: - + opt_title - - + + - - - + + + &Author(s): - + opt_author - - + + - - - + + + &Number of Colors: - + opt_colors - - - + + + 8 - + 3200000 - + 8 - - - + + + &Profile: - + opt_profile - - + + - - - + + + Disable &normalize - - - + + + Keep &aspect ratio - - - + + + Disable &Sharpening - - - + + + &Landscape - - - + + + Don't so&rt - - - + + + Qt::Horizontal - + QDialogButtonBox::Cancel|QDialogButtonBox::Ok - - - + + + &Right to left - - - + + + De&speckle - - - + + + &Wide + + + + Disable &Trimming + + + - + @@ -157,11 +165,11 @@ Dialog accept() - + 248 254 - + 157 274 @@ -173,11 +181,11 @@ Dialog reject() - + 316 260 - + 286 274 diff --git a/src/calibre/manual/faq.rst b/src/calibre/manual/faq.rst index bb1eb9ba02..c069842e53 100644 --- a/src/calibre/manual/faq.rst +++ b/src/calibre/manual/faq.rst @@ -34,6 +34,8 @@ What formats does |app| support conversion to/from? | | | | | | | | ODT | ✔ | ✔ | ✔ | | | | | | | +| | FB2 | ✔ | ✔ | ✔ | +| | | | | | | | HTML | ✔ | ✔ | ✔ | | | | | | | | **Input formats** | CBR | ✔ | ✔ | ✔ | diff --git a/src/calibre/web/feeds/recipes/__init__.py b/src/calibre/web/feeds/recipes/__init__.py index 8253021c57..b2c18b26a8 100644 --- a/src/calibre/web/feeds/recipes/__init__.py +++ b/src/calibre/web/feeds/recipes/__init__.py @@ -33,7 +33,7 @@ recipe_modules = ['recipe_' + r for r in ( 'la_republica', 'physics_today', 'chicago_tribune', 'e_novine', 'al_jazeera', 'winsupersite', 'borba', 'courrierinternational', 'lamujerdemivida', 'soldiers', 'theonion', 'news_times', - 'el_universal', 'mediapart', 'wikinews_en', + 'el_universal', 'mediapart', 'wikinews_en', 'ecogeek', )] import re, imp, inspect, time, os diff --git a/src/calibre/web/feeds/recipes/recipe_ecogeek.py b/src/calibre/web/feeds/recipes/recipe_ecogeek.py new file mode 100644 index 0000000000..7695763295 --- /dev/null +++ b/src/calibre/web/feeds/recipes/recipe_ecogeek.py @@ -0,0 +1,31 @@ +#!/usr/bin/env python + +__license__ = 'GPL v3' +__copyright__ = '2009, Darko Miletic ' +''' +EcoGeek.org +''' + +from calibre.web.feeds.news import BasicNewsRecipe + +class EcoGeek(BasicNewsRecipe): + title = 'EcoGeek' + __author__ = 'Darko Miletic' + description = 'EcoGeek - Technology for the Environment Blog Feed' + publisher = 'EcoGeek' + language = _('English') + category = 'news, ecology, blog' + oldest_article = 7 + max_articles_per_feed = 100 + no_stylesheets = True + use_embedded_content = True + + html2lrf_options = [ + '--comment', description + , '--category', category + , '--publisher', publisher + ] + + html2epub_options = 'publisher="' + publisher + '"\ncomments="' + description + '"\ntags="' + category + '"' + + feeds = [(u'Posts', u'http://feeds2.feedburner.com/EcoGeek')] diff --git a/src/calibre/web/feeds/recipes/recipe_nytimes.py b/src/calibre/web/feeds/recipes/recipe_nytimes.py index 270bd5d499..9276ad667a 100644 --- a/src/calibre/web/feeds/recipes/recipe_nytimes.py +++ b/src/calibre/web/feeds/recipes/recipe_nytimes.py @@ -70,10 +70,14 @@ class NYTimesMobile(BasicNewsRecipe): def find_articles(self, root): for a in root.xpath('//a[@accesskey]'): href = a.get('href') + if href.startswith('http://'): + url = href + else: + url = 'http://mobile.nytimes.com/article' + href[href.find('?'):]+'&single=1', yield { 'title': a.text.strip(), 'date' : '', - 'url' : 'http://mobile.nytimes.com/article' + href[href.find('?'):]+'&single=1', + 'url' : url, 'description': '', } diff --git a/src/calibre/web/feeds/recipes/recipe_nytimes_sub.py b/src/calibre/web/feeds/recipes/recipe_nytimes_sub.py index 4a4286b335..5d91dbae38 100644 --- a/src/calibre/web/feeds/recipes/recipe_nytimes_sub.py +++ b/src/calibre/web/feeds/recipes/recipe_nytimes_sub.py @@ -75,7 +75,9 @@ class NYTimes(BasicNewsRecipe): dict(title=title, url=url, date=pubdate, description=description, content='')) - ans = self.sort_index_by(ans, {'The Front Page':-1, 'Dining In, Dining Out':1, 'Obituaries':2}) + ans = self.sort_index_by(ans, {'The Front Page':-1, + 'Dining In, Dining Out':1, + 'Obituaries':2}) ans = [(key, articles[key]) for key in ans if articles.has_key(key)] return ans diff --git a/src/calibre/web/feeds/recipes/recipe_usatoday.py b/src/calibre/web/feeds/recipes/recipe_usatoday.py index dd14cd01b4..b69fce42f3 100644 --- a/src/calibre/web/feeds/recipes/recipe_usatoday.py +++ b/src/calibre/web/feeds/recipes/recipe_usatoday.py @@ -45,3 +45,7 @@ class USAToday(BasicNewsRecipe): def print_version(self, url): return 'http://www.printthis.clickability.com/pt/printThis?clickMap=printThis&fb=Y&url=' + url + def postprocess_html(self, soup, first_fetch): + for t in soup.findAll(['table', 'tr', 'td']): + t.name = 'div' + return soup \ No newline at end of file