diff --git a/resources/recipes/corren2.recipe b/resources/recipes/corren2.recipe new file mode 100644 index 0000000000..944e77b9e2 --- /dev/null +++ b/resources/recipes/corren2.recipe @@ -0,0 +1,38 @@ +from calibre.web.feeds.news import BasicNewsRecipe + +class AdvancedUserRecipe1255797795(BasicNewsRecipe): + title = u'Corren' + __author__ = 'Jonas Svensson' + simultaneous_downloads = 1 + no_stylesheets = True + oldest_article = 7 + max_articles_per_feed = 100 + remove_attributes = ['onload'] + timefmt = '' + + feeds = [ + (u'Toppnyheter (alla kategorier)', u'http://www.corren.se/inc/RssHandler.ashx?id=4122151&ripurl=http://www.corren.se/nyheter/'), + (u'Bostad', u'http://www.corren.se/inc/RssHandler.ashx?id=4122174&ripurl=http://www.corren.se/bostad/'), + (u'Ekonomi & Jobb', u'http://www.corren.se/inc/RssHandler.ashx?id=4122176&ripurl=http://www.corren.se/ekonomi/'), + (u'Kultur & Nöje', u'http://www.corren.se/inc/RssHandler.ashx?id=4122192&ripurl=http://www.corren.se/kultur/'), + (u'Mat & dryck', u'http://www.corren.se/inc/RssHandler.ashx?id=4122201&ripurl=http://www.corren.se/mat-dryck/'), + (u'Motor', u'http://www.corren.se/inc/RssHandler.ashx?id=4122203&ripurl=http://www.corren.se/motor/'), + (u'Sport', u'http://www.corren.se/inc/RssHandler.ashx?id=4122206&ripurl=http://www.corren.se/sport/'), + (u'Åsikter', u'http://www.corren.se/inc/RssHandler.ashx?id=4122223&ripurl=http://www.corren.se/asikter/'), + (u'Mjölby', u'http://www.corren.se/inc/RssHandler.ashx?id=4122235&ripurl=http://www.corren.se/ostergotland/mjolby/'), + (u'Motala', u'http://www.corren.se/inc/RssHandler.ashx?id=4122236&ripurl=http://www.corren.se/ostergotland/motala/') + ] + + def print_version(self, url): + url = url.replace("ekonomi/artikel.aspx", "Print.aspx") + url = url.replace("bostad/artikel.aspx", "Print.aspx") + url = url.replace("kultur/artikel.aspx", "Print.aspx") + url = url.replace("motor/artikel.aspx", "Print.aspx") + url = url.replace("mat-dryck/artikel.aspx", "Print.aspx") + url = url.replace("sport/artikel.aspx", "Print.aspx") + url = url.replace("asikter/artikel.aspx", "Print.aspx") + url = url.replace("mat-dryck/artikel.aspx", "Print.aspx") + url = url.replace("ostergotland/mjolby/artikel.aspx", "Print.aspx") + url = url.replace("ostergotland/motala/artikel.aspx", "Print.aspx") + return url.replace("nyheter/artikel.aspx", "Print.aspx") + diff --git a/resources/recipes/economist.recipe b/resources/recipes/economist.recipe index 30bb2688c8..0f70a1e025 100644 --- a/resources/recipes/economist.recipe +++ b/resources/recipes/economist.recipe @@ -18,7 +18,6 @@ class Economist(BasicNewsRecipe): __author__ = "Kovid Goyal" description = 'Global news and current affairs from a European perspective' oldest_article = 7.0 - needs_subscription = False # Strange but true INDEX = 'http://www.economist.com/printedition' cover_url = 'http://www.economist.com/images/covers/currentcovereu_large.jpg' remove_tags = [dict(name=['script', 'noscript', 'title'])] diff --git a/resources/recipes/politico.recipe b/resources/recipes/politico.recipe index 1f7fc2558e..4f3c306fc0 100644 --- a/resources/recipes/politico.recipe +++ b/resources/recipes/politico.recipe @@ -6,9 +6,12 @@ __copyright__ = '2009, Darko Miletic ' politico.com ''' +import re, traceback + from calibre.web.feeds.news import BasicNewsRecipe class Politico(BasicNewsRecipe): + title = 'Politico' __author__ = 'Darko Miletic' description = 'Political news from USA' @@ -55,13 +58,13 @@ class Politico(BasicNewsRecipe): del item['style'] return soup - def print_url(self, soup, default): - printtags = soup.findAll('a',href=True) - for printtag in printtags: - if printtag.string == "Print": - return printtag['href'] - return default + url_pat = re.compile(r' NEWPRODUCTFOUND - + NEWPRODUCTFOUND diff --git a/src/calibre/debug.py b/src/calibre/debug.py index 1b913318e3..224186878d 100644 --- a/src/calibre/debug.py +++ b/src/calibre/debug.py @@ -165,7 +165,7 @@ def main(args=sys.argv): sys.argv = args[:1] exec opts.command elif opts.exec_file: - sys.argv = args[:1] + sys.argv = args base = os.path.dirname(os.path.abspath(opts.exec_file)) sys.path.insert(0, base) g = globals() diff --git a/src/calibre/manual/faq.rst b/src/calibre/manual/faq.rst index 5d0cd842a1..b50d8000e2 100644 --- a/src/calibre/manual/faq.rst +++ b/src/calibre/manual/faq.rst @@ -141,6 +141,11 @@ Now you should be able to access your books on your iPhone by opening Stanza and Replace ``192.168.1.2`` with the local IP address of the computer running |app|. If you have changed the port the |app| content server is running on, you will have to change ``8080`` as well to the new port. The local IP address is the IP address you computer is assigned on your home network. A quick Google search will tell you how to find out your local IP address. +How do I use |app| with my Android phone? +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +First install the WordPlayer e-book reading app from the Android Marketplace onto you phone. Then simply plug your phone into the computer with a USB cable. |app| should automatically detect the phone and then you can transfer books to it by clicking the Send to Device button. |app| does not have support for every single androind device out there, so if you would like to have support for your device added, follow the instructions above for getting your device supported in |app|. + I get the error message "Failed to start content server: Port 8080 not free on '0.0.0.0'"? ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/src/calibre/web/feeds/news.py b/src/calibre/web/feeds/news.py index f2c921bd82..43c1dfd5f2 100644 --- a/src/calibre/web/feeds/news.py +++ b/src/calibre/web/feeds/news.py @@ -501,8 +501,10 @@ class BasicNewsRecipe(Recipe): if isinstance(self.feeds, basestring): self.feeds = [self.feeds] - if self.needs_subscription and (self.username is None or self.password is None): - raise ValueError('The %s recipe needs a username and password.'%self.title) + if self.needs_subscription and (\ + self.username is None or self.password is None or \ + (not self.username and not self.password)): + raise ValueError(_('The "%s" recipe needs a username and password.')%self.title) self.browser = self.get_browser() self.image_map, self.image_counter = {}, 1 diff --git a/src/calibre/web/feeds/recipes/collection.py b/src/calibre/web/feeds/recipes/collection.py index 852325f706..8002ce07bb 100644 --- a/src/calibre/web/feeds/recipes/collection.py +++ b/src/calibre/web/feeds/recipes/collection.py @@ -193,11 +193,16 @@ class SchedulerConfig(object): def write_scheduler_file(self): from calibre.utils.lock import ExclusiveFile + self.root.text = '\n\n\t' + for x in self.root: + x.tail = '\n\n\t' + if len(self.root) > 0: + self.root[-1].tail = '\n\n' with ExclusiveFile(self.conf_path) as f: f.seek(0) f.truncate() f.write(etree.tostring(self.root, encoding='utf-8', - xml_declaration=True, pretty_print=True)) + xml_declaration=True, pretty_print=False)) def serialize_schedule(self, typ, schedule): s = E.schedule({'type':typ})