diff --git a/src/calibre/constants.py b/src/calibre/constants.py index 00276f6970..138a631b7c 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.5.6' +__version__ = '0.5.7' __author__ = "Kovid Goyal " ''' Various run time constants. diff --git a/src/calibre/devices/usbms/device.py b/src/calibre/devices/usbms/device.py index 63dabe001a..8f2755d3fa 100644 --- a/src/calibre/devices/usbms/device.py +++ b/src/calibre/devices/usbms/device.py @@ -209,7 +209,7 @@ class Device(_Device): time.sleep(6) drives = {} wmi = __import__('wmi', globals(), locals(), [], -1) - c = wmi.WMI() + c = wmi.WMI(find_classes=False) for drive in c.Win32_DiskDrive(): if self.windows_match_device(str(drive.PNPDeviceID), self.WINDOWS_MAIN_MEM): drives['main'] = self.windows_get_drive_prefix(drive) diff --git a/src/calibre/gui2/device.py b/src/calibre/gui2/device.py index 201ab02dd1..8d1b7a1b3a 100644 --- a/src/calibre/gui2/device.py +++ b/src/calibre/gui2/device.py @@ -12,6 +12,7 @@ from PyQt4.Qt import QMenu, QAction, QActionGroup, QIcon, SIGNAL, QPixmap, \ from calibre.customize.ui import available_input_formats, available_output_formats from calibre.devices import devices +from calibre.constants import iswindows from calibre.gui2.dialogs.choose_format import ChooseFormatDialog from calibre.parallel import Job from calibre.devices.scanner import DeviceScanner @@ -71,7 +72,14 @@ class DeviceManager(Thread): if connected and not device[1]: try: dev = device[0]() - dev.open() + if iswindows: + import pythoncom + pythoncom.CoInitialize() + try: + dev.open() + finally: + if iswindows: + pythoncom.CoUninitialize() self.device = dev self.device_class = dev.__class__ self.connected_slot(True) diff --git a/src/calibre/trac/plugins/download.py b/src/calibre/trac/plugins/download.py index e4a0fe36af..a6c9876f20 100644 --- a/src/calibre/trac/plugins/download.py +++ b/src/calibre/trac/plugins/download.py @@ -69,6 +69,7 @@ else: DOWNLOAD_DIR = '/var/www/calibre.kovidgoyal.net/htdocs/downloads' MOBILEREAD = 'https://dev.mobileread.com/dist/kovid/calibre/' + #MOBILEREAD = 'http://calibre.kovidgoyal.net/downloads/' class OS(dict): """Dictionary with a default value for unknown keys.""" @@ -197,6 +198,8 @@ else: import sys, os, shutil, tarfile, subprocess, tempfile, urllib2, re, stat MOBILEREAD='https://dev.mobileread.com/dist/kovid/calibre/' + #MOBILEREAD='http://calibre.kovidgoyal.net/downloads/' + class TerminalController: BOL = '' #: Move the cursor to the beginning of the line diff --git a/src/calibre/trac/plugins/htdocs/images/binary_logo.png b/src/calibre/trac/plugins/htdocs/images/binary_logo.png new file mode 100644 index 0000000000..4387cc8cfe Binary files /dev/null and b/src/calibre/trac/plugins/htdocs/images/binary_logo.png differ diff --git a/src/calibre/trac/plugins/htdocs/images/foresight_logo.png b/src/calibre/trac/plugins/htdocs/images/foresight_logo.png new file mode 100644 index 0000000000..b947eca1a3 Binary files /dev/null and b/src/calibre/trac/plugins/htdocs/images/foresight_logo.png differ diff --git a/src/calibre/web/feeds/news.py b/src/calibre/web/feeds/news.py index c7a39cbc4b..adf86c11e9 100644 --- a/src/calibre/web/feeds/news.py +++ b/src/calibre/web/feeds/news.py @@ -128,6 +128,12 @@ class BasicNewsRecipe(object): #: extra_css = None + #: If True empty feeds are removed from the output. + #: This option has no effect if parse_index is overriden in + #: the sub class. It is meant only for recipes that return a list + #: of feeds using :member:`feeds` or :method:`get_feeds`. + remove_empty_feeds = False + #: List of regular expressions that determines which links to follow #: If empty, it is ignored. For example:: #: @@ -985,6 +991,11 @@ class BasicNewsRecipe(object): self.log.exception(msg) + remove = [f for f in parsed_feeds if len(f) == 0 and + self.remove_empty_feeds] + for f in remove: + parsed_feeds.remove(f) + return parsed_feeds @classmethod diff --git a/src/calibre/web/feeds/recipes/recipe_vreme.py b/src/calibre/web/feeds/recipes/recipe_vreme.py index 697413f2f3..1df953cae3 100644 --- a/src/calibre/web/feeds/recipes/recipe_vreme.py +++ b/src/calibre/web/feeds/recipes/recipe_vreme.py @@ -11,20 +11,23 @@ from calibre import strftime from calibre.web.feeds.news import BasicNewsRecipe class Vreme(BasicNewsRecipe): - title = 'Vreme' - __author__ = 'Darko Miletic' - description = 'Politicki Nedeljnik Srbije' - publisher = 'Vreme d.o.o.' - category = 'news, politics, Serbia' - no_stylesheets = True - remove_javascript = True - needs_subscription = True - INDEX = 'http://www.vreme.com' - LOGIN = 'http://www.vreme.com/account/index.php' - remove_javascript = True - use_embedded_content = False - language = _('Serbian') - extra_css = '@font-face {font-family: "serif1";src:url(res:///opt/sony/ebook/FONT/tt0011m_.ttf)} body{text-align: justify; font-family: serif1, serif} .article_description{font-family: serif1, serif}' + title = 'Vreme' + __author__ = 'Darko Miletic' + description = 'Politicki Nedeljnik Srbije' + publisher = 'NP Vreme d.o.o.' + category = 'news, politics, Serbia' + delay = 1 + no_stylesheets = True + needs_subscription = True + INDEX = 'http://www.vreme.com' + LOGIN = 'http://www.vreme.com/account/login.php?url=%2F' + remove_javascript = True + use_embedded_content = False + encoding = 'utf-8' + language = _('Serbian') + lang = 'sr-Latn-RS' + direction = 'ltr' + extra_css = '@font-face {font-family: "serif1";src:url(res:///opt/sony/ebook/FONT/tt0011m_.ttf)} body{text-align: justify; font-family: serif1, serif} .article_description{font-family: serif1, serif}' html2lrf_options = [ '--comment' , description @@ -52,20 +55,11 @@ class Vreme(BasicNewsRecipe): articles = [] soup = self.index_to_soup(self.INDEX) - for item in soup.findAll('span', attrs={'class':'toc2'}): + for item in soup.findAll(['h3','h4']): description = '' title_prefix = '' - - descript_title_tag = item.findPreviousSibling('span', attrs={'class':'toc1'}) - if descript_title_tag: - title_prefix = self.tag_to_string(descript_title_tag) + ' ' - - descript_tag = item.findNextSibling('span', attrs={'class':'toc3'}) - if descript_tag: - description = self.tag_to_string(descript_tag) - feed_link = item.find('a') - if feed_link and feed_link.has_key('href'): + if feed_link and feed_link.has_key('href') and feed_link['href'].startswith('/cms/view.php'): url = self.INDEX + feed_link['href'] title = title_prefix + self.tag_to_string(feed_link) date = strftime(self.timefmt) @@ -93,14 +87,17 @@ class Vreme(BasicNewsRecipe): del item['face'] for item in soup.findAll(size=True): del item['size'] - mtag = '' - soup.head.insert(0,mtag) + soup.html['lang'] = self.lang + soup.html['dir' ] = self.direction + mtag = '' + mtag += '\n' + soup.head.insert(0,mtag) return soup def get_cover_url(self): cover_url = None soup = self.index_to_soup(self.INDEX) - cover_item = soup.find('img',attrs={'alt':'Naslovna strana broja'}) + cover_item = soup.find('div',attrs={'id':'najava'}) if cover_item: - cover_url = self.INDEX + cover_item['src'] + cover_url = self.INDEX + cover_item.img['src'] return cover_url