mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Den of Geek by Jaded. Also, allow user-defined functions to be directly used in save-to-disk templates
This commit is contained in:
commit
6493945453
21
recipes/den_of_geek.recipe
Normal file
21
recipes/den_of_geek.recipe
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
from calibre.web.feeds.news import BasicNewsRecipe
|
||||||
|
|
||||||
|
class AdvancedUserRecipe1316944753(BasicNewsRecipe):
|
||||||
|
title = u'Den of Geek'
|
||||||
|
__author__ = 'Jaded'
|
||||||
|
language = 'en'
|
||||||
|
description = 'From science fiction enthusiasts through to gaming fanatics, Den of Geek has become the one-stop UK website for people genuinely passionate about their entertainment media. Den of Geek covers popular culture but always with an edgy, UK centric slant that sets it apart from the crowd.'
|
||||||
|
category = 'Movies, TV, Games, Comics, Cult, News, Reviews'
|
||||||
|
language = 'en'
|
||||||
|
|
||||||
|
oldest_article = 7
|
||||||
|
max_articles_per_feed = 100
|
||||||
|
auto_cleanup = True
|
||||||
|
|
||||||
|
no_stylesheets = True
|
||||||
|
use_embedded_content = True
|
||||||
|
publication_type = 'newsportal'
|
||||||
|
masthead_url ='http://www.denofgeek.com/siteimage/scale/0/0/logo.gif'
|
||||||
|
cover_url ='http://a5.sphotos.ak.fbcdn.net/hphotos-ak-snc6/166479_180131695357862_139191826118516_354818_4993703_n.jpg'
|
||||||
|
|
||||||
|
feeds = [(u'Movies', u'http://www.denofgeek.com/movies/rss/'), (u'TV', u'http://www.denofgeek.com/television/rss/'), (u'Comics & Books', u'http://www.denofgeek.com/comics/rss/'), (u'Games', u'http://www.denofgeek.com/games/rss/'), (u'DVD/Blu-ray', u'http://www.denofgeek.com/Reviews/rss/')]
|
BIN
recipes/icons/den_of_geek.png
Normal file
BIN
recipes/icons/den_of_geek.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.0 KiB |
@ -249,6 +249,7 @@ class SaveWorker(Thread):
|
|||||||
recs[pref.name] = getattr(self.opts, pref.name)
|
recs[pref.name] = getattr(self.opts, pref.name)
|
||||||
|
|
||||||
plugboards = self.db.prefs.get('plugboards', {})
|
plugboards = self.db.prefs.get('plugboards', {})
|
||||||
|
template_functions = self.db.prefs.get('user_template_functions', [])
|
||||||
|
|
||||||
for i, task in enumerate(tasks):
|
for i, task in enumerate(tasks):
|
||||||
tids = [x[-1] for x in task]
|
tids = [x[-1] for x in task]
|
||||||
@ -260,7 +261,7 @@ class SaveWorker(Thread):
|
|||||||
job = ParallelJob('save_book',
|
job = ParallelJob('save_book',
|
||||||
'Save books (%d of %d)'%(i, len(tasks)),
|
'Save books (%d of %d)'%(i, len(tasks)),
|
||||||
lambda x,y:x,
|
lambda x,y:x,
|
||||||
args=[tids, dpath, plugboards, self.path, recs])
|
args=[tids, dpath, plugboards, template_functions, self.path, recs])
|
||||||
jobs.add(job)
|
jobs.add(job)
|
||||||
server.add_job(job)
|
server.add_job(job)
|
||||||
|
|
||||||
@ -312,9 +313,12 @@ class SaveWorker(Thread):
|
|||||||
break
|
break
|
||||||
|
|
||||||
|
|
||||||
def save_book(ids, dpath, plugboards, path, recs, notification=lambda x,y:x):
|
def save_book(ids, dpath, plugboards, template_functions, path, recs,
|
||||||
|
notification=lambda x,y:x):
|
||||||
from calibre.library.save_to_disk import config, save_serialized_to_disk
|
from calibre.library.save_to_disk import config, save_serialized_to_disk
|
||||||
from calibre.customize.ui import apply_null_metadata
|
from calibre.customize.ui import apply_null_metadata
|
||||||
|
from calibre.utils.formatter_functions import load_user_template_functions
|
||||||
|
load_user_template_functions(template_functions)
|
||||||
opts = config().parse()
|
opts = config().parse()
|
||||||
for name in recs:
|
for name in recs:
|
||||||
setattr(opts, name, recs[name])
|
setattr(opts, name, recs[name])
|
||||||
|
Loading…
x
Reference in New Issue
Block a user