This commit is contained in:
Kovid Goyal 2008-05-16 07:03:28 -07:00
parent b0a88174d9
commit ff0f3515b4
5 changed files with 2070 additions and 41 deletions

View File

@ -1,6 +1,9 @@
PYTHON = python
all : gui2 translations resources pictureflow
all : plugins gui2 translations resources pictureflow
plugins:
mkdir -p src/calibre/plugins
clean :
cd src/calibre/gui2 && ${PYTHON} make.py clean

View File

@ -1,37 +0,0 @@
__license__ = 'GPL v3'
__copyright__ = '2008, Kovid Goyal <kovid at kovidgoyal.net>'
'''
Fetch Dilbert.
'''
import os
from calibre.ebooks.lrf.web.profiles import DefaultProfile
class Dilbert(DefaultProfile):
title = 'Dilbert'
timefmt = ' [%d %b %Y]'
max_recursions = 2
max_articles_per_feed = 6
html_description = True
no_stylesheets = True
def get_feeds(self):
return [ ('Dilbert', 'http://feeds.feedburner.com/tapestrydilbert') ]
def get_article_url(self, item):
return item.find('enclosure')['url']
def build_index(self):
index = os.path.join(self.temp_dir, 'index.html')
articles = list(self.parse_feeds(require_url=False).values())[0]
res = ''
for item in articles:
res += '<h3>%s</h3><img style="page-break-after:always" src="%s" />\n'%(item['title'], item['url'])
res = '<html><body><h1>Dilbert</h1>%s</body></html'%res
open(index, 'wb').write(res)
return index

File diff suppressed because it is too large Load Diff

After

Width:  |  Height:  |  Size: 35 KiB

File diff suppressed because it is too large Load Diff

After

Width:  |  Height:  |  Size: 35 KiB

View File

@ -7,8 +7,15 @@ Manage translation of user visible strings.
import sys, os, cStringIO, tempfile, subprocess, functools, tarfile, re
check_call = functools.partial(subprocess.check_call, shell=True)
from calibre.translations.pygettext import main as pygettext
from calibre.translations.msgfmt import main as msgfmt
try:
from calibre.translations.pygettext import main as pygettext
from calibre.translations.msgfmt import main as msgfmt
except ImportError:
sys.path.insert(1, os.path.abspath('..'))
from calibre.translations.pygettext import main as pygettext
from calibre.translations.msgfmt import main as msgfmt
TRANSLATIONS = [
'sl',