|
|
|
@ -2,13 +2,17 @@ __license__ = 'GPL 3'
|
|
|
|
|
__copyright__ = '2012, Ruben Pollan <meskio@sindominio.net>'
|
|
|
|
|
__docformat__ = 'restructuredtext en'
|
|
|
|
|
|
|
|
|
|
import urllib2
|
|
|
|
|
from contextlib import closing
|
|
|
|
|
try:
|
|
|
|
|
from urllib.parse import quote
|
|
|
|
|
except:
|
|
|
|
|
from urllib2 import quote
|
|
|
|
|
try:
|
|
|
|
|
from PyQt5.Qt import QUrl
|
|
|
|
|
except:
|
|
|
|
|
from PyQt4.Qt import QUrl
|
|
|
|
|
|
|
|
|
|
from contextlib import closing
|
|
|
|
|
import json
|
|
|
|
|
|
|
|
|
|
from PyQt4.Qt import QUrl
|
|
|
|
|
|
|
|
|
|
from calibre import browser
|
|
|
|
|
from calibre.gui2 import open_url
|
|
|
|
|
from calibre.gui2.store import StorePlugin
|
|
|
|
@ -30,7 +34,7 @@ class TheAnarchistLibraryStore(BasicStoreConfig, StorePlugin):
|
|
|
|
|
d.exec_()
|
|
|
|
|
|
|
|
|
|
def search(self, query, max_results=10, timeout=60):
|
|
|
|
|
url = 'http://theanarchistlibrary.org/search?fmt=json&query=' + urllib2.quote(query)
|
|
|
|
|
url = 'http://theanarchistlibrary.org/search?fmt=json&query=' + quote(query)
|
|
|
|
|
|
|
|
|
|
br = browser()
|
|
|
|
|
|
|
|
|
|