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
|
||||
import re
|
||||
|
||||
class HBR(BasicNewsRecipe):
|
||||
|
||||
@ -20,6 +21,14 @@ class HBR(BasicNewsRecipe):
|
||||
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):
|
||||
br = BasicNewsRecipe.get_browser(self)
|
||||
@ -86,4 +95,15 @@ class HBR(BasicNewsRecipe):
|
||||
feeds.extend(self.get_departments(soup))
|
||||
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
|
||||
# Inparticular it causes tostring to insert xmlns
|
||||
# In particular, it causes tostring to insert xmlns
|
||||
# declarations, which messes up the coercing logic
|
||||
idx = data.find('<html')
|
||||
if idx > -1:
|
||||
|
@ -47,7 +47,10 @@ class TagsView(QTreeView):
|
||||
ci = self.currentIndex()
|
||||
if not ci.isValid():
|
||||
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():
|
||||
self.scrollTo(ci, QTreeView.PositionAtTop)
|
||||
|
||||
|
@ -115,7 +115,7 @@ class PostInstall:
|
||||
self.info('Creating symlinks...')
|
||||
for exe in scripts.keys():
|
||||
dest = os.path.join(self.opts.staging_bindir, exe)
|
||||
if os.path.exists(dest):
|
||||
if os.path.lexists(dest):
|
||||
os.unlink(dest)
|
||||
tgt = os.path.join(getattr(sys, 'frozen_path'), exe)
|
||||
self.info('\tSymlinking %s to %s'%(tgt, dest))
|
||||
|
Loading…
x
Reference in New Issue
Block a user