mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
IGN:...
This commit is contained in:
parent
e46c38b611
commit
35ef790a0d
@ -1,4 +1,5 @@
|
|||||||
from calibre.web.feeds.news import BasicNewsRecipe
|
from calibre.web.feeds.news import BasicNewsRecipe
|
||||||
|
import re
|
||||||
|
|
||||||
class HBR(BasicNewsRecipe):
|
class HBR(BasicNewsRecipe):
|
||||||
|
|
||||||
@ -7,8 +8,8 @@ class HBR(BasicNewsRecipe):
|
|||||||
needs_subscription = True
|
needs_subscription = True
|
||||||
__author__ = 'Kovid Goyal'
|
__author__ = 'Kovid Goyal'
|
||||||
timefmt = ' [%B %Y]'
|
timefmt = ' [%B %Y]'
|
||||||
no_stylesheets = True
|
no_stylesheets = True
|
||||||
|
|
||||||
LOGIN_URL = 'http://hbr.harvardbusiness.org/login?request_url=/'
|
LOGIN_URL = 'http://hbr.harvardbusiness.org/login?request_url=/'
|
||||||
INDEX = 'http://hbr.harvardbusiness.org/current'
|
INDEX = 'http://hbr.harvardbusiness.org/current'
|
||||||
|
|
||||||
@ -19,7 +20,15 @@ class HBR(BasicNewsRecipe):
|
|||||||
'contentRight', 'summaryLink']),
|
'contentRight', 'summaryLink']),
|
||||||
dict(name='form'),
|
dict(name='form'),
|
||||||
]
|
]
|
||||||
|
|
||||||
|
extra_css = '''
|
||||||
|
a {font-family:Georgia,"Times New Roman",Times,serif; font-style:italic; color:#000000; }
|
||||||
|
.article{font-family:Georgia,"Times New Roman",Times,serif; font-size: xx-small;}
|
||||||
|
h2{font-family:Georgia,"Times New Roman",Times,serif; font-weight:bold; font-size:large; }
|
||||||
|
h4{font-family:Georgia,"Times New Roman",Times,serif; font-weight:bold; font-size:small; }
|
||||||
|
#articleAuthors{font-family:Georgia,"Times New Roman",Times,serif; font-style:italic; color:#000000;font-size:x-small;}
|
||||||
|
#summaryText{font-family:Georgia,"Times New Roman",Times,serif; font-weight:bold; font-size:x-small;}
|
||||||
|
'''
|
||||||
|
|
||||||
def get_browser(self):
|
def get_browser(self):
|
||||||
br = BasicNewsRecipe.get_browser(self)
|
br = BasicNewsRecipe.get_browser(self)
|
||||||
@ -86,4 +95,15 @@ class HBR(BasicNewsRecipe):
|
|||||||
feeds.extend(self.get_departments(soup))
|
feeds.extend(self.get_departments(soup))
|
||||||
return feeds
|
return feeds
|
||||||
|
|
||||||
|
def get_cover_url(self):
|
||||||
|
cover_url = None
|
||||||
|
index = 'http://hbr.harvardbusiness.org/current'
|
||||||
|
soup = self.index_to_soup(index)
|
||||||
|
link_item = soup.find('img', alt=re.compile("HBR Cover Image"), src=True)
|
||||||
|
|
||||||
|
if link_item:
|
||||||
|
cover_url = 'http://hbr.harvardbusiness.org' + link_item['src']
|
||||||
|
|
||||||
|
return cover_url
|
||||||
|
|
||||||
|
|
||||||
|
@ -777,7 +777,7 @@ class Manifest(object):
|
|||||||
|
|
||||||
|
|
||||||
# Remove DOCTYPE declaration as it messes up parsing
|
# Remove DOCTYPE declaration as it messes up parsing
|
||||||
# Inparticular it causes tostring to insert xmlns
|
# In particular, it causes tostring to insert xmlns
|
||||||
# declarations, which messes up the coercing logic
|
# declarations, which messes up the coercing logic
|
||||||
idx = data.find('<html')
|
idx = data.find('<html')
|
||||||
if idx > -1:
|
if idx > -1:
|
||||||
|
@ -47,7 +47,10 @@ class TagsView(QTreeView):
|
|||||||
ci = self.currentIndex()
|
ci = self.currentIndex()
|
||||||
if not ci.isValid():
|
if not ci.isValid():
|
||||||
ci = self.indexAt(QPoint(10, 10))
|
ci = self.indexAt(QPoint(10, 10))
|
||||||
self.model().refresh()
|
try:
|
||||||
|
self.model().refresh()
|
||||||
|
except: #Database connection could be closed if an integrity check is happening
|
||||||
|
pass
|
||||||
if ci.isValid():
|
if ci.isValid():
|
||||||
self.scrollTo(ci, QTreeView.PositionAtTop)
|
self.scrollTo(ci, QTreeView.PositionAtTop)
|
||||||
|
|
||||||
|
@ -115,7 +115,7 @@ class PostInstall:
|
|||||||
self.info('Creating symlinks...')
|
self.info('Creating symlinks...')
|
||||||
for exe in scripts.keys():
|
for exe in scripts.keys():
|
||||||
dest = os.path.join(self.opts.staging_bindir, exe)
|
dest = os.path.join(self.opts.staging_bindir, exe)
|
||||||
if os.path.exists(dest):
|
if os.path.lexists(dest):
|
||||||
os.unlink(dest)
|
os.unlink(dest)
|
||||||
tgt = os.path.join(getattr(sys, 'frozen_path'), exe)
|
tgt = os.path.join(getattr(sys, 'frozen_path'), exe)
|
||||||
self.info('\tSymlinking %s to %s'%(tgt, dest))
|
self.info('\tSymlinking %s to %s'%(tgt, dest))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user