mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-06-23 15:30:45 -04:00
Merge from trunk
This commit is contained in:
commit
ae34d84539
@ -12,10 +12,10 @@ class Chronicle(BasicNewsRecipe):
|
|||||||
category = 'news'
|
category = 'news'
|
||||||
encoding = 'UTF-8'
|
encoding = 'UTF-8'
|
||||||
keep_only_tags = [
|
keep_only_tags = [
|
||||||
dict(name='div', attrs={'class':'article'}),
|
dict(name='div', attrs={'class':['article','blog-mod']}),
|
||||||
]
|
]
|
||||||
remove_tags = [dict(name='div',attrs={'class':['related module1','maintitle']}),
|
remove_tags = [dict(name='div',attrs={'class':['related module1','maintitle','entry-utility','object-meta']}),
|
||||||
dict(name='div', attrs={'id':['section-nav','icon-row', 'enlarge-popup']}),
|
dict(name='div', attrs={'id':['section-nav','icon-row', 'enlarge-popup','confirm-popup']}),
|
||||||
dict(name='a', attrs={'class':'show-enlarge enlarge'})]
|
dict(name='a', attrs={'class':'show-enlarge enlarge'})]
|
||||||
no_javascript = True
|
no_javascript = True
|
||||||
no_stylesheets = True
|
no_stylesheets = True
|
||||||
|
@ -124,19 +124,19 @@ class NYTimes(BasicNewsRecipe):
|
|||||||
if headlinesOnly:
|
if headlinesOnly:
|
||||||
title='New York Times Headlines'
|
title='New York Times Headlines'
|
||||||
description = 'Headlines from the New York Times'
|
description = 'Headlines from the New York Times'
|
||||||
needs_subscription = False
|
needs_subscription = True
|
||||||
elif webEdition:
|
elif webEdition:
|
||||||
title='New York Times (Web)'
|
title='New York Times (Web)'
|
||||||
description = 'New York Times on the Web'
|
description = 'New York Times on the Web'
|
||||||
needs_subscription = False
|
needs_subscription = True
|
||||||
elif replaceKindleVersion:
|
elif replaceKindleVersion:
|
||||||
title='The New York Times'
|
title='The New York Times'
|
||||||
description = 'Today\'s New York Times'
|
description = 'Today\'s New York Times'
|
||||||
needs_subscription = False
|
needs_subscription = True
|
||||||
else:
|
else:
|
||||||
title='New York Times'
|
title='New York Times'
|
||||||
description = 'Today\'s New York Times'
|
description = 'Today\'s New York Times'
|
||||||
needs_subscription = False
|
needs_subscription = True
|
||||||
|
|
||||||
def decode_url_date(self,url):
|
def decode_url_date(self,url):
|
||||||
urlitems = url.split('/')
|
urlitems = url.split('/')
|
||||||
@ -359,6 +359,14 @@ class NYTimes(BasicNewsRecipe):
|
|||||||
|
|
||||||
def get_browser(self):
|
def get_browser(self):
|
||||||
br = BasicNewsRecipe.get_browser()
|
br = BasicNewsRecipe.get_browser()
|
||||||
|
if self.username is not None and self.password is not None:
|
||||||
|
br.open('http://www.nytimes.com/auth/login')
|
||||||
|
br.form = br.forms().next()
|
||||||
|
br['userid'] = self.username
|
||||||
|
br['password'] = self.password
|
||||||
|
raw = br.submit().read()
|
||||||
|
if 'Please try again' in raw:
|
||||||
|
raise Exception('Your username and password are incorrect')
|
||||||
return br
|
return br
|
||||||
|
|
||||||
cover_tag = 'NY_NYT'
|
cover_tag = 'NY_NYT'
|
||||||
|
@ -48,10 +48,14 @@ class Smithsonian(BasicNewsRecipe):
|
|||||||
link=post.find('a',href=True)
|
link=post.find('a',href=True)
|
||||||
url=link['href']+'?c=y&story=fullstory'
|
url=link['href']+'?c=y&story=fullstory'
|
||||||
if subsection is not None:
|
if subsection is not None:
|
||||||
subsection_title = self.tag_to_string(subsection)
|
subsection_title = self.tag_to_string(subsection).strip()
|
||||||
prefix = (subsection_title+': ')
|
prefix = (subsection_title+': ')
|
||||||
description=self.tag_to_string(post('p', limit=2)[1]).strip()
|
description=self.tag_to_string(post('p', limit=2)[1]).strip()
|
||||||
else:
|
else:
|
||||||
|
if post.find('img') is not None:
|
||||||
|
subsection_title = self.tag_to_string(post.findPrevious('div', attrs={'class':'departments plainModule'}).find('p', attrs={'class':'article-cat'})).strip()
|
||||||
|
prefix = (subsection_title+': ')
|
||||||
|
|
||||||
description=self.tag_to_string(post.find('p')).strip()
|
description=self.tag_to_string(post.find('p')).strip()
|
||||||
desc=re.sub('\sBy\s.*', '', description, re.DOTALL)
|
desc=re.sub('\sBy\s.*', '', description, re.DOTALL)
|
||||||
author=re.sub('.*By\s', '', description, re.DOTALL)
|
author=re.sub('.*By\s', '', description, re.DOTALL)
|
||||||
@ -64,4 +68,3 @@ class Smithsonian(BasicNewsRecipe):
|
|||||||
feeds[section_title] += articles
|
feeds[section_title] += articles
|
||||||
ans = [(key, val) for key, val in feeds.iteritems()]
|
ans = [(key, val) for key, val in feeds.iteritems()]
|
||||||
return ans
|
return ans
|
||||||
|
|
||||||
|
Binary file not shown.
@ -770,13 +770,25 @@ class PocketBook900Output(OutputProfile):
|
|||||||
dpi = 150.0
|
dpi = 150.0
|
||||||
comic_screen_size = screen_size
|
comic_screen_size = screen_size
|
||||||
|
|
||||||
|
class PocketBookPro912Output(OutputProfile):
|
||||||
|
|
||||||
|
author = 'Daniele Pizzolli'
|
||||||
|
name = 'PocketBook Pro 912'
|
||||||
|
short_name = 'pocketbook_pro_912'
|
||||||
|
description = _('This profile is intended for the PocketBook Pro 912 series of devices.')
|
||||||
|
|
||||||
|
# According to http://download.pocketbook-int.com/user-guides/E_Ink/912/User_Guide_PocketBook_912(EN).pdf
|
||||||
|
screen_size = (825, 1200)
|
||||||
|
dpi = 155.0
|
||||||
|
comic_screen_size = screen_size
|
||||||
|
|
||||||
output_profiles = [OutputProfile, SonyReaderOutput, SonyReader300Output,
|
output_profiles = [OutputProfile, SonyReaderOutput, SonyReader300Output,
|
||||||
SonyReader900Output, MSReaderOutput, MobipocketOutput, HanlinV3Output,
|
SonyReader900Output, MSReaderOutput, MobipocketOutput, HanlinV3Output,
|
||||||
HanlinV5Output, CybookG3Output, CybookOpusOutput, KindleOutput,
|
HanlinV5Output, CybookG3Output, CybookOpusOutput, KindleOutput,
|
||||||
iPadOutput, iPad3Output, KoboReaderOutput, TabletOutput, SamsungGalaxy,
|
iPadOutput, iPad3Output, KoboReaderOutput, TabletOutput, SamsungGalaxy,
|
||||||
SonyReaderLandscapeOutput, KindleDXOutput, IlliadOutput,
|
SonyReaderLandscapeOutput, KindleDXOutput, IlliadOutput,
|
||||||
IRexDR1000Output, IRexDR800Output, JetBook5Output, NookOutput,
|
IRexDR1000Output, IRexDR800Output, JetBook5Output, NookOutput,
|
||||||
BambookOutput, NookColorOutput, PocketBook900Output, GenericEink,
|
BambookOutput, NookColorOutput, PocketBook900Output, PocketBookPro912Output,
|
||||||
GenericEinkLarge, KindleFireOutput, KindlePaperWhiteOutput]
|
GenericEink, GenericEinkLarge, KindleFireOutput, KindlePaperWhiteOutput]
|
||||||
|
|
||||||
output_profiles.sort(cmp=lambda x,y:cmp(x.name.lower(), y.name.lower()))
|
output_profiles.sort(cmp=lambda x,y:cmp(x.name.lower(), y.name.lower()))
|
||||||
|
@ -234,7 +234,7 @@ class POCKETBOOK301(USBMS):
|
|||||||
class POCKETBOOK602(USBMS):
|
class POCKETBOOK602(USBMS):
|
||||||
|
|
||||||
name = 'PocketBook Pro 602/902 Device Interface'
|
name = 'PocketBook Pro 602/902 Device Interface'
|
||||||
description = _('Communicate with the PocketBook 602/603/902/903 reader.')
|
description = _('Communicate with the PocketBook 602/603/902/903/Pro 912 reader.')
|
||||||
author = 'Kovid Goyal'
|
author = 'Kovid Goyal'
|
||||||
supported_platforms = ['windows', 'osx', 'linux']
|
supported_platforms = ['windows', 'osx', 'linux']
|
||||||
FORMATS = ['epub', 'fb2', 'prc', 'mobi', 'pdf', 'djvu', 'rtf', 'chm',
|
FORMATS = ['epub', 'fb2', 'prc', 'mobi', 'pdf', 'djvu', 'rtf', 'chm',
|
||||||
@ -249,7 +249,7 @@ class POCKETBOOK602(USBMS):
|
|||||||
|
|
||||||
VENDOR_NAME = ''
|
VENDOR_NAME = ''
|
||||||
WINDOWS_MAIN_MEM = WINDOWS_CARD_A_MEM = ['PB602', 'PB603', 'PB902',
|
WINDOWS_MAIN_MEM = WINDOWS_CARD_A_MEM = ['PB602', 'PB603', 'PB902',
|
||||||
'PB903', 'PB']
|
'PB903', 'Pocket912', 'PB']
|
||||||
|
|
||||||
class POCKETBOOK622(POCKETBOOK602):
|
class POCKETBOOK622(POCKETBOOK602):
|
||||||
|
|
||||||
|
@ -11,13 +11,17 @@ import struct, os, functools, re
|
|||||||
from urlparse import urldefrag
|
from urlparse import urldefrag
|
||||||
from cStringIO import StringIO
|
from cStringIO import StringIO
|
||||||
from urllib import unquote as urlunquote
|
from urllib import unquote as urlunquote
|
||||||
|
|
||||||
|
from lxml import etree
|
||||||
|
|
||||||
from calibre.ebooks.lit import LitError
|
from calibre.ebooks.lit import LitError
|
||||||
from calibre.ebooks.lit.maps import OPF_MAP, HTML_MAP
|
from calibre.ebooks.lit.maps import OPF_MAP, HTML_MAP
|
||||||
import calibre.ebooks.lit.mssha1 as mssha1
|
import calibre.ebooks.lit.mssha1 as mssha1
|
||||||
from calibre.ebooks.oeb.base import urlnormalize
|
from calibre.ebooks.oeb.base import urlnormalize, xpath
|
||||||
from calibre.ebooks.oeb.reader import OEBReader
|
from calibre.ebooks.oeb.reader import OEBReader
|
||||||
from calibre.ebooks import DRMError
|
from calibre.ebooks import DRMError
|
||||||
from calibre import plugins
|
from calibre import plugins
|
||||||
|
|
||||||
lzx, lxzerror = plugins['lzx']
|
lzx, lxzerror = plugins['lzx']
|
||||||
msdes, msdeserror = plugins['msdes']
|
msdes, msdeserror = plugins['msdes']
|
||||||
|
|
||||||
@ -907,3 +911,16 @@ class LitReader(OEBReader):
|
|||||||
Container = LitContainer
|
Container = LitContainer
|
||||||
DEFAULT_PROFILE = 'MSReader'
|
DEFAULT_PROFILE = 'MSReader'
|
||||||
|
|
||||||
|
def _spine_from_opf(self, opf):
|
||||||
|
manifest = self.oeb.manifest
|
||||||
|
for elem in xpath(opf, '/o2:package/o2:spine/o2:itemref'):
|
||||||
|
idref = elem.get('idref')
|
||||||
|
if idref not in manifest.ids:
|
||||||
|
continue
|
||||||
|
item = manifest.ids[idref]
|
||||||
|
if (item.media_type.lower() == 'application/xml' and
|
||||||
|
hasattr(item.data, 'xpath') and item.data.xpath('/html')):
|
||||||
|
item.media_type = 'application/xhtml+xml'
|
||||||
|
item.data = item._parse_xhtml(etree.tostring(item.data))
|
||||||
|
super(LitReader, self)._spine_from_opf(opf)
|
||||||
|
|
||||||
|
@ -390,6 +390,10 @@ class MetadataUpdater(object):
|
|||||||
not added_501 and not share_not_sync):
|
not added_501 and not share_not_sync):
|
||||||
from uuid import uuid4
|
from uuid import uuid4
|
||||||
update_exth_record((113, str(uuid4())))
|
update_exth_record((113, str(uuid4())))
|
||||||
|
# Add a 112 record with actual UUID
|
||||||
|
if getattr(mi, 'uuid', None):
|
||||||
|
update_exth_record((112,
|
||||||
|
(u"calibre:%s" % mi.uuid).encode(self.codec, 'replace')))
|
||||||
if 503 in self.original_exth_records:
|
if 503 in self.original_exth_records:
|
||||||
update_exth_record((503, mi.title.encode(self.codec, 'replace')))
|
update_exth_record((503, mi.title.encode(self.codec, 'replace')))
|
||||||
|
|
||||||
|
@ -110,6 +110,12 @@ def build_exth(metadata, prefer_author_sort=False, is_periodical=False,
|
|||||||
exth.write(uuid)
|
exth.write(uuid)
|
||||||
nrecs += 1
|
nrecs += 1
|
||||||
|
|
||||||
|
# Write UUID as SOURCE
|
||||||
|
c_uuid = b'calibre:%s' % uuid
|
||||||
|
exth.write(pack(b'>II', 112, len(c_uuid) + 8))
|
||||||
|
exth.write(c_uuid)
|
||||||
|
nrecs += 1
|
||||||
|
|
||||||
# Write cdetype
|
# Write cdetype
|
||||||
if not is_periodical:
|
if not is_periodical:
|
||||||
if not share_not_sync:
|
if not share_not_sync:
|
||||||
|
@ -43,14 +43,16 @@ class StoreAction(InterfaceAction):
|
|||||||
icon.addFile(I('donate.png'), QSize(16, 16))
|
icon.addFile(I('donate.png'), QSize(16, 16))
|
||||||
for n, p in sorted(self.gui.istores.items(), key=lambda x: x[0].lower()):
|
for n, p in sorted(self.gui.istores.items(), key=lambda x: x[0].lower()):
|
||||||
if p.base_plugin.affiliate:
|
if p.base_plugin.affiliate:
|
||||||
self.store_list_menu.addAction(icon, n, partial(self.open_store, p))
|
self.store_list_menu.addAction(icon, n,
|
||||||
|
partial(self.open_store, n))
|
||||||
else:
|
else:
|
||||||
self.store_list_menu.addAction(n, partial(self.open_store, p))
|
self.store_list_menu.addAction(n, partial(self.open_store, n))
|
||||||
|
|
||||||
def do_search(self):
|
def do_search(self):
|
||||||
return self.search()
|
return self.search()
|
||||||
|
|
||||||
def search(self, query=''):
|
def search(self, query=''):
|
||||||
|
self.gui.istores.check_for_updates()
|
||||||
self.show_disclaimer()
|
self.show_disclaimer()
|
||||||
from calibre.gui2.store.search.search import SearchDialog
|
from calibre.gui2.store.search.search import SearchDialog
|
||||||
sd = SearchDialog(self.gui, self.gui, query)
|
sd = SearchDialog(self.gui, self.gui, query)
|
||||||
@ -125,9 +127,13 @@ class StoreAction(InterfaceAction):
|
|||||||
self.gui.load_store_plugins()
|
self.gui.load_store_plugins()
|
||||||
self.load_menu()
|
self.load_menu()
|
||||||
|
|
||||||
def open_store(self, store_plugin):
|
def open_store(self, store_plugin_name):
|
||||||
|
self.gui.istores.check_for_updates()
|
||||||
self.show_disclaimer()
|
self.show_disclaimer()
|
||||||
store_plugin.open(self.gui)
|
# It's not too important that the updated plugin have finished loading
|
||||||
|
# at this point
|
||||||
|
self.gui.istores.join(1.0)
|
||||||
|
self.gui.istores[store_plugin_name].open(self.gui)
|
||||||
|
|
||||||
def show_disclaimer(self):
|
def show_disclaimer(self):
|
||||||
confirm(('<p>' +
|
confirm(('<p>' +
|
||||||
|
@ -383,12 +383,14 @@ class Series(Base):
|
|||||||
values = list(self.db.all_custom(num=self.col_id))
|
values = list(self.db.all_custom(num=self.col_id))
|
||||||
values.sort(key=sort_key)
|
values.sort(key=sort_key)
|
||||||
val = self.db.get_custom(book_id, num=self.col_id, index_is_id=True)
|
val = self.db.get_custom(book_id, num=self.col_id, index_is_id=True)
|
||||||
s_index = self.db.get_custom_extra(book_id, num=self.col_id, index_is_id=True)
|
|
||||||
if s_index is None:
|
|
||||||
s_index = 0.0
|
|
||||||
self.idx_widget.setValue(s_index)
|
|
||||||
self.initial_index = s_index
|
|
||||||
self.initial_val = val
|
self.initial_val = val
|
||||||
|
s_index = self.db.get_custom_extra(book_id, num=self.col_id, index_is_id=True)
|
||||||
|
self.initial_index = s_index
|
||||||
|
try:
|
||||||
|
s_index = float(s_index)
|
||||||
|
except (ValueError, TypeError):
|
||||||
|
s_index = 1.0
|
||||||
|
self.idx_widget.setValue(s_index)
|
||||||
val = self.normalize_db_val(val)
|
val = self.normalize_db_val(val)
|
||||||
self.name_widget.blockSignals(True)
|
self.name_widget.blockSignals(True)
|
||||||
self.name_widget.update_items_cache(values)
|
self.name_widget.update_items_cache(values)
|
||||||
|
@ -49,13 +49,16 @@ class StorePlugin(object): # {{{
|
|||||||
See declined.txt for a list of stores that do not want to be included.
|
See declined.txt for a list of stores that do not want to be included.
|
||||||
'''
|
'''
|
||||||
|
|
||||||
def __init__(self, gui, name):
|
minimum_calibre_version = (0, 9, 14)
|
||||||
from calibre.gui2 import JSONConfig
|
|
||||||
|
|
||||||
|
def __init__(self, gui, name, config=None, base_plugin=None):
|
||||||
self.gui = gui
|
self.gui = gui
|
||||||
self.name = name
|
self.name = name
|
||||||
self.base_plugin = None
|
self.base_plugin = base_plugin
|
||||||
self.config = JSONConfig('store/stores/' + ascii_filename(self.name))
|
if config is None:
|
||||||
|
from calibre.gui2 import JSONConfig
|
||||||
|
config = JSONConfig('store/stores/' + ascii_filename(self.name))
|
||||||
|
self.config = config
|
||||||
|
|
||||||
def open(self, gui, parent=None, detail_item=None, external=False):
|
def open(self, gui, parent=None, detail_item=None, external=False):
|
||||||
'''
|
'''
|
||||||
|
197
src/calibre/gui2/store/loader.py
Normal file
197
src/calibre/gui2/store/loader.py
Normal file
@ -0,0 +1,197 @@
|
|||||||
|
#!/usr/bin/env python
|
||||||
|
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:fdm=marker:ai
|
||||||
|
from __future__ import (unicode_literals, division, absolute_import,
|
||||||
|
print_function)
|
||||||
|
|
||||||
|
__license__ = 'GPL v3'
|
||||||
|
__copyright__ = '2013, Kovid Goyal <kovid at kovidgoyal.net>'
|
||||||
|
__docformat__ = 'restructuredtext en'
|
||||||
|
|
||||||
|
import sys, time, io, re
|
||||||
|
from zlib import decompressobj
|
||||||
|
from collections import OrderedDict
|
||||||
|
from threading import Thread
|
||||||
|
from urllib import urlencode
|
||||||
|
|
||||||
|
from calibre import prints, browser
|
||||||
|
from calibre.constants import numeric_version, DEBUG
|
||||||
|
from calibre.gui2.store import StorePlugin
|
||||||
|
from calibre.utils.config import JSONConfig
|
||||||
|
|
||||||
|
class VersionMismatch(ValueError):
|
||||||
|
def __init__(self, ver):
|
||||||
|
ValueError.__init__(self, 'calibre too old')
|
||||||
|
self.ver = ver
|
||||||
|
|
||||||
|
def download_updates(ver_map={}, server='http://status.calibre-ebook.com'):
|
||||||
|
data = {k:type(u'')(v) for k, v in ver_map.iteritems()}
|
||||||
|
data['ver'] = '1'
|
||||||
|
url = '%s/stores?%s'%(server, urlencode(data))
|
||||||
|
br = browser()
|
||||||
|
# We use a timeout here to ensure the non-daemonic update thread does not
|
||||||
|
# cause calibre to hang indefinitely during shutdown
|
||||||
|
raw = br.open(url, timeout=4.0).read()
|
||||||
|
|
||||||
|
while raw:
|
||||||
|
name, raw = raw.partition(b'\0')[0::2]
|
||||||
|
name = name.decode('utf-8')
|
||||||
|
d = decompressobj()
|
||||||
|
src = d.decompress(raw)
|
||||||
|
src = src.decode('utf-8')
|
||||||
|
# Python complains if there is a coding declaration in a unicode string
|
||||||
|
src = re.sub(r'^#.*coding\s*[:=]\s*([-\w.]+)', '#', src, flags=re.MULTILINE)
|
||||||
|
# Translate newlines to \n
|
||||||
|
src = io.StringIO(src, newline=None).getvalue()
|
||||||
|
yield name, src
|
||||||
|
raw = d.unused_data
|
||||||
|
|
||||||
|
class Stores(OrderedDict):
|
||||||
|
|
||||||
|
CHECK_INTERVAL = 24 * 60 * 60
|
||||||
|
|
||||||
|
def builtins_loaded(self):
|
||||||
|
self.last_check_time = 0
|
||||||
|
self.version_map = {}
|
||||||
|
self.cached_version_map = {}
|
||||||
|
self.name_rmap = {}
|
||||||
|
for key, val in self.iteritems():
|
||||||
|
prefix, name = val.__module__.rpartition('.')[0::2]
|
||||||
|
if prefix == 'calibre.gui2.store.stores' and name.endswith('_plugin'):
|
||||||
|
module = sys.modules[val.__module__]
|
||||||
|
sv = getattr(module, 'store_version', None)
|
||||||
|
if sv is not None:
|
||||||
|
name = name.rpartition('_')[0]
|
||||||
|
self.version_map[name] = sv
|
||||||
|
self.name_rmap[name] = key
|
||||||
|
self.cache_file = JSONConfig('store/plugin_cache')
|
||||||
|
self.load_cache()
|
||||||
|
|
||||||
|
def load_cache(self):
|
||||||
|
# Load plugins from on disk cache
|
||||||
|
remove = set()
|
||||||
|
pat = re.compile(r'^store_version\s*=\s*(\d+)', re.M)
|
||||||
|
for name, src in self.cache_file.iteritems():
|
||||||
|
try:
|
||||||
|
key = self.name_rmap[name]
|
||||||
|
except KeyError:
|
||||||
|
# Plugin has been disabled
|
||||||
|
m = pat.search(src[:512])
|
||||||
|
if m is not None:
|
||||||
|
try:
|
||||||
|
self.cached_version_map[name] = int(m.group(1))
|
||||||
|
except (TypeError, ValueError):
|
||||||
|
pass
|
||||||
|
continue
|
||||||
|
|
||||||
|
try:
|
||||||
|
obj, ver = self.load_object(src, key)
|
||||||
|
except VersionMismatch as e:
|
||||||
|
self.cached_version_map[name] = e.ver
|
||||||
|
continue
|
||||||
|
except:
|
||||||
|
import traceback
|
||||||
|
prints('Failed to load cached store:', name)
|
||||||
|
traceback.print_exc()
|
||||||
|
else:
|
||||||
|
if not self.replace_plugin(ver, name, obj, 'cached'):
|
||||||
|
# Builtin plugin is newer than cached
|
||||||
|
remove.add(name)
|
||||||
|
|
||||||
|
if remove:
|
||||||
|
with self.cache_file:
|
||||||
|
for name in remove:
|
||||||
|
del self.cache_file[name]
|
||||||
|
|
||||||
|
def check_for_updates(self):
|
||||||
|
if hasattr(self, 'update_thread') and self.update_thread.is_alive():
|
||||||
|
return
|
||||||
|
if time.time() - self.last_check_time < self.CHECK_INTERVAL:
|
||||||
|
return
|
||||||
|
self.last_check_time = time.time()
|
||||||
|
try:
|
||||||
|
self.update_thread.start()
|
||||||
|
except (RuntimeError, AttributeError):
|
||||||
|
self.update_thread = Thread(target=self.do_update)
|
||||||
|
self.update_thread.start()
|
||||||
|
|
||||||
|
def join(self, timeout=None):
|
||||||
|
hasattr(self, 'update_thread') and self.update_thread.join(timeout)
|
||||||
|
|
||||||
|
def download_updates(self):
|
||||||
|
ver_map = {name:max(ver, self.cached_version_map.get(name, -1))
|
||||||
|
for name, ver in self.version_map.iteritems()}
|
||||||
|
try:
|
||||||
|
updates = download_updates(ver_map)
|
||||||
|
except:
|
||||||
|
import traceback
|
||||||
|
traceback.print_exc()
|
||||||
|
else:
|
||||||
|
for name, code in updates:
|
||||||
|
yield name, code
|
||||||
|
|
||||||
|
def do_update(self):
|
||||||
|
replacements = {}
|
||||||
|
|
||||||
|
for name, src in self.download_updates():
|
||||||
|
try:
|
||||||
|
key = self.name_rmap[name]
|
||||||
|
except KeyError:
|
||||||
|
# Plugin has been disabled
|
||||||
|
replacements[name] = src
|
||||||
|
continue
|
||||||
|
try:
|
||||||
|
obj, ver = self.load_object(src, key)
|
||||||
|
except VersionMismatch as e:
|
||||||
|
self.cached_version_map[name] = e.ver
|
||||||
|
replacements[name] = src
|
||||||
|
continue
|
||||||
|
except:
|
||||||
|
import traceback
|
||||||
|
prints('Failed to load downloaded store:', name)
|
||||||
|
traceback.print_exc()
|
||||||
|
else:
|
||||||
|
if self.replace_plugin(ver, name, obj, 'downloaded'):
|
||||||
|
replacements[name] = src
|
||||||
|
|
||||||
|
if replacements:
|
||||||
|
with self.cache_file:
|
||||||
|
for name, src in replacements.iteritems():
|
||||||
|
self.cache_file[name] = src
|
||||||
|
|
||||||
|
def replace_plugin(self, ver, name, obj, source):
|
||||||
|
if ver > self.version_map[name]:
|
||||||
|
if DEBUG:
|
||||||
|
prints('Loaded', source, 'store plugin for:',
|
||||||
|
self.name_rmap[name], 'at version:', ver)
|
||||||
|
self[self.name_rmap[name]] = obj
|
||||||
|
self.version_map[name] = ver
|
||||||
|
return True
|
||||||
|
return False
|
||||||
|
|
||||||
|
def load_object(self, src, key):
|
||||||
|
namespace = {}
|
||||||
|
builtin = self[key]
|
||||||
|
exec src in namespace
|
||||||
|
ver = namespace['store_version']
|
||||||
|
cls = None
|
||||||
|
for x in namespace.itervalues():
|
||||||
|
if (isinstance(x, type) and issubclass(x, StorePlugin) and x is not
|
||||||
|
StorePlugin):
|
||||||
|
cls = x
|
||||||
|
break
|
||||||
|
if cls is None:
|
||||||
|
raise ValueError('No store plugin found')
|
||||||
|
if cls.minimum_calibre_version > numeric_version:
|
||||||
|
raise VersionMismatch(ver)
|
||||||
|
return cls(builtin.gui, builtin.name, config=builtin.config,
|
||||||
|
base_plugin=builtin.base_plugin), ver
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
st = time.time()
|
||||||
|
for name, code in download_updates():
|
||||||
|
print(name)
|
||||||
|
print(code)
|
||||||
|
print('\n', '_'*80, '\n', sep='')
|
||||||
|
print ('Time to download all plugins: %.2f'%( time.time() - st))
|
||||||
|
|
||||||
|
|
@ -194,6 +194,7 @@ class SearchDialog(QDialog, Ui_Dialog):
|
|||||||
query = self.clean_query(query)
|
query = self.clean_query(query)
|
||||||
shuffle(store_names)
|
shuffle(store_names)
|
||||||
# Add plugins that the user has checked to the search pool's work queue.
|
# Add plugins that the user has checked to the search pool's work queue.
|
||||||
|
self.gui.istores.join(4.0) # Wait for updated plugins to load
|
||||||
for n in store_names:
|
for n in store_names:
|
||||||
if self.store_checks[n].isChecked():
|
if self.store_checks[n].isChecked():
|
||||||
self.search_pool.add_task(query, n, self.gui.istores[n], self.max_results, self.timeout)
|
self.search_pool.add_task(query, n, self.gui.istores[n], self.max_results, self.timeout)
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
from __future__ import (unicode_literals, division, absolute_import, print_function)
|
from __future__ import (unicode_literals, division, absolute_import, print_function)
|
||||||
|
store_version = 1 # Needed for dynamic plugin loading
|
||||||
|
|
||||||
__license__ = 'GPL 3'
|
__license__ = 'GPL 3'
|
||||||
__copyright__ = '2011, John Schember <john@nachtimwald.com>'
|
__copyright__ = '2011, John Schember <john@nachtimwald.com>'
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
from __future__ import (unicode_literals, division, absolute_import, print_function)
|
from __future__ import (unicode_literals, division, absolute_import, print_function)
|
||||||
|
store_version = 1 # Needed for dynamic plugin loading
|
||||||
|
|
||||||
__license__ = 'GPL 3'
|
__license__ = 'GPL 3'
|
||||||
__copyright__ = '2011, John Schember <john@nachtimwald.com>'
|
__copyright__ = '2011, John Schember <john@nachtimwald.com>'
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
from __future__ import (unicode_literals, division, absolute_import, print_function)
|
from __future__ import (unicode_literals, division, absolute_import, print_function)
|
||||||
|
store_version = 1 # Needed for dynamic plugin loading
|
||||||
|
|
||||||
__license__ = 'GPL 3'
|
__license__ = 'GPL 3'
|
||||||
__copyright__ = '2011, John Schember <john@nachtimwald.com>'
|
__copyright__ = '2011, John Schember <john@nachtimwald.com>'
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
from __future__ import (unicode_literals, division, absolute_import, print_function)
|
from __future__ import (unicode_literals, division, absolute_import, print_function)
|
||||||
|
store_version = 1 # Needed for dynamic plugin loading
|
||||||
|
|
||||||
__license__ = 'GPL 3'
|
__license__ = 'GPL 3'
|
||||||
__copyright__ = '2011, John Schember <john@nachtimwald.com>'
|
__copyright__ = '2011, John Schember <john@nachtimwald.com>'
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
from __future__ import (unicode_literals, division, absolute_import, print_function)
|
from __future__ import (unicode_literals, division, absolute_import, print_function)
|
||||||
|
store_version = 1 # Needed for dynamic plugin loading
|
||||||
|
|
||||||
__license__ = 'GPL 3'
|
__license__ = 'GPL 3'
|
||||||
__copyright__ = '2011, John Schember <john@nachtimwald.com>'
|
__copyright__ = '2011, John Schember <john@nachtimwald.com>'
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
from __future__ import (unicode_literals, division, absolute_import, print_function)
|
from __future__ import (unicode_literals, division, absolute_import, print_function)
|
||||||
|
store_version = 1 # Needed for dynamic plugin loading
|
||||||
|
|
||||||
__license__ = 'GPL 3'
|
__license__ = 'GPL 3'
|
||||||
__copyright__ = '2011, John Schember <john@nachtimwald.com>'
|
__copyright__ = '2011, John Schember <john@nachtimwald.com>'
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
from __future__ import (unicode_literals, division, absolute_import, print_function)
|
from __future__ import (unicode_literals, division, absolute_import, print_function)
|
||||||
|
store_version = 1 # Needed for dynamic plugin loading
|
||||||
|
|
||||||
__license__ = 'GPL 3'
|
__license__ = 'GPL 3'
|
||||||
__copyright__ = '2011, John Schember <john@nachtimwald.com>'
|
__copyright__ = '2011, John Schember <john@nachtimwald.com>'
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
from __future__ import (unicode_literals, division, absolute_import, print_function)
|
from __future__ import (unicode_literals, division, absolute_import, print_function)
|
||||||
|
store_version = 1 # Needed for dynamic plugin loading
|
||||||
|
|
||||||
__license__ = 'GPL 3'
|
__license__ = 'GPL 3'
|
||||||
__copyright__ = '2011, John Schember <john@nachtimwald.com>'
|
__copyright__ = '2011, John Schember <john@nachtimwald.com>'
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
from __future__ import (unicode_literals, division, absolute_import, print_function)
|
from __future__ import (unicode_literals, division, absolute_import, print_function)
|
||||||
|
store_version = 1 # Needed for dynamic plugin loading
|
||||||
|
|
||||||
__license__ = 'GPL 3'
|
__license__ = 'GPL 3'
|
||||||
__copyright__ = '2011, John Schember <john@nachtimwald.com>'
|
__copyright__ = '2011, John Schember <john@nachtimwald.com>'
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
from __future__ import (unicode_literals, division, absolute_import, print_function)
|
from __future__ import (unicode_literals, division, absolute_import, print_function)
|
||||||
|
store_version = 1 # Needed for dynamic plugin loading
|
||||||
|
|
||||||
__license__ = 'GPL 3'
|
__license__ = 'GPL 3'
|
||||||
__copyright__ = '2012, Alex Stanev <alex@stanev.org>'
|
__copyright__ = '2012, Alex Stanev <alex@stanev.org>'
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
from __future__ import (unicode_literals, division, absolute_import, print_function)
|
from __future__ import (unicode_literals, division, absolute_import, print_function)
|
||||||
|
store_version = 1 # Needed for dynamic plugin loading
|
||||||
|
|
||||||
__license__ = 'GPL 3'
|
__license__ = 'GPL 3'
|
||||||
__copyright__ = '2011, John Schember <john@nachtimwald.com>'
|
__copyright__ = '2011, John Schember <john@nachtimwald.com>'
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
from __future__ import (unicode_literals, division, absolute_import, print_function)
|
from __future__ import (unicode_literals, division, absolute_import, print_function)
|
||||||
|
store_version = 1 # Needed for dynamic plugin loading
|
||||||
|
|
||||||
__license__ = 'GPL 3'
|
__license__ = 'GPL 3'
|
||||||
__copyright__ = '2011, Tomasz Długosz <tomek3d@gmail.com>'
|
__copyright__ = '2011, Tomasz Długosz <tomek3d@gmail.com>'
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
from __future__ import (unicode_literals, division, absolute_import, print_function)
|
from __future__ import (unicode_literals, division, absolute_import, print_function)
|
||||||
|
store_version = 1 # Needed for dynamic plugin loading
|
||||||
|
|
||||||
__license__ = 'GPL 3'
|
__license__ = 'GPL 3'
|
||||||
__copyright__ = '2011, Alex Stanev <alex@stanev.org>'
|
__copyright__ = '2011, Alex Stanev <alex@stanev.org>'
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
from __future__ import (unicode_literals, division, absolute_import, print_function)
|
from __future__ import (unicode_literals, division, absolute_import, print_function)
|
||||||
|
store_version = 1 # Needed for dynamic plugin loading
|
||||||
|
|
||||||
__license__ = 'GPL 3'
|
__license__ = 'GPL 3'
|
||||||
__copyright__ = '2011, John Schember <john@nachtimwald.com>'
|
__copyright__ = '2011, John Schember <john@nachtimwald.com>'
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
from __future__ import (unicode_literals, division, absolute_import, print_function)
|
from __future__ import (unicode_literals, division, absolute_import, print_function)
|
||||||
|
store_version = 1 # Needed for dynamic plugin loading
|
||||||
|
|
||||||
__license__ = 'GPL 3'
|
__license__ = 'GPL 3'
|
||||||
__copyright__ = '2011, John Schember <john@nachtimwald.com>'
|
__copyright__ = '2011, John Schember <john@nachtimwald.com>'
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
from __future__ import (unicode_literals, division, absolute_import, print_function)
|
from __future__ import (unicode_literals, division, absolute_import, print_function)
|
||||||
|
store_version = 1 # Needed for dynamic plugin loading
|
||||||
|
|
||||||
__license__ = 'GPL 3'
|
__license__ = 'GPL 3'
|
||||||
__copyright__ = '2011-2012, Tomasz Długosz <tomek3d@gmail.com>'
|
__copyright__ = '2011-2012, Tomasz Długosz <tomek3d@gmail.com>'
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
from __future__ import (unicode_literals, division, absolute_import, print_function)
|
from __future__ import (unicode_literals, division, absolute_import, print_function)
|
||||||
|
store_version = 1 # Needed for dynamic plugin loading
|
||||||
|
|
||||||
__license__ = 'GPL 3'
|
__license__ = 'GPL 3'
|
||||||
__copyright__ = '2011, John Schember <john@nachtimwald.com>'
|
__copyright__ = '2011, John Schember <john@nachtimwald.com>'
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
|
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
from __future__ import (unicode_literals, division, absolute_import, print_function)
|
from __future__ import (unicode_literals, division, absolute_import, print_function)
|
||||||
|
store_version = 1 # Needed for dynamic plugin loading
|
||||||
|
|
||||||
__license__ = 'GPL 3'
|
__license__ = 'GPL 3'
|
||||||
__copyright__ = '2012, Florent FAYOLLE <florent.fayolle69@gmail.com>'
|
__copyright__ = '2012, Florent FAYOLLE <florent.fayolle69@gmail.com>'
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
from __future__ import (unicode_literals, division, absolute_import, print_function)
|
from __future__ import (unicode_literals, division, absolute_import, print_function)
|
||||||
|
store_version = 1 # Needed for dynamic plugin loading
|
||||||
|
|
||||||
__license__ = 'GPL 3'
|
__license__ = 'GPL 3'
|
||||||
__copyright__ = '2011, John Schember <john@nachtimwald.com>'
|
__copyright__ = '2011, John Schember <john@nachtimwald.com>'
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
from __future__ import (unicode_literals, division, absolute_import, print_function)
|
from __future__ import (unicode_literals, division, absolute_import, print_function)
|
||||||
|
store_version = 1 # Needed for dynamic plugin loading
|
||||||
|
|
||||||
__license__ = 'GPL 3'
|
__license__ = 'GPL 3'
|
||||||
__copyright__ = '2011, John Schember <john@nachtimwald.com>'
|
__copyright__ = '2011, John Schember <john@nachtimwald.com>'
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
from __future__ import (unicode_literals, division, absolute_import, print_function)
|
from __future__ import (unicode_literals, division, absolute_import, print_function)
|
||||||
|
store_version = 1 # Needed for dynamic plugin loading
|
||||||
|
|
||||||
__license__ = 'GPL 3'
|
__license__ = 'GPL 3'
|
||||||
__copyright__ = '2011, Alex Stanev <alex@stanev.org>'
|
__copyright__ = '2011, Alex Stanev <alex@stanev.org>'
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
from __future__ import (unicode_literals, division, absolute_import, print_function)
|
from __future__ import (unicode_literals, division, absolute_import, print_function)
|
||||||
|
store_version = 1 # Needed for dynamic plugin loading
|
||||||
|
|
||||||
__license__ = 'GPL 3'
|
__license__ = 'GPL 3'
|
||||||
__copyright__ = '2011-2012, Tomasz Długosz <tomek3d@gmail.com>'
|
__copyright__ = '2011-2012, Tomasz Długosz <tomek3d@gmail.com>'
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
from __future__ import (unicode_literals, division, absolute_import, print_function)
|
from __future__ import (unicode_literals, division, absolute_import, print_function)
|
||||||
|
store_version = 1 # Needed for dynamic plugin loading
|
||||||
|
|
||||||
__license__ = 'GPL 3'
|
__license__ = 'GPL 3'
|
||||||
__copyright__ = '2011, Tomasz Długosz <tomek3d@gmail.com>'
|
__copyright__ = '2011, Tomasz Długosz <tomek3d@gmail.com>'
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
from __future__ import (unicode_literals, division, absolute_import, print_function)
|
from __future__ import (unicode_literals, division, absolute_import, print_function)
|
||||||
|
store_version = 1 # Needed for dynamic plugin loading
|
||||||
|
|
||||||
__license__ = 'GPL 3'
|
__license__ = 'GPL 3'
|
||||||
__copyright__ = '2011, John Schember <john@nachtimwald.com>'
|
__copyright__ = '2011, John Schember <john@nachtimwald.com>'
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
from __future__ import (unicode_literals, division, absolute_import, print_function)
|
from __future__ import (unicode_literals, division, absolute_import, print_function)
|
||||||
|
store_version = 1 # Needed for dynamic plugin loading
|
||||||
|
|
||||||
__license__ = 'GPL 3'
|
__license__ = 'GPL 3'
|
||||||
__copyright__ = '2011, John Schember <john@nachtimwald.com>'
|
__copyright__ = '2011, John Schember <john@nachtimwald.com>'
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
from __future__ import (unicode_literals, division, absolute_import, print_function)
|
from __future__ import (unicode_literals, division, absolute_import, print_function)
|
||||||
|
store_version = 1 # Needed for dynamic plugin loading
|
||||||
|
|
||||||
__license__ = 'GPL 3'
|
__license__ = 'GPL 3'
|
||||||
__copyright__ = '2011, John Schember <john@nachtimwald.com>'
|
__copyright__ = '2011, John Schember <john@nachtimwald.com>'
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
from __future__ import (unicode_literals, division, absolute_import, print_function)
|
from __future__ import (unicode_literals, division, absolute_import, print_function)
|
||||||
|
store_version = 1 # Needed for dynamic plugin loading
|
||||||
|
|
||||||
__license__ = 'GPL 3'
|
__license__ = 'GPL 3'
|
||||||
__copyright__ = '2011, John Schember <john@nachtimwald.com>'
|
__copyright__ = '2011, John Schember <john@nachtimwald.com>'
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
from __future__ import (unicode_literals, division, absolute_import, print_function)
|
from __future__ import (unicode_literals, division, absolute_import, print_function)
|
||||||
|
store_version = 1 # Needed for dynamic plugin loading
|
||||||
|
|
||||||
__license__ = 'GPL 3'
|
__license__ = 'GPL 3'
|
||||||
__copyright__ = '2011, John Schember <john@nachtimwald.com>'
|
__copyright__ = '2011, John Schember <john@nachtimwald.com>'
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
from __future__ import (unicode_literals, division, absolute_import, print_function)
|
from __future__ import (unicode_literals, division, absolute_import, print_function)
|
||||||
|
store_version = 1 # Needed for dynamic plugin loading
|
||||||
|
|
||||||
__license__ = 'GPL 3'
|
__license__ = 'GPL 3'
|
||||||
__copyright__ = '2011, Tomasz Długosz <tomek3d@gmail.com>'
|
__copyright__ = '2011, Tomasz Długosz <tomek3d@gmail.com>'
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
from __future__ import (unicode_literals, division, absolute_import, print_function)
|
from __future__ import (unicode_literals, division, absolute_import, print_function)
|
||||||
|
store_version = 1 # Needed for dynamic plugin loading
|
||||||
|
|
||||||
__license__ = 'GPL 3'
|
__license__ = 'GPL 3'
|
||||||
__copyright__ = '2011, John Schember <john@nachtimwald.com>'
|
__copyright__ = '2011, John Schember <john@nachtimwald.com>'
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
from __future__ import (unicode_literals, division, absolute_import, print_function)
|
from __future__ import (unicode_literals, division, absolute_import, print_function)
|
||||||
|
store_version = 1 # Needed for dynamic plugin loading
|
||||||
|
|
||||||
__license__ = 'GPL 3'
|
__license__ = 'GPL 3'
|
||||||
__copyright__ = '2011, Roman Mukhin <ramses_ru at hotmail.com>'
|
__copyright__ = '2011, Roman Mukhin <ramses_ru at hotmail.com>'
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
from __future__ import (unicode_literals, division, absolute_import, print_function)
|
from __future__ import (unicode_literals, division, absolute_import, print_function)
|
||||||
|
store_version = 1 # Needed for dynamic plugin loading
|
||||||
|
|
||||||
__license__ = 'GPL 3'
|
__license__ = 'GPL 3'
|
||||||
__copyright__ = '2011, John Schember <john@nachtimwald.com>'
|
__copyright__ = '2011, John Schember <john@nachtimwald.com>'
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
from __future__ import (unicode_literals, division, absolute_import, print_function)
|
from __future__ import (unicode_literals, division, absolute_import, print_function)
|
||||||
|
store_version = 1 # Needed for dynamic plugin loading
|
||||||
|
|
||||||
__license__ = 'GPL 3'
|
__license__ = 'GPL 3'
|
||||||
__copyright__ = '2011, John Schember <john@nachtimwald.com>'
|
__copyright__ = '2011, John Schember <john@nachtimwald.com>'
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
from __future__ import (unicode_literals, division, absolute_import, print_function)
|
from __future__ import (unicode_literals, division, absolute_import, print_function)
|
||||||
|
store_version = 1 # Needed for dynamic plugin loading
|
||||||
|
|
||||||
__license__ = 'GPL 3'
|
__license__ = 'GPL 3'
|
||||||
__copyright__ = '2011-2012, Tomasz Długosz <tomek3d@gmail.com>'
|
__copyright__ = '2011-2012, Tomasz Długosz <tomek3d@gmail.com>'
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
from __future__ import (unicode_literals, division, absolute_import, print_function)
|
from __future__ import (unicode_literals, division, absolute_import, print_function)
|
||||||
|
store_version = 1 # Needed for dynamic plugin loading
|
||||||
|
|
||||||
__license__ = 'GPL 3'
|
__license__ = 'GPL 3'
|
||||||
__copyright__ = '2012, John Schember <john@nachtimwald.com>'
|
__copyright__ = '2012, John Schember <john@nachtimwald.com>'
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
from __future__ import (unicode_literals, division, absolute_import, print_function)
|
from __future__ import (unicode_literals, division, absolute_import, print_function)
|
||||||
|
store_version = 1 # Needed for dynamic plugin loading
|
||||||
|
|
||||||
__license__ = 'GPL 3'
|
__license__ = 'GPL 3'
|
||||||
__copyright__ = '2011, John Schember <john@nachtimwald.com>'
|
__copyright__ = '2011, John Schember <john@nachtimwald.com>'
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
from __future__ import (unicode_literals, division, absolute_import, print_function)
|
from __future__ import (unicode_literals, division, absolute_import, print_function)
|
||||||
|
store_version = 1 # Needed for dynamic plugin loading
|
||||||
|
|
||||||
__license__ = 'GPL 3'
|
__license__ = 'GPL 3'
|
||||||
__copyright__ = '2011, Roman Mukhin <ramses_ru at hotmail.com>'
|
__copyright__ = '2011, Roman Mukhin <ramses_ru at hotmail.com>'
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
from __future__ import (unicode_literals, division, absolute_import, print_function)
|
from __future__ import (unicode_literals, division, absolute_import, print_function)
|
||||||
|
store_version = 1 # Needed for dynamic plugin loading
|
||||||
|
|
||||||
__license__ = 'GPL 3'
|
__license__ = 'GPL 3'
|
||||||
__copyright__ = '2011, John Schember <john@nachtimwald.com>'
|
__copyright__ = '2011, John Schember <john@nachtimwald.com>'
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
from __future__ import (unicode_literals, division, absolute_import, print_function)
|
from __future__ import (unicode_literals, division, absolute_import, print_function)
|
||||||
|
store_version = 1 # Needed for dynamic plugin loading
|
||||||
|
|
||||||
__license__ = 'GPL 3'
|
__license__ = 'GPL 3'
|
||||||
__copyright__ = '2012, Tomasz Długosz <tomek3d@gmail.com>'
|
__copyright__ = '2012, Tomasz Długosz <tomek3d@gmail.com>'
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
from __future__ import (unicode_literals, division, absolute_import, print_function)
|
from __future__ import (unicode_literals, division, absolute_import, print_function)
|
||||||
|
store_version = 1 # Needed for dynamic plugin loading
|
||||||
|
|
||||||
__license__ = 'GPL 3'
|
__license__ = 'GPL 3'
|
||||||
__copyright__ = '2011, Tomasz Długosz <tomek3d@gmail.com>'
|
__copyright__ = '2011, Tomasz Długosz <tomek3d@gmail.com>'
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
from __future__ import (unicode_literals, division, absolute_import, print_function)
|
from __future__ import (unicode_literals, division, absolute_import, print_function)
|
||||||
|
store_version = 1 # Needed for dynamic plugin loading
|
||||||
|
|
||||||
__license__ = 'GPL 3'
|
__license__ = 'GPL 3'
|
||||||
__copyright__ = '2011, John Schember <john@nachtimwald.com>'
|
__copyright__ = '2011, John Schember <john@nachtimwald.com>'
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:fdm=marker:ai
|
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:fdm=marker:ai
|
||||||
from __future__ import (unicode_literals, division, absolute_import,
|
from __future__ import (unicode_literals, division, absolute_import,
|
||||||
print_function)
|
print_function)
|
||||||
|
store_version = 1 # Needed for dynamic plugin loading
|
||||||
|
|
||||||
__license__ = 'GPL v3'
|
__license__ = 'GPL v3'
|
||||||
__copyright__ = '2012, Kovid Goyal <kovid at kovidgoyal.net>'
|
__copyright__ = '2012, Kovid Goyal <kovid at kovidgoyal.net>'
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
from __future__ import (unicode_literals, division, absolute_import, print_function)
|
from __future__ import (unicode_literals, division, absolute_import, print_function)
|
||||||
|
store_version = 1 # Needed for dynamic plugin loading
|
||||||
|
|
||||||
__license__ = 'GPL 3'
|
__license__ = 'GPL 3'
|
||||||
__copyright__ = '2011, Tomasz Długosz <tomek3d@gmail.com>'
|
__copyright__ = '2011, Tomasz Długosz <tomek3d@gmail.com>'
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
from __future__ import (unicode_literals, division, absolute_import, print_function)
|
from __future__ import (unicode_literals, division, absolute_import, print_function)
|
||||||
|
store_version = 1 # Needed for dynamic plugin loading
|
||||||
|
|
||||||
__license__ = 'GPL 3'
|
__license__ = 'GPL 3'
|
||||||
__copyright__ = '2011, John Schember <john@nachtimwald.com>'
|
__copyright__ = '2011, John Schember <john@nachtimwald.com>'
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
from __future__ import (unicode_literals, division, absolute_import, print_function)
|
from __future__ import (unicode_literals, division, absolute_import, print_function)
|
||||||
|
store_version = 1 # Needed for dynamic plugin loading
|
||||||
|
|
||||||
__license__ = 'GPL 3'
|
__license__ = 'GPL 3'
|
||||||
__copyright__ = '2011, John Schember <john@nachtimwald.com>'
|
__copyright__ = '2011, John Schember <john@nachtimwald.com>'
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
from __future__ import (unicode_literals, division, absolute_import, print_function)
|
from __future__ import (unicode_literals, division, absolute_import, print_function)
|
||||||
|
store_version = 1 # Needed for dynamic plugin loading
|
||||||
|
|
||||||
__license__ = 'GPL 3'
|
__license__ = 'GPL 3'
|
||||||
__copyright__ = '2011, John Schember <john@nachtimwald.com>'
|
__copyright__ = '2011, John Schember <john@nachtimwald.com>'
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
from __future__ import (unicode_literals, division, absolute_import, print_function)
|
from __future__ import (unicode_literals, division, absolute_import, print_function)
|
||||||
|
store_version = 1 # Needed for dynamic plugin loading
|
||||||
|
|
||||||
__license__ = 'GPL 3'
|
__license__ = 'GPL 3'
|
||||||
__copyright__ = '2011-2012, Tomasz Długosz <tomek3d@gmail.com>'
|
__copyright__ = '2011-2012, Tomasz Długosz <tomek3d@gmail.com>'
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
from __future__ import (unicode_literals, division, absolute_import, print_function)
|
from __future__ import (unicode_literals, division, absolute_import, print_function)
|
||||||
|
store_version = 1 # Needed for dynamic plugin loading
|
||||||
|
|
||||||
__license__ = 'GPL 3'
|
__license__ = 'GPL 3'
|
||||||
__copyright__ = '2011, John Schember <john@nachtimwald.com>'
|
__copyright__ = '2011, John Schember <john@nachtimwald.com>'
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
from __future__ import (unicode_literals, division, absolute_import, print_function)
|
from __future__ import (unicode_literals, division, absolute_import, print_function)
|
||||||
|
store_version = 1 # Needed for dynamic plugin loading
|
||||||
|
|
||||||
__license__ = 'GPL 3'
|
__license__ = 'GPL 3'
|
||||||
__copyright__ = '2011, Tomasz Długosz <tomek3d@gmail.com>'
|
__copyright__ = '2011, Tomasz Długosz <tomek3d@gmail.com>'
|
||||||
|
@ -155,7 +155,8 @@ class Main(MainWindow, MainWindowMixin, DeviceMixin, EmailMixin, # {{{
|
|||||||
acmap[ac.name] = ac
|
acmap[ac.name] = ac
|
||||||
|
|
||||||
def load_store_plugins(self):
|
def load_store_plugins(self):
|
||||||
self.istores = OrderedDict()
|
from calibre.gui2.store.loader import Stores
|
||||||
|
self.istores = Stores()
|
||||||
for store in available_store_plugins():
|
for store in available_store_plugins():
|
||||||
if self.opts.ignore_plugins and store.plugin_path is not None:
|
if self.opts.ignore_plugins and store.plugin_path is not None:
|
||||||
continue
|
continue
|
||||||
@ -169,6 +170,7 @@ class Main(MainWindow, MainWindowMixin, DeviceMixin, EmailMixin, # {{{
|
|||||||
if store.plugin_path is None:
|
if store.plugin_path is None:
|
||||||
raise
|
raise
|
||||||
continue
|
continue
|
||||||
|
self.istores.builtins_loaded()
|
||||||
|
|
||||||
def init_istore(self, store):
|
def init_istore(self, store):
|
||||||
st = store.load_actual_plugin(self)
|
st = store.load_actual_plugin(self)
|
||||||
@ -790,6 +792,7 @@ class Main(MainWindow, MainWindowMixin, DeviceMixin, EmailMixin, # {{{
|
|||||||
except KeyboardInterrupt:
|
except KeyboardInterrupt:
|
||||||
pass
|
pass
|
||||||
time.sleep(2)
|
time.sleep(2)
|
||||||
|
self.istores.join()
|
||||||
self.hide_windows()
|
self.hide_windows()
|
||||||
# Do not report any errors that happen after the shutdown
|
# Do not report any errors that happen after the shutdown
|
||||||
sys.excepthook = sys.__excepthook__
|
sys.excepthook = sys.__excepthook__
|
||||||
|
@ -245,6 +245,13 @@ class PocketBook900(PocketBook):
|
|||||||
id = 'pocketbook900'
|
id = 'pocketbook900'
|
||||||
output_profile = 'pocketbook_900'
|
output_profile = 'pocketbook_900'
|
||||||
|
|
||||||
|
class PocketBookPro912(PocketBook):
|
||||||
|
|
||||||
|
name = 'PocketBook Pro 912'
|
||||||
|
id = 'pocketbookpro912'
|
||||||
|
output_profile = 'pocketbook_pro_912'
|
||||||
|
|
||||||
|
|
||||||
class iPhone(Device):
|
class iPhone(Device):
|
||||||
|
|
||||||
name = 'iPhone/iTouch'
|
name = 'iPhone/iTouch'
|
||||||
|
Loading…
x
Reference in New Issue
Block a user