IGN:Put recipes into their own namespace

This commit is contained in:
Kovid Goyal 2008-12-31 10:35:50 -08:00
parent e3b148e84a
commit 16ac51a652
85 changed files with 5 additions and 4 deletions

View File

@ -155,10 +155,11 @@ class RecipeModel(QAbstractListModel, SearchQueryParser):
return recipe return recipe
elif role == Qt.DecorationRole: elif role == Qt.DecorationRole:
icon = self.default_icon icon = self.default_icon
icon_path = (':/images/news/%s.png'%recipe.id).replace('recipe_', '')
if not recipe.builtin: if not recipe.builtin:
icon = self.custom_icon icon = self.custom_icon
elif QFile(':/images/news/%s.png'%recipe.id).exists(): elif QFile().exists(icon_path):
icon = QIcon(':/images/news/%s.png'%recipe.id) icon = QIcon(icon_path)
return QVariant(icon) return QVariant(icon)
return NONE return NONE

View File

@ -4,7 +4,7 @@ __copyright__ = '2008, Kovid Goyal <kovid at kovidgoyal.net>'
''' '''
Builtin recipes. Builtin recipes.
''' '''
recipe_modules = [ recipe_modules = ['recipe_' + r for r in (
'newsweek', 'atlantic', 'economist', 'portfolio', 'newsweek', 'atlantic', 'economist', 'portfolio',
'nytimes', 'usatoday', 'outlook_india', 'bbc', 'greader', 'wsj', 'nytimes', 'usatoday', 'outlook_india', 'bbc', 'greader', 'wsj',
'wired', 'globe_and_mail', 'smh', 'espn', 'business_week', 'wired', 'globe_and_mail', 'smh', 'espn', 'business_week',
@ -21,7 +21,7 @@ recipe_modules = [
'linux_magazine', 'telegraph_uk', 'utne', 'sciencedaily', 'forbes', 'linux_magazine', 'telegraph_uk', 'utne', 'sciencedaily', 'forbes',
'time_magazine', 'endgadget', 'fudzilla', 'nspm_int', 'nspm', 'pescanik', 'time_magazine', 'endgadget', 'fudzilla', 'nspm_int', 'nspm', 'pescanik',
'spiegel_int', 'themarketticker', 'tomshardware', 'spiegel_int', 'themarketticker', 'tomshardware',
] )]
import re, imp, inspect, time, os import re, imp, inspect, time, os
from calibre.web.feeds.news import BasicNewsRecipe, CustomIndexRecipe, AutomaticNewsRecipe from calibre.web.feeds.news import BasicNewsRecipe, CustomIndexRecipe, AutomaticNewsRecipe