Sync to trunk

This commit is contained in:
John Schember 2009-01-20 18:26:41 -05:00
commit d3d4e2e771
43 changed files with 432 additions and 167 deletions

File diff suppressed because one or more lines are too long

View File

@ -177,9 +177,9 @@ class Device(_Device):
wmi = __import__('wmi', globals(), locals(), [], -1) wmi = __import__('wmi', globals(), locals(), [], -1)
c = wmi.WMI() c = wmi.WMI()
for drive in c.Win32_DiskDrive(): for drive in c.Win32_DiskDrive():
if self.windows_match_device(str(drive.PNPDeviceID), WINDOWS_MAIN_MEM): if self.windows_match_device(str(drive.PNPDeviceID), self.WINDOWS_MAIN_MEM):
drives['main'] = self.windows_get_drive_prefix(drive) drives['main'] = self.windows_get_drive_prefix(drive)
elif self.windows_match_device(str(drive.PNPDeviceID), WINDOWS_CARD_MEM): elif self.windows_match_device(str(drive.PNPDeviceID), self.WINDOWS_CARD_MEM):
drives['card'] = self.windows_get_drive_prefix(drive) drives['card'] = self.windows_get_drive_prefix(drive)
if 'main' and 'card' in drives.keys(): if 'main' and 'card' in drives.keys():

View File

@ -18,12 +18,14 @@ class DefaultProfile(object):
flow_size = sys.maxint flow_size = sys.maxint
screen_size = None screen_size = None
remove_special_chars = False remove_special_chars = False
remove_object_tags = False
class PRS505(DefaultProfile): class PRS505(DefaultProfile):
flow_size = 270000 flow_size = 270000
screen_size = (590, 765) screen_size = (590, 765)
remove_special_chars = re.compile(u'[\u200b\u00ad]') remove_special_chars = re.compile(u'[\u200b\u00ad]')
remove_object_tags = True
PROFILES = { PROFILES = {
@ -156,7 +158,7 @@ to auto-generate a Table of Contents.
help=_('Set the right margin in pts. Default is %default')) help=_('Set the right margin in pts. Default is %default'))
layout('base_font_size2', ['--base-font-size'], default=12.0, layout('base_font_size2', ['--base-font-size'], default=12.0,
help=_('The base font size in pts. Default is %defaultpt. Set to 0 to disable rescaling of fonts.')) help=_('The base font size in pts. Default is %defaultpt. Set to 0 to disable rescaling of fonts.'))
layout('remove_paragraph_spacing', ['--remove-paragraph-spacing'], default=True, layout('remove_paragraph_spacing', ['--remove-paragraph-spacing'], default=False,
help=_('Remove spacing between paragraphs. Will not work if the source file forces inter-paragraph spacing.')) help=_('Remove spacing between paragraphs. Will not work if the source file forces inter-paragraph spacing.'))
layout('preserve_tag_structure', ['--preserve-tag-structure'], default=False, layout('preserve_tag_structure', ['--preserve-tag-structure'], default=False,
help=_('Preserve the HTML tag structure while splitting large HTML files. This is only neccessary if the HTML files contain CSS that uses sibling selectors. Enabling this greatly slows down processing of large HTML files.')) help=_('Preserve the HTML tag structure while splitting large HTML files. This is only neccessary if the HTML files contain CSS that uses sibling selectors. Enabling this greatly slows down processing of large HTML files.'))

View File

@ -52,6 +52,7 @@ def convert(opts, recipe_arg, notification=None):
print 'Generating epub...' print 'Generating epub...'
opts.encoding = 'utf-8' opts.encoding = 'utf-8'
opts.remove_paragraph_spacing = True
html2epub(opf, opts, notification=notification) html2epub(opf, opts, notification=notification)

View File

@ -159,6 +159,10 @@ class HTMLProcessor(Processor, Rationalizer):
br.tag = 'p' br.tag = 'p'
br.text = u'\u00a0' br.text = u'\u00a0'
if self.opts.profile.remove_object_tags:
for tag in self.root.xpath('//object|//embed'):
tag.getparent().remove(tag)
def save(self): def save(self):
for meta in list(self.root.xpath('//meta')): for meta in list(self.root.xpath('//meta')):
meta.getparent().remove(meta) meta.getparent().remove(meta)

View File

@ -95,7 +95,7 @@ class EbookIterator(object):
for match in re.compile(r'@font-face\s*{([^}]+)}').finditer(css): for match in re.compile(r'@font-face\s*{([^}]+)}').finditer(css):
block = match.group(1) block = match.group(1)
family = re.compile(r'font-family\s*:\s*([^;]+)').search(block) family = re.compile(r'font-family\s*:\s*([^;]+)').search(block)
url = re.compile(r'url\s*\((.+?)\)', re.DOTALL).search(block) url = re.compile(r'url\s*\([\'"]*(.+?)[\'"]*\)', re.DOTALL).search(block)
if url: if url:
path = url.group(1).split('/') path = url.group(1).split('/')
path = os.path.join(os.path.dirname(item.path), *path) path = os.path.join(os.path.dirname(item.path), *path)

View File

@ -848,7 +848,7 @@ class Processor(Parser):
# Workaround for anchor rendering bug in ADE # Workaround for anchor rendering bug in ADE
css += '\n\na { color: inherit; text-decoration: inherit; cursor: default; }\na[href] { color: blue; text-decoration: underline; cursor:pointer; }' css += '\n\na { color: inherit; text-decoration: inherit; cursor: default; }\na[href] { color: blue; text-decoration: underline; cursor:pointer; }'
if self.opts.remove_paragraph_spacing: if self.opts.remove_paragraph_spacing:
css += '\n\np {text-indent: 2em; margin-top:0pt; margin-bottom:0pt; padding:0pt; border:0pt;}' css += '\n\np {text-indent: 1.5em; margin-top:0pt; margin-bottom:0pt; padding:0pt; border:0pt;}'
if self.opts.override_css: if self.opts.override_css:
css += '\n\n' + self.opts.override_css css += '\n\n' + self.opts.override_css
self.override_css = self.css_parser.parseString(self.preprocess_css(css)) self.override_css = self.css_parser.parseString(self.preprocess_css(css))

View File

@ -12,7 +12,7 @@ import copy
import re import re
from lxml import etree from lxml import etree
from calibre.ebooks.oeb.base import namespace, barename from calibre.ebooks.oeb.base import namespace, barename
from calibre.ebooks.oeb.base import XHTML, XHTML_NS from calibre.ebooks.oeb.base import XHTML, XHTML_NS, OEB_DOCS
from calibre.ebooks.oeb.stylizer import Stylizer from calibre.ebooks.oeb.stylizer import Stylizer
from calibre.ebooks.oeb.transforms.flatcss import KeyMapper from calibre.ebooks.oeb.transforms.flatcss import KeyMapper
@ -96,7 +96,10 @@ class MobiMLizer(object):
href = oeb.guide['cover'].href href = oeb.guide['cover'].href
del oeb.guide['cover'] del oeb.guide['cover']
item = oeb.manifest.hrefs[href] item = oeb.manifest.hrefs[href]
oeb.manifest.remove(item) if item.spine_position is not None:
oeb.spine.remove(item)
if item.media_type in OEB_DOCS:
self.oeb.manifest.remove(item)
def mobimlize_spine(self): def mobimlize_spine(self):
for item in self.oeb.spine: for item in self.oeb.spine:
@ -137,7 +140,7 @@ class MobiMLizer(object):
para = bstate.para para = bstate.para
if tag in SPECIAL_TAGS and not text: if tag in SPECIAL_TAGS and not text:
para = para if para is not None else bstate.body para = para if para is not None else bstate.body
elif para is None: elif para is None or tag in ('td', 'th'):
body = bstate.body body = bstate.body
if bstate.pbreak: if bstate.pbreak:
etree.SubElement(body, MBP('pagebreak')) etree.SubElement(body, MBP('pagebreak'))
@ -157,7 +160,8 @@ class MobiMLizer(object):
elif indent != 0 and abs(indent) < self.profile.fbase: elif indent != 0 and abs(indent) < self.profile.fbase:
indent = (indent / abs(indent)) * self.profile.fbase indent = (indent / abs(indent)) * self.profile.fbase
if tag in NESTABLE_TAGS: if tag in NESTABLE_TAGS:
para = wrapper = etree.SubElement(parent, XHTML(tag)) para = wrapper = etree.SubElement(
parent, XHTML(tag), attrib=istate.attrib)
bstate.nested.append(para) bstate.nested.append(para)
if tag == 'li' and len(istates) > 1: if tag == 'li' and len(istates) > 1:
istates[-2].list_num += 1 istates[-2].list_num += 1
@ -337,6 +341,10 @@ class MobiMLizer(object):
tag = 'tr' tag = 'tr'
elif display == 'table-cell': elif display == 'table-cell':
tag = 'td' tag = 'td'
if tag in TABLE_TAGS:
for attr in ('rowspan', 'colspan'):
if attr in elem.attrib:
istate.attrib[attr] = elem.attrib[attr]
text = None text = None
if elem.text: if elem.text:
if istate.preserve: if istate.preserve:
@ -374,6 +382,6 @@ class MobiMLizer(object):
bstate.vpadding += bstate.vmargin bstate.vpadding += bstate.vmargin
bstate.vmargin = 0 bstate.vmargin = 0
bstate.vpadding += vpadding bstate.vpadding += vpadding
if tag in NESTABLE_TAGS and bstate.nested: if bstate.nested and bstate.nested[-1].tag == elem.tag:
bstate.nested.pop() bstate.nested.pop()
istates.pop() istates.pop()

View File

@ -124,6 +124,7 @@ class BookHeader(object):
sublangid = (langcode >> 10) & 0xFF sublangid = (langcode >> 10) & 0xFF
self.language = main_language.get(langid, 'ENGLISH') self.language = main_language.get(langid, 'ENGLISH')
self.sublanguage = sub_language.get(sublangid, 'NEUTRAL') self.sublanguage = sub_language.get(sublangid, 'NEUTRAL')
self.first_image_index = struct.unpack('>L', raw[0x6c:0x6c+4])[0]
self.exth_flag, = struct.unpack('>L', raw[0x80:0x84]) self.exth_flag, = struct.unpack('>L', raw[0x80:0x84])
self.exth = None self.exth = None
@ -441,17 +442,18 @@ class MobiReader(object):
os.makedirs(output_dir) os.makedirs(output_dir)
image_index = 0 image_index = 0
self.image_names = [] self.image_names = []
for i in range(self.num_sections): for i in range(self.book_header.first_image_index, self.num_sections):
if i in processed_records: if i in processed_records:
continue continue
processed_records.append(i) processed_records.append(i)
data = self.sections[i][0] data = self.sections[i][0]
buf = cStringIO.StringIO(data) buf = cStringIO.StringIO(data)
image_index += 1
try: try:
im = PILImage.open(buf) im = PILImage.open(buf)
except IOError: except IOError, e:
continue continue
image_index += 1
path = os.path.join(output_dir, '%05d.jpg'%image_index) path = os.path.join(output_dir, '%05d.jpg'%image_index)
self.image_names.append(os.path.basename(path)) self.image_names.append(os.path.basename(path))
im.convert('RGB').save(open(path, 'wb'), format='JPEG') im.convert('RGB').save(open(path, 'wb'), format='JPEG')
@ -476,6 +478,7 @@ def get_metadata(stream):
else: else:
tdir = tempfile.mkdtemp('_mobi_meta', __appname__+'_') tdir = tempfile.mkdtemp('_mobi_meta', __appname__+'_')
atexit.register(shutil.rmtree, tdir) atexit.register(shutil.rmtree, tdir)
#print tdir
mr.extract_images([], tdir) mr.extract_images([], tdir)
mi = mr.create_opf('dummy.html') mi = mr.create_opf('dummy.html')
if mi.cover: if mi.cover:
@ -491,7 +494,6 @@ def get_metadata(stream):
if os.access(candidate, os.R_OK): if os.access(candidate, os.R_OK):
cover = candidate cover = candidate
break break
if os.access(cover, os.R_OK): if os.access(cover, os.R_OK):
mi.cover_data = ('JPEG', open(os.path.join(tdir, cover), 'rb').read()) mi.cover_data = ('JPEG', open(os.path.join(tdir, cover), 'rb').read())
else: else:

View File

@ -95,6 +95,7 @@ class Serializer(object):
def __init__(self, oeb, images): def __init__(self, oeb, images):
self.oeb = oeb self.oeb = oeb
self.images = images self.images = images
self.logger = oeb.logger
self.id_offsets = {} self.id_offsets = {}
self.href_offsets = defaultdict(list) self.href_offsets = defaultdict(list)
self.breaks = [] self.breaks = []
@ -144,8 +145,8 @@ class Serializer(object):
item = hrefs[path] if path else None item = hrefs[path] if path else None
if item and item.spine_position is None: if item and item.spine_position is None:
return False return False
id = item.id if item else base.id path = item.href if item else base.href
href = '#'.join((id, frag)) if frag else id href = '#'.join((path, frag)) if frag else path
buffer.write('filepos=') buffer.write('filepos=')
self.href_offsets[href].append(buffer.tell()) self.href_offsets[href].append(buffer.tell())
buffer.write('0000000000') buffer.write('0000000000')
@ -170,7 +171,7 @@ class Serializer(object):
buffer = self.buffer buffer = self.buffer
if not item.linear: if not item.linear:
self.breaks.append(buffer.tell() - 1) self.breaks.append(buffer.tell() - 1)
self.id_offsets[item.id] = buffer.tell() self.id_offsets[item.href] = buffer.tell()
for elem in item.data.find(XHTML('body')): for elem in item.data.find(XHTML('body')):
self.serialize_elem(elem, item) self.serialize_elem(elem, item)
buffer.write('<mbp:pagebreak/>') buffer.write('<mbp:pagebreak/>')
@ -180,12 +181,11 @@ class Serializer(object):
if not isinstance(elem.tag, basestring) \ if not isinstance(elem.tag, basestring) \
or namespace(elem.tag) not in nsrmap: or namespace(elem.tag) not in nsrmap:
return return
hrefs = self.oeb.manifest.hrefs
tag = prefixname(elem.tag, nsrmap) tag = prefixname(elem.tag, nsrmap)
for attr in ('name', 'id'): for attr in ('name', 'id'):
if attr in elem.attrib: if attr in elem.attrib:
id = '#'.join((item.id, elem.attrib[attr])) href = '#'.join((item.href, elem.attrib[attr]))
self.id_offsets[id] = buffer.tell() self.id_offsets[href] = buffer.tell()
del elem.attrib[attr] del elem.attrib[attr]
if tag == 'a' and not elem.attrib \ if tag == 'a' and not elem.attrib \
and not len(elem) and not elem.text: and not len(elem) and not elem.text:
@ -203,7 +203,7 @@ class Serializer(object):
continue continue
elif attr == 'src': elif attr == 'src':
href = item.abshref(val) href = item.abshref(val)
if href in hrefs: if href in self.images:
index = self.images[href] index = self.images[href]
buffer.write('recindex="%05d"' % index) buffer.write('recindex="%05d"' % index)
continue continue
@ -233,8 +233,12 @@ class Serializer(object):
def fixup_links(self): def fixup_links(self):
buffer = self.buffer buffer = self.buffer
for id, hoffs in self.href_offsets.items(): id_offsets = self.id_offsets
ioff = self.id_offsets[id] for href, hoffs in self.href_offsets.items():
if href not in id_offsets:
self.logger.warn('Hyperlink target %r not found' % href)
href, _ = urldefrag(href)
ioff = self.id_offsets[href]
for hoff in hoffs: for hoff in hoffs:
buffer.seek(hoff) buffer.seek(hoff)
buffer.write('%010d' % ioff) buffer.write('%010d' % ioff)
@ -360,7 +364,11 @@ class MobiWriter(object):
if image.format not in ('JPEG', 'GIF'): if image.format not in ('JPEG', 'GIF'):
width, height = image.size width, height = image.size
area = width * height area = width * height
format = 'GIF' if area <= 40000 else 'JPEG' if area <= 40000:
format = 'GIF'
else:
image = image.convert('RGBA')
format = 'JPEG'
changed = True changed = True
if dimen is not None: if dimen is not None:
image.thumbnail(dimen, Image.ANTIALIAS) image.thumbnail(dimen, Image.ANTIALIAS)
@ -507,6 +515,9 @@ def add_mobi_options(parser):
group.add_option( group.add_option(
'-r', '--rescale-images', default=False, action='store_true', '-r', '--rescale-images', default=False, action='store_true',
help=_('Modify images to meet Palm device size limitations.')) help=_('Modify images to meet Palm device size limitations.'))
group.add_option(
'--toc-title', default=None, action='store',
help=_('Title for any generated in-line table of contents.'))
parser.add_option_group(group) parser.add_option_group(group)
group = OptionGroup(parser, _('Profiles'), _('Device renderer profiles. ' group = OptionGroup(parser, _('Profiles'), _('Device renderer profiles. '
'Affects conversion of default font sizes and rasterization ' 'Affects conversion of default font sizes and rasterization '
@ -550,7 +561,7 @@ def oeb2mobi(opts, inpath):
imagemax = PALM_MAX_IMAGE_SIZE if opts.rescale_images else None imagemax = PALM_MAX_IMAGE_SIZE if opts.rescale_images else None
context = Context(source, dest) context = Context(source, dest)
oeb = OEBBook(inpath, logger=logger) oeb = OEBBook(inpath, logger=logger)
tocadder = HTMLTOCAdder() tocadder = HTMLTOCAdder(title=opts.toc_title)
tocadder.transform(oeb, context) tocadder.transform(oeb, context)
mangler = CaseMangler() mangler = CaseMangler()
mangler.transform(oeb, context) mangler.transform(oeb, context)

View File

@ -15,11 +15,12 @@ from urlparse import urldefrag, urlparse, urlunparse
from urllib import unquote as urlunquote from urllib import unquote as urlunquote
import logging import logging
import re import re
import htmlentitydefs
import uuid import uuid
import copy import copy
from lxml import etree from lxml import etree
from lxml import html
from calibre import LoggingInterface from calibre import LoggingInterface
from calibre.translations.dynamic import translate
XML_PARSER = etree.XMLParser(recover=True) XML_PARSER = etree.XMLParser(recover=True)
XML_NS = 'http://www.w3.org/XML/1998/namespace' XML_NS = 'http://www.w3.org/XML/1998/namespace'
@ -67,14 +68,6 @@ OEB_IMAGES = set([GIF_MIME, JPEG_MIME, PNG_MIME, SVG_MIME])
MS_COVER_TYPE = 'other.ms-coverimage-standard' MS_COVER_TYPE = 'other.ms-coverimage-standard'
recode = lambda s: s.decode('iso-8859-1').encode('ascii', 'xmlcharrefreplace')
ENTITYDEFS = dict((k, recode(v)) for k, v in htmlentitydefs.entitydefs.items())
del ENTITYDEFS['lt']
del ENTITYDEFS['gt']
del ENTITYDEFS['quot']
del ENTITYDEFS['amp']
del recode
def element(parent, *args, **kwargs): def element(parent, *args, **kwargs):
if parent is not None: if parent is not None:
@ -298,7 +291,6 @@ class Metadata(object):
class Manifest(object): class Manifest(object):
class Item(object): class Item(object):
ENTITY_RE = re.compile(r'&([a-zA-Z_:][a-zA-Z0-9.-_:]+);')
NUM_RE = re.compile('^(.*)([0-9][0-9.]*)(?=[.]|$)') NUM_RE = re.compile('^(.*)([0-9][0-9.]*)(?=[.]|$)')
def __init__(self, id, href, media_type, def __init__(self, id, href, media_type,
@ -317,8 +309,11 @@ class Manifest(object):
% (self.id, self.href, self.media_type) % (self.id, self.href, self.media_type)
def _force_xhtml(self, data): def _force_xhtml(self, data):
repl = lambda m: ENTITYDEFS.get(m.group(1), m.group(0)) try:
data = self.ENTITY_RE.sub(repl, data) data = etree.fromstring(data, parser=XML_PARSER)
except etree.XMLSyntaxError:
data = html.fromstring(data, parser=XML_PARSER)
data = etree.tostring(data, encoding=unicode)
data = etree.fromstring(data, parser=XML_PARSER) data = etree.fromstring(data, parser=XML_PARSER)
if namespace(data.tag) != XHTML_NS: if namespace(data.tag) != XHTML_NS:
data.attrib['xmlns'] = XHTML_NS data.attrib['xmlns'] = XHTML_NS
@ -506,6 +501,7 @@ class Spine(object):
self.items.pop(index) self.items.pop(index)
for i in xrange(index, len(self.items)): for i in xrange(index, len(self.items)):
self.items[i].spine_position = i self.items[i].spine_position = i
item.spine_position = None
def __iter__(self): def __iter__(self):
for item in self.items: for item in self.items:
@ -680,22 +676,22 @@ class TOC(object):
node.to_opf1(tour) node.to_opf1(tour)
return tour return tour
def to_ncx(self, parent, playorder=None, depth=1): def to_ncx(self, parent, order=None, depth=1):
if not playorder: playorder = [0] if not order: order = [0]
for node in self.nodes: for node in self.nodes:
playorder[0] += 1 order[0] += 1
playOrder = str(order[0])
id = self.id or 'np' + playOrder
point = etree.SubElement(parent, point = etree.SubElement(parent,
NCX('navPoint'), attrib={'playOrder': str(playorder[0])}) NCX('navPoint'), id=id, playOrder=playOrder)
if self.klass: if self.klass:
point.attrib['class'] = node.klass point.attrib['class'] = node.klass
if self.id:
point.attrib['id'] = node.id
label = etree.SubElement(point, NCX('navLabel')) label = etree.SubElement(point, NCX('navLabel'))
etree.SubElement(label, NCX('text')).text = node.title etree.SubElement(label, NCX('text')).text = node.title
href = node.href if depth > 1 else urldefrag(node.href)[0] href = node.href if depth > 1 else urldefrag(node.href)[0]
child = etree.SubElement(point, child = etree.SubElement(point,
NCX('content'), attrib={'src': href}) NCX('content'), attrib={'src': href})
node.to_ncx(point, playorder, depth+1) node.to_ncx(point, order, depth+1)
return parent return parent
@ -802,12 +798,20 @@ class OEBBook(object):
def _manifest_from_opf(self, opf): def _manifest_from_opf(self, opf):
self.manifest = manifest = Manifest(self) self.manifest = manifest = Manifest(self)
for elem in xpath(opf, '/o2:package/o2:manifest/o2:item'): for elem in xpath(opf, '/o2:package/o2:manifest/o2:item'):
id = elem.get('id')
href = elem.get('href') href = elem.get('href')
media_type = elem.get('media-type')
fallback = elem.get('fallback')
if href in manifest.hrefs:
self.logger.warn(u'Duplicate manifest entry for %r.' % href)
continue
if not self.container.exists(href): if not self.container.exists(href):
self.logger.warn(u'Manifest item %r not found.' % href) self.logger.warn(u'Manifest item %r not found.' % href)
continue continue
manifest.add(elem.get('id'), href, elem.get('media-type'), if id in manifest.ids:
elem.get('fallback')) self.logger.warn(u'Duplicate manifest id %r.' % id)
id, href = manifest.generate(id, href)
manifest.add(id, href, media_type, fallback)
def _spine_from_opf(self, opf): def _spine_from_opf(self, opf):
self.spine = spine = Spine(self) self.spine = spine = Spine(self)
@ -970,6 +974,11 @@ class OEBBook(object):
self._toc_from_opf(opf) self._toc_from_opf(opf)
self._ensure_cover_image() self._ensure_cover_image()
def translate(self, text):
lang = str(self.metadata.language[0])
lang = lang.split('-', 1)[0].lower()
return translate(lang, text)
def to_opf1(self): def to_opf1(self):
package = etree.Element('package', package = etree.Element('package',
attrib={'unique-identifier': self.uid.id}) attrib={'unique-identifier': self.uid.id})
@ -983,21 +992,10 @@ class OEBBook(object):
guide = self.guide.to_opf1(package) guide = self.guide.to_opf1(package)
return {OPF_MIME: ('content.opf', package)} return {OPF_MIME: ('content.opf', package)}
def _generate_ncx_item(self):
id = 'ncx'
index = 0
while id in self.manifest:
id = 'ncx' + str(index)
index = index + 1
href = 'toc'
index = 0
while (href + '.ncx') in self.manifest.hrefs:
href = 'toc' + str(index)
href += '.ncx'
return (id, href)
def _to_ncx(self): def _to_ncx(self):
ncx = etree.Element(NCX('ncx'), attrib={'version': '2005-1'}, lang = unicode(self.metadata.language[0])
ncx = etree.Element(NCX('ncx'),
attrib={'version': '2005-1', XML('lang'): lang},
nsmap={None: NCX_NS}) nsmap={None: NCX_NS})
head = etree.SubElement(ncx, NCX('head')) head = etree.SubElement(ncx, NCX('head'))
etree.SubElement(head, NCX('meta'), etree.SubElement(head, NCX('meta'),
@ -1021,7 +1019,7 @@ class OEBBook(object):
nsmap={None: OPF2_NS}) nsmap={None: OPF2_NS})
metadata = self.metadata.to_opf2(package) metadata = self.metadata.to_opf2(package)
manifest = self.manifest.to_opf2(package) manifest = self.manifest.to_opf2(package)
id, href = self._generate_ncx_item() id, href = self.manifest.generate('ncx', 'toc.ncx')
etree.SubElement(manifest, OPF('item'), etree.SubElement(manifest, OPF('item'),
attrib={'id': id, 'href': href, 'media-type': NCX_MIME}) attrib={'id': id, 'href': href, 'media-type': NCX_MIME})
spine = self.spine.to_opf2(package) spine = self.spine.to_opf2(package)

View File

@ -44,13 +44,15 @@ body > .calibre_toc_block {
} }
class HTMLTOCAdder(object): class HTMLTOCAdder(object):
def __init__(self, style='nested'): def __init__(self, title=None, style='nested'):
self.title = title
self.style = style self.style = style
def transform(self, oeb, context): def transform(self, oeb, context):
if 'toc' in oeb.guide: if 'toc' in oeb.guide:
return return
oeb.logger.info('Generating in-line TOC...') oeb.logger.info('Generating in-line TOC...')
title = self.title or oeb.translate('Table of Contents')
style = self.style style = self.style
if style not in STYLE_CSS: if style not in STYLE_CSS:
oeb.logger.error('Unknown TOC style %r' % style) oeb.logger.error('Unknown TOC style %r' % style)
@ -61,15 +63,15 @@ class HTMLTOCAdder(object):
contents = element(None, XHTML('html'), nsmap={None: XHTML_NS}, contents = element(None, XHTML('html'), nsmap={None: XHTML_NS},
attrib={XML('lang'): language}) attrib={XML('lang'): language})
head = element(contents, XHTML('head')) head = element(contents, XHTML('head'))
title = element(head, XHTML('title')) htitle = element(head, XHTML('title'))
title.text = 'Table of Contents' htitle.text = title
element(head, XHTML('link'), rel='stylesheet', type=CSS_MIME, element(head, XHTML('link'), rel='stylesheet', type=CSS_MIME,
href=css_href) href=css_href)
body = element(contents, XHTML('body'), body = element(contents, XHTML('body'),
attrib={'class': 'calibre_toc'}) attrib={'class': 'calibre_toc'})
h1 = element(body, XHTML('h1'), h1 = element(body, XHTML('h1'),
attrib={'class': 'calibre_toc_header'}) attrib={'class': 'calibre_toc_header'})
h1.text = 'Table of Contents' h1.text = title
self.add_toc_level(body, oeb.toc) self.add_toc_level(body, oeb.toc)
id, href = oeb.manifest.generate('contents', 'contents.xhtml') id, href = oeb.manifest.generate('contents', 'contents.xhtml')
item = oeb.manifest.add(id, href, XHTML_MIME, data=contents) item = oeb.manifest.add(id, href, XHTML_MIME, data=contents)

View File

@ -41,8 +41,9 @@ class ManifestTrimmer(object):
while unchecked: while unchecked:
new = set() new = set()
for item in unchecked: for item in unchecked:
if item.media_type in OEB_DOCS or \ if (item.media_type in OEB_DOCS or
item.media_type[-4:] in ('/xml', '+xml'): item.media_type[-4:] in ('/xml', '+xml')) and \
item.data is not None:
hrefs = [sel(item.data) for sel in LINK_SELECTORS] hrefs = [sel(item.data) for sel in LINK_SELECTORS]
for href in chain(*hrefs): for href in chain(*hrefs):
href = item.abshref(href) href = item.abshref(href)

View File

@ -296,6 +296,8 @@ class Main(MainWindow, Ui_MainWindow):
self.card_view.connect_dirtied_signal(self.upload_booklists) self.card_view.connect_dirtied_signal(self.upload_booklists)
self.show() self.show()
if self.system_tray_icon.isVisible() and opts.start_in_tray:
self.hide()
self.stack.setCurrentIndex(0) self.stack.setCurrentIndex(0)
try: try:
db = LibraryDatabase2(self.library_path) db = LibraryDatabase2(self.library_path)
@ -1527,6 +1529,8 @@ path_to_ebook to the database.
''') ''')
parser.add_option('--with-library', default=None, action='store', parser.add_option('--with-library', default=None, action='store',
help=_('Use the library located at the specified path.')) help=_('Use the library located at the specified path.'))
parser.add_option('--start-in-tray', default=False, action='store_true',
help=_('Start minimized to system tray.'))
parser.add_option('-v', '--verbose', default=0, action='count', parser.add_option('-v', '--verbose', default=0, action='count',
help=_('Log debugging information to console')) help=_('Log debugging information to console'))
return parser return parser

View File

@ -13,7 +13,7 @@ msgstr ""
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2009-01-19 06:40+0000\n" "X-Launchpad-Export-Date: 2009-01-20 17:04+0000\n"
"X-Generator: Launchpad (build Unknown)\n" "X-Generator: Launchpad (build Unknown)\n"
"Generated-By: pygettext.py 1.5\n" "Generated-By: pygettext.py 1.5\n"

View File

@ -17,7 +17,7 @@ msgstr ""
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2009-01-19 06:40+0000\n" "X-Launchpad-Export-Date: 2009-01-20 17:04+0000\n"
"X-Generator: Launchpad (build Unknown)\n" "X-Generator: Launchpad (build Unknown)\n"
#: /home/kovid/work/calibre/src/calibre/customize/__init__.py:41 #: /home/kovid/work/calibre/src/calibre/customize/__init__.py:41

View File

@ -14,7 +14,7 @@ msgstr ""
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2009-01-19 06:40+0000\n" "X-Launchpad-Export-Date: 2009-01-20 17:04+0000\n"
"X-Generator: Launchpad (build Unknown)\n" "X-Generator: Launchpad (build Unknown)\n"
#: /home/kovid/work/calibre/src/calibre/customize/__init__.py:41 #: /home/kovid/work/calibre/src/calibre/customize/__init__.py:41

View File

@ -8,13 +8,13 @@ msgstr ""
"Project-Id-Version: de\n" "Project-Id-Version: de\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-01-19 04:38+0000\n" "POT-Creation-Date: 2009-01-19 04:38+0000\n"
"PO-Revision-Date: 2009-01-10 09:57+0000\n" "PO-Revision-Date: 2009-01-19 21:16+0000\n"
"Last-Translator: S. Dorscht <Unknown>\n" "Last-Translator: S. Dorscht <Unknown>\n"
"Language-Team: American English <kde-i18n-doc@lists.kde.org>\n" "Language-Team: American English <kde-i18n-doc@lists.kde.org>\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2009-01-19 06:40+0000\n" "X-Launchpad-Export-Date: 2009-01-20 17:04+0000\n"
"X-Generator: Launchpad (build Unknown)\n" "X-Generator: Launchpad (build Unknown)\n"
"Generated-By: pygettext.py 1.5\n" "Generated-By: pygettext.py 1.5\n"
@ -1836,7 +1836,7 @@ msgstr "Benutzung: rb-meta file.rb"
#: /home/kovid/work/calibre/src/calibre/ebooks/mobi/from_any.py:52 #: /home/kovid/work/calibre/src/calibre/ebooks/mobi/from_any.py:52
msgid "Creating Mobipocket file from EPUB..." msgid "Creating Mobipocket file from EPUB..."
msgstr "" msgstr "Erstelle Mobipocket Datei aus EPUB..."
#: /home/kovid/work/calibre/src/calibre/ebooks/mobi/reader.py:505 #: /home/kovid/work/calibre/src/calibre/ebooks/mobi/reader.py:505
msgid "%prog [options] myebook.mobi" msgid "%prog [options] myebook.mobi"
@ -1848,47 +1848,51 @@ msgstr "Original MOBI HTML gespeichert in"
#: /home/kovid/work/calibre/src/calibre/ebooks/mobi/writer.py:501 #: /home/kovid/work/calibre/src/calibre/ebooks/mobi/writer.py:501
msgid "Mobipocket" msgid "Mobipocket"
msgstr "" msgstr "Mobipocket"
#: /home/kovid/work/calibre/src/calibre/ebooks/mobi/writer.py:502 #: /home/kovid/work/calibre/src/calibre/ebooks/mobi/writer.py:502
msgid "Mobipocket-specific options." msgid "Mobipocket-specific options."
msgstr "" msgstr "Einstellungen speziell für Mobipocket."
#: /home/kovid/work/calibre/src/calibre/ebooks/mobi/writer.py:505 #: /home/kovid/work/calibre/src/calibre/ebooks/mobi/writer.py:505
msgid "" msgid ""
"Compress file text using PalmDOC compression. Results in smaller files, but " "Compress file text using PalmDOC compression. Results in smaller files, but "
"takes a long time to run." "takes a long time to run."
msgstr "" msgstr ""
"Textdatei mit PalmDOC compression komprimieren. Ergibt kleinere Dateien, "
"dauert aber länger beim Start."
#: /home/kovid/work/calibre/src/calibre/ebooks/mobi/writer.py:509 #: /home/kovid/work/calibre/src/calibre/ebooks/mobi/writer.py:509
msgid "Modify images to meet Palm device size limitations." msgid "Modify images to meet Palm device size limitations."
msgstr "" msgstr "Bilder auf die Größenlimitation von Palm Geräten einstellen."
#: /home/kovid/work/calibre/src/calibre/ebooks/mobi/writer.py:511 #: /home/kovid/work/calibre/src/calibre/ebooks/mobi/writer.py:511
msgid "" msgid ""
"Device renderer profiles. Affects conversion of default font sizes and " "Device renderer profiles. Affects conversion of default font sizes and "
"rasterization resolution. Valid profiles are: %s." "rasterization resolution. Valid profiles are: %s."
msgstr "" msgstr ""
"Profile der Gerätedarstellung. Betrifft das Konvertieren mit "
"voreingestellten Schriftgrößen und Rasterauflösung. Vorhandene Profile: %s."
#: /home/kovid/work/calibre/src/calibre/ebooks/mobi/writer.py:511 #: /home/kovid/work/calibre/src/calibre/ebooks/mobi/writer.py:511
msgid "Profiles" msgid "Profiles"
msgstr "" msgstr "Profile"
#: /home/kovid/work/calibre/src/calibre/ebooks/mobi/writer.py:516 #: /home/kovid/work/calibre/src/calibre/ebooks/mobi/writer.py:516
msgid "Source renderer profile. Default is 'Browser'." msgid "Source renderer profile. Default is 'Browser'."
msgstr "" msgstr "Profil der Quellendarstellung. Voreinstellung ist 'Browser'."
#: /home/kovid/work/calibre/src/calibre/ebooks/mobi/writer.py:519 #: /home/kovid/work/calibre/src/calibre/ebooks/mobi/writer.py:519
msgid "Destination renderer profile. Default is 'CybookG3'." msgid "Destination renderer profile. Default is 'CybookG3'."
msgstr "" msgstr "Profil der Zieldarstellung. Voreinstellung ist 'CybookG3'."
#: /home/kovid/work/calibre/src/calibre/ebooks/mobi/writer.py:543 #: /home/kovid/work/calibre/src/calibre/ebooks/mobi/writer.py:543
msgid "Unknown source profile %r" msgid "Unknown source profile %r"
msgstr "" msgstr "Unbekanntes Profil der Quelle %r"
#: /home/kovid/work/calibre/src/calibre/ebooks/mobi/writer.py:547 #: /home/kovid/work/calibre/src/calibre/ebooks/mobi/writer.py:547
msgid "Unknown destination profile %r" msgid "Unknown destination profile %r"
msgstr "" msgstr "Unbekanntes Profil des Ziels %r"
#: /home/kovid/work/calibre/src/calibre/ebooks/odt/to_oeb.py:57 #: /home/kovid/work/calibre/src/calibre/ebooks/odt/to_oeb.py:57
msgid "The output directory. Defaults to the current directory." msgid "The output directory. Defaults to the current directory."
@ -3513,7 +3517,7 @@ msgstr "Passwort erforderlich"
#: /home/kovid/work/calibre/src/calibre/gui2/dialogs/progress.py:42 #: /home/kovid/work/calibre/src/calibre/gui2/dialogs/progress.py:42
msgid "Aborting..." msgid "Aborting..."
msgstr "" msgstr "Abbruch läuft ..."
#: /home/kovid/work/calibre/src/calibre/gui2/dialogs/scheduler.py:39 #: /home/kovid/work/calibre/src/calibre/gui2/dialogs/scheduler.py:39
msgid "You" msgid "You"
@ -4548,11 +4552,11 @@ msgstr "Speichern auf Festplatte nicht möglich"
#: /home/kovid/work/calibre/src/calibre/gui2/main.py:973 #: /home/kovid/work/calibre/src/calibre/gui2/main.py:973
msgid "Saving to disk..." msgid "Saving to disk..."
msgstr "" msgstr "Speichere auf Festplatte..."
#: /home/kovid/work/calibre/src/calibre/gui2/main.py:978 #: /home/kovid/work/calibre/src/calibre/gui2/main.py:978
msgid "Saved" msgid "Saved"
msgstr "" msgstr "Gespeichert"
#: /home/kovid/work/calibre/src/calibre/gui2/main.py:984 #: /home/kovid/work/calibre/src/calibre/gui2/main.py:984
msgid "Choose destination directory" msgid "Choose destination directory"

View File

@ -0,0 +1,27 @@
'''
Dynamic language lookup of translations for user-visible strings.
'''
__license__ = 'GPL v3'
__copyright__ = '2008, Marshall T. Vandegrift <llasram@gmail.com>'
import sys
from cStringIO import StringIO
from gettext import GNUTranslations, NullTranslations
from calibre.translations.compiled import translations
__all__ = ['translate']
_CACHE = {}
def translate(lang, text):
trans = None
if lang in _CACHE:
trans = _CACHE[lang]
elif lang in translations:
buf = StringIO(translations[lang])
trans = GNUTranslations(buf)
_CACHE[lang] = trans
if trans is None:
return _(text)
return trans.ugettext(text)

View File

@ -14,7 +14,7 @@ msgstr ""
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2009-01-19 06:40+0000\n" "X-Launchpad-Export-Date: 2009-01-20 17:04+0000\n"
"X-Generator: Launchpad (build Unknown)\n" "X-Generator: Launchpad (build Unknown)\n"
#: /home/kovid/work/calibre/src/calibre/customize/__init__.py:41 #: /home/kovid/work/calibre/src/calibre/customize/__init__.py:41

View File

@ -11,13 +11,13 @@ msgstr ""
"Project-Id-Version: es\n" "Project-Id-Version: es\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-01-19 04:38+0000\n" "POT-Creation-Date: 2009-01-19 04:38+0000\n"
"PO-Revision-Date: 2009-01-19 06:30+0000\n" "PO-Revision-Date: 2009-01-20 01:11+0000\n"
"Last-Translator: Kovid Goyal <Unknown>\n" "Last-Translator: DiegoJ <diegojromerolopez@gmail.com>\n"
"Language-Team: Spanish\n" "Language-Team: Spanish\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2009-01-19 06:40+0000\n" "X-Launchpad-Export-Date: 2009-01-20 17:04+0000\n"
"X-Generator: Launchpad (build Unknown)\n" "X-Generator: Launchpad (build Unknown)\n"
#: /home/kovid/work/calibre/src/calibre/customize/__init__.py:41 #: /home/kovid/work/calibre/src/calibre/customize/__init__.py:41
@ -382,6 +382,9 @@ msgid ""
"preference to the autodetected one. With this option, the autodetected one " "preference to the autodetected one. With this option, the autodetected one "
"is always used." "is always used."
msgstr "" msgstr ""
"Normalmente, si el archivo fuente ya tiene una Tabla de contenidos, se usa "
"esa en vez de la autodetectada. Con esta opción la autodetectada es la que "
"siempre se usa."
#: /home/kovid/work/calibre/src/calibre/ebooks/epub/__init__.py:148 #: /home/kovid/work/calibre/src/calibre/ebooks/epub/__init__.py:148
msgid "Control page layout" msgid "Control page layout"
@ -1748,7 +1751,7 @@ msgstr "Uso: rb-meta file.rb"
#: /home/kovid/work/calibre/src/calibre/ebooks/mobi/from_any.py:52 #: /home/kovid/work/calibre/src/calibre/ebooks/mobi/from_any.py:52
msgid "Creating Mobipocket file from EPUB..." msgid "Creating Mobipocket file from EPUB..."
msgstr "" msgstr "Creando archivo Mobipocket de un EPUB..."
#: /home/kovid/work/calibre/src/calibre/ebooks/mobi/reader.py:505 #: /home/kovid/work/calibre/src/calibre/ebooks/mobi/reader.py:505
msgid "%prog [options] myebook.mobi" msgid "%prog [options] myebook.mobi"
@ -1760,21 +1763,25 @@ msgstr "HTML MOBI en bruto guardado en"
#: /home/kovid/work/calibre/src/calibre/ebooks/mobi/writer.py:501 #: /home/kovid/work/calibre/src/calibre/ebooks/mobi/writer.py:501
msgid "Mobipocket" msgid "Mobipocket"
msgstr "" msgstr "Mobipocket"
#: /home/kovid/work/calibre/src/calibre/ebooks/mobi/writer.py:502 #: /home/kovid/work/calibre/src/calibre/ebooks/mobi/writer.py:502
msgid "Mobipocket-specific options." msgid "Mobipocket-specific options."
msgstr "" msgstr "Opciones específicas de Mobipocket"
#: /home/kovid/work/calibre/src/calibre/ebooks/mobi/writer.py:505 #: /home/kovid/work/calibre/src/calibre/ebooks/mobi/writer.py:505
msgid "" msgid ""
"Compress file text using PalmDOC compression. Results in smaller files, but " "Compress file text using PalmDOC compression. Results in smaller files, but "
"takes a long time to run." "takes a long time to run."
msgstr "" msgstr ""
"Comprimir archivo de texto usando compresión PalmDOC. Genera archivos de "
"menor tamaño, pero tarda bastante tiempo en terminar."
#: /home/kovid/work/calibre/src/calibre/ebooks/mobi/writer.py:509 #: /home/kovid/work/calibre/src/calibre/ebooks/mobi/writer.py:509
msgid "Modify images to meet Palm device size limitations." msgid "Modify images to meet Palm device size limitations."
msgstr "" msgstr ""
"Modificar imágenes para adecuarse a las limitecaiones de tamaño del "
"dispositivo de Palm"
#: /home/kovid/work/calibre/src/calibre/ebooks/mobi/writer.py:511 #: /home/kovid/work/calibre/src/calibre/ebooks/mobi/writer.py:511
msgid "" msgid ""
@ -1784,7 +1791,7 @@ msgstr ""
#: /home/kovid/work/calibre/src/calibre/ebooks/mobi/writer.py:511 #: /home/kovid/work/calibre/src/calibre/ebooks/mobi/writer.py:511
msgid "Profiles" msgid "Profiles"
msgstr "" msgstr "Perfiles"
#: /home/kovid/work/calibre/src/calibre/ebooks/mobi/writer.py:516 #: /home/kovid/work/calibre/src/calibre/ebooks/mobi/writer.py:516
msgid "Source renderer profile. Default is 'Browser'." msgid "Source renderer profile. Default is 'Browser'."
@ -3396,7 +3403,7 @@ msgstr "Se necesita contraseña."
#: /home/kovid/work/calibre/src/calibre/gui2/dialogs/progress.py:42 #: /home/kovid/work/calibre/src/calibre/gui2/dialogs/progress.py:42
msgid "Aborting..." msgid "Aborting..."
msgstr "" msgstr "Abortando..."
#: /home/kovid/work/calibre/src/calibre/gui2/dialogs/scheduler.py:39 #: /home/kovid/work/calibre/src/calibre/gui2/dialogs/scheduler.py:39
msgid "You" msgid "You"
@ -4404,11 +4411,11 @@ msgstr "No se puede guardar en disco"
#: /home/kovid/work/calibre/src/calibre/gui2/main.py:973 #: /home/kovid/work/calibre/src/calibre/gui2/main.py:973
msgid "Saving to disk..." msgid "Saving to disk..."
msgstr "" msgstr "Guardando al disco..."
#: /home/kovid/work/calibre/src/calibre/gui2/main.py:978 #: /home/kovid/work/calibre/src/calibre/gui2/main.py:978
msgid "Saved" msgid "Saved"
msgstr "" msgstr "Guardado"
#: /home/kovid/work/calibre/src/calibre/gui2/main.py:984 #: /home/kovid/work/calibre/src/calibre/gui2/main.py:984
msgid "Choose destination directory" msgid "Choose destination directory"
@ -5412,6 +5419,15 @@ msgid ""
"\n" "\n"
"For help on an individual command: %%prog command --help\n" "For help on an individual command: %%prog command --help\n"
msgstr "" msgstr ""
"%%prog orden [opciones] [argumentos]\n"
"\n"
"%%prog es la interfaz de línea de órdenes a la base de datos de libros de "
"calibre.\n"
"\n"
"orden es una de:\n"
" %s\n"
"\n"
"Para ver la ayuda a cada orden ejecuta: %%prog orden --help\n"
#: /home/kovid/work/calibre/src/calibre/library/database2.py:1171 #: /home/kovid/work/calibre/src/calibre/library/database2.py:1171
msgid "<p>Copying books to %s<br><center>" msgid "<p>Copying books to %s<br><center>"

View File

@ -13,7 +13,7 @@ msgstr ""
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2009-01-19 06:40+0000\n" "X-Launchpad-Export-Date: 2009-01-20 17:04+0000\n"
"X-Generator: Launchpad (build Unknown)\n" "X-Generator: Launchpad (build Unknown)\n"
"Generated-By: pygettext.py 1.5\n" "Generated-By: pygettext.py 1.5\n"

View File

@ -14,7 +14,7 @@ msgstr ""
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2009-01-19 06:40+0000\n" "X-Launchpad-Export-Date: 2009-01-20 17:04+0000\n"
"X-Generator: Launchpad (build Unknown)\n" "X-Generator: Launchpad (build Unknown)\n"
#: /home/kovid/work/calibre/src/calibre/customize/__init__.py:41 #: /home/kovid/work/calibre/src/calibre/customize/__init__.py:41

View File

@ -8,13 +8,13 @@ msgstr ""
"Project-Id-Version: calibre\n" "Project-Id-Version: calibre\n"
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n" "Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
"POT-Creation-Date: 2009-01-19 04:38+0000\n" "POT-Creation-Date: 2009-01-19 04:38+0000\n"
"PO-Revision-Date: 2009-01-19 06:34+0000\n" "PO-Revision-Date: 2009-01-20 11:05+0000\n"
"Last-Translator: Kovid Goyal <Unknown>\n" "Last-Translator: Molnár Gábor <csirkus@gmail.com>\n"
"Language-Team: Hungarian <hu@li.org>\n" "Language-Team: Hungarian <hu@li.org>\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2009-01-19 06:40+0000\n" "X-Launchpad-Export-Date: 2009-01-20 17:04+0000\n"
"X-Generator: Launchpad (build Unknown)\n" "X-Generator: Launchpad (build Unknown)\n"
#: /home/kovid/work/calibre/src/calibre/customize/__init__.py:41 #: /home/kovid/work/calibre/src/calibre/customize/__init__.py:41
@ -330,6 +330,11 @@ msgid ""
"if your source file contains a very large number of page breaks, you should " "if your source file contains a very large number of page breaks, you should "
"turn off splitting on page breaks." "turn off splitting on page breaks."
msgstr "" msgstr ""
"Oldaltörésnél ne legyen szétvágás. Normális esetben a bemeneti fájlok minden "
"oldaltörésnél két részre lesznek vágva. Ez olyan e-könyv formátumot "
"eredmenyez, amelyet gyorsabban, kevesebb erőforrást igényelve lehet "
"beolvasni. Ez a művelet azonban lassú, és ha a forrásfájlod sok oldaltörést "
"tartalmaz, akkor érdemes alkalmazni ezt az opciót."
#: /home/kovid/work/calibre/src/calibre/ebooks/epub/__init__.py:128 #: /home/kovid/work/calibre/src/calibre/ebooks/epub/__init__.py:128
msgid "" msgid ""
@ -339,6 +344,11 @@ msgid ""
"trying\n" "trying\n"
"to auto-generate a Table of Contents.\n" "to auto-generate a Table of Contents.\n"
msgstr "" msgstr ""
"Az automatkius tartalomjegyzék generálásás beállítása. Ha egy OPF fájllal "
"dolgozunk\n"
"és a fájlban található tartalomjegyzék, akkor azt használja a generált "
"tartalomjegyzék\n"
"helyett.\n"
#: /home/kovid/work/calibre/src/calibre/ebooks/epub/__init__.py:134 #: /home/kovid/work/calibre/src/calibre/ebooks/epub/__init__.py:134
msgid "" msgid ""
@ -390,6 +400,10 @@ msgid ""
"placed in. See http://www.niso.org/workrooms/daisy/Z39-86-2005.html#NCX for " "placed in. See http://www.niso.org/workrooms/daisy/Z39-86-2005.html#NCX for "
"an overview of the NCX format." "an overview of the NCX format."
msgstr "" msgstr ""
"Egy .ncx fájl helye, amely tartalmazza ennek a könyvnek a tartalomjegyzékét. "
"Az NCX fájlnak a saját könyvtárához viszonyított linkeket kell tartalmaznia, "
"nem abszolút linkeket. Áttekintés az NCX formátumról: "
"http://www.niso.org/workrooms/daisy/Z39-86-2005.html#NCX"
#: /home/kovid/work/calibre/src/calibre/ebooks/epub/__init__.py:146 #: /home/kovid/work/calibre/src/calibre/ebooks/epub/__init__.py:146
msgid "" msgid ""
@ -622,6 +636,7 @@ msgstr ""
#: /home/kovid/work/calibre/src/calibre/ebooks/html.py:897 #: /home/kovid/work/calibre/src/calibre/ebooks/html.py:897
msgid "Output HTML is \"pretty printed\" for easier parsing by humans" msgid "Output HTML is \"pretty printed\" for easier parsing by humans"
msgstr "" msgstr ""
"A kimenet HTML kód \"szépen formázott\" lesz a könnyebb olvashatóság kedvéért"
#: /home/kovid/work/calibre/src/calibre/ebooks/html.py:903 #: /home/kovid/work/calibre/src/calibre/ebooks/html.py:903
msgid "" msgid ""
@ -737,6 +752,8 @@ msgid ""
"Render HTML tables as blocks of text instead of actual tables. This is " "Render HTML tables as blocks of text instead of actual tables. This is "
"neccessary if the HTML contains very large or complex tables." "neccessary if the HTML contains very large or complex tables."
msgstr "" msgstr ""
"A HTML táblázatokat alakítsa át szövegblokkokká. Ez akkor szükséges, ha a "
"HTML nagy vagy bonyolult táblázatokat tartalmaz."
#: /home/kovid/work/calibre/src/calibre/ebooks/lrf/__init__.py:99 #: /home/kovid/work/calibre/src/calibre/ebooks/lrf/__init__.py:99
msgid "" msgid ""
@ -773,12 +790,15 @@ msgstr ""
#: /home/kovid/work/calibre/src/calibre/ebooks/lrf/__init__.py:112 #: /home/kovid/work/calibre/src/calibre/ebooks/lrf/__init__.py:112
msgid "Add extra spacing below the header. Default is %default px." msgid "Add extra spacing below the header. Default is %default px."
msgstr "" msgstr ""
"Hagyjon ki ennyi helyet a fejléc alatt. Az alapértelmezés %default pixel."
#: /home/kovid/work/calibre/src/calibre/ebooks/lrf/__init__.py:114 #: /home/kovid/work/calibre/src/calibre/ebooks/lrf/__init__.py:114
msgid "" msgid ""
"Override the CSS. Can be either a path to a CSS stylesheet or a string. If " "Override the CSS. Can be either a path to a CSS stylesheet or a string. If "
"it is a string it is interpreted as CSS." "it is a string it is interpreted as CSS."
msgstr "" msgstr ""
"Használja formázáshoz a következő CSS-t. Lehet egy útvonal egy CSS fájlhoz, "
"vagy maga a CSS kód."
#: /home/kovid/work/calibre/src/calibre/ebooks/lrf/__init__.py:116 #: /home/kovid/work/calibre/src/calibre/ebooks/lrf/__init__.py:116
msgid "" msgid ""
@ -819,31 +839,35 @@ msgstr ""
#: /home/kovid/work/calibre/src/calibre/ebooks/lrf/__init__.py:137 #: /home/kovid/work/calibre/src/calibre/ebooks/lrf/__init__.py:137
msgid "Left margin of page. Default is %default px." msgid "Left margin of page. Default is %default px."
msgstr "" msgstr "Bal margó mérete. Alapértelmezés: %default pixel."
#: /home/kovid/work/calibre/src/calibre/ebooks/lrf/__init__.py:139 #: /home/kovid/work/calibre/src/calibre/ebooks/lrf/__init__.py:139
msgid "Right margin of page. Default is %default px." msgid "Right margin of page. Default is %default px."
msgstr "" msgstr "Jobb margó mérete. Alapértelmezés: %default pixel."
#: /home/kovid/work/calibre/src/calibre/ebooks/lrf/__init__.py:141 #: /home/kovid/work/calibre/src/calibre/ebooks/lrf/__init__.py:141
msgid "Top margin of page. Default is %default px." msgid "Top margin of page. Default is %default px."
msgstr "" msgstr "Felső margó mérete. Alapértelmezés: %default pixel."
#: /home/kovid/work/calibre/src/calibre/ebooks/lrf/__init__.py:143 #: /home/kovid/work/calibre/src/calibre/ebooks/lrf/__init__.py:143
msgid "Bottom margin of page. Default is %default px." msgid "Bottom margin of page. Default is %default px."
msgstr "" msgstr "Alsó margó mérete. Alapértelmezés: %default pixel."
#: /home/kovid/work/calibre/src/calibre/ebooks/lrf/__init__.py:145 #: /home/kovid/work/calibre/src/calibre/ebooks/lrf/__init__.py:145
msgid "" msgid ""
"Render tables in the HTML as images (useful if the document has large or " "Render tables in the HTML as images (useful if the document has large or "
"complex tables)" "complex tables)"
msgstr "" msgstr ""
"A HTML táblázatokat képként szúrja be a szövegbe. Ez bonyolult vagy nagy "
"táblázatoknál hasznos."
#: /home/kovid/work/calibre/src/calibre/ebooks/lrf/__init__.py:147 #: /home/kovid/work/calibre/src/calibre/ebooks/lrf/__init__.py:147
msgid "" msgid ""
"Multiply the size of text in rendered tables by this factor. Default is " "Multiply the size of text in rendered tables by this factor. Default is "
"%default" "%default"
msgstr "" msgstr ""
"A betűméret szorzótényezője. Ennyiszer lesz nagyobb minden betű. "
"Alapértelmezés: %default"
#: /home/kovid/work/calibre/src/calibre/ebooks/lrf/__init__.py:152 #: /home/kovid/work/calibre/src/calibre/ebooks/lrf/__init__.py:152
msgid "" msgid ""
@ -857,6 +881,8 @@ msgid ""
"A regular expression. <a> tags whose href matches will be ignored. Defaults " "A regular expression. <a> tags whose href matches will be ignored. Defaults "
"to %default" "to %default"
msgstr "" msgstr ""
"Azok az <a> tag-ek, amelyek illeszkednek erre a reguláris kifejezésre nem "
"fognak szerepelni a kimenetben. Alapértelmezés: %default"
#: /home/kovid/work/calibre/src/calibre/ebooks/lrf/__init__.py:160 #: /home/kovid/work/calibre/src/calibre/ebooks/lrf/__init__.py:160
msgid "Don't add links to the table of contents." msgid "Don't add links to the table of contents."
@ -871,6 +897,9 @@ msgid ""
"The regular expression used to detect chapter titles. It is searched for in " "The regular expression used to detect chapter titles. It is searched for in "
"heading tags (h1-h6). Defaults to %default" "heading tags (h1-h6). Defaults to %default"
msgstr "" msgstr ""
"Reguláris kifejezés, amely a fejezetcímek automatikus felismeréséhez "
"használatos. A h1-h6 tag-ekben keresünk illeszkedést. Alapértelmezés: "
"%default"
#: /home/kovid/work/calibre/src/calibre/ebooks/lrf/__init__.py:170 #: /home/kovid/work/calibre/src/calibre/ebooks/lrf/__init__.py:170
msgid "" msgid ""
@ -897,6 +926,8 @@ msgstr ""
msgid "" msgid ""
"Force a page break before tags whose names match this regular expression." "Force a page break before tags whose names match this regular expression."
msgstr "" msgstr ""
"Sortörés beszúrása azon tag-ek előtt amelyek neve illeszkedik erre a "
"reguláris kifejezésre."
#: /home/kovid/work/calibre/src/calibre/ebooks/lrf/__init__.py:184 #: /home/kovid/work/calibre/src/calibre/ebooks/lrf/__init__.py:184
msgid "" msgid ""
@ -913,16 +944,21 @@ msgstr "Az automatikusan észlelt fejezetek hozzáadása a tartalomjegyzékhez."
#: /home/kovid/work/calibre/src/calibre/ebooks/lrf/__init__.py:190 #: /home/kovid/work/calibre/src/calibre/ebooks/lrf/__init__.py:190
msgid "Preprocess Baen HTML files to improve generated LRF." msgid "Preprocess Baen HTML files to improve generated LRF."
msgstr "" msgstr ""
"A Baen HTML fájlok előfeldolgozása a jobb minőségű kimenet érdekében."
#: /home/kovid/work/calibre/src/calibre/ebooks/lrf/__init__.py:192 #: /home/kovid/work/calibre/src/calibre/ebooks/lrf/__init__.py:192
msgid "" msgid ""
"You must add this option if processing files generated by pdftohtml, " "You must add this option if processing files generated by pdftohtml, "
"otherwise conversion will fail." "otherwise conversion will fail."
msgstr "" msgstr ""
"Ezt a kapcsolót abban az esetben kell használnod, ha a HTML fájlt a "
"pdftohtml program generálta, ellenkező esetben nem lesz sikeres a "
"konvertálás!"
#: /home/kovid/work/calibre/src/calibre/ebooks/lrf/__init__.py:194 #: /home/kovid/work/calibre/src/calibre/ebooks/lrf/__init__.py:194
msgid "Use this option on html0 files from Book Designer." msgid "Use this option on html0 files from Book Designer."
msgstr "" msgstr ""
"Ezt a kapcsolót a Book Designer program html0 fájljaihoz kell használni."
#: /home/kovid/work/calibre/src/calibre/ebooks/lrf/__init__.py:197 #: /home/kovid/work/calibre/src/calibre/ebooks/lrf/__init__.py:197
msgid "" msgid ""
@ -957,6 +993,8 @@ msgid ""
"Minimize memory usage at the cost of longer processing times. Use this " "Minimize memory usage at the cost of longer processing times. Use this "
"option if you are on a memory constrained machine." "option if you are on a memory constrained machine."
msgstr "" msgstr ""
"Memória használat minimalizálása hosszabb feldolgozási időért cserébe. Kevés "
"memóriával rendelkező számítógépeken érdemes használni."
#: /home/kovid/work/calibre/src/calibre/ebooks/lrf/__init__.py:221 #: /home/kovid/work/calibre/src/calibre/ebooks/lrf/__init__.py:221
msgid "" msgid ""

View File

@ -15,7 +15,7 @@ msgstr ""
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2009-01-19 06:40+0000\n" "X-Launchpad-Export-Date: 2009-01-20 17:04+0000\n"
"X-Generator: Launchpad (build Unknown)\n" "X-Generator: Launchpad (build Unknown)\n"
"Generated-By: pygettext.py 1.5\n" "Generated-By: pygettext.py 1.5\n"

View File

@ -14,7 +14,7 @@ msgstr ""
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2009-01-19 06:40+0000\n" "X-Launchpad-Export-Date: 2009-01-20 17:04+0000\n"
"X-Generator: Launchpad (build Unknown)\n" "X-Generator: Launchpad (build Unknown)\n"
#: /home/kovid/work/calibre/src/calibre/customize/__init__.py:41 #: /home/kovid/work/calibre/src/calibre/customize/__init__.py:41

View File

@ -8,13 +8,13 @@ msgstr ""
"Project-Id-Version: de\n" "Project-Id-Version: de\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-01-19 04:38+0000\n" "POT-Creation-Date: 2009-01-19 04:38+0000\n"
"PO-Revision-Date: 2009-01-10 09:58+0000\n" "PO-Revision-Date: 2009-01-19 21:19+0000\n"
"Last-Translator: S. Dorscht <Unknown>\n" "Last-Translator: S. Dorscht <Unknown>\n"
"Language-Team: American English <kde-i18n-doc@lists.kde.org>\n" "Language-Team: American English <kde-i18n-doc@lists.kde.org>\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2009-01-19 06:40+0000\n" "X-Launchpad-Export-Date: 2009-01-20 17:04+0000\n"
"X-Generator: Launchpad (build Unknown)\n" "X-Generator: Launchpad (build Unknown)\n"
"Generated-By: pygettext.py 1.5\n" "Generated-By: pygettext.py 1.5\n"
@ -1836,7 +1836,7 @@ msgstr "Benutzung: rb-meta file.rb"
#: /home/kovid/work/calibre/src/calibre/ebooks/mobi/from_any.py:52 #: /home/kovid/work/calibre/src/calibre/ebooks/mobi/from_any.py:52
msgid "Creating Mobipocket file from EPUB..." msgid "Creating Mobipocket file from EPUB..."
msgstr "" msgstr "Erstelle Mobipocket Datei aus EPUB..."
#: /home/kovid/work/calibre/src/calibre/ebooks/mobi/reader.py:505 #: /home/kovid/work/calibre/src/calibre/ebooks/mobi/reader.py:505
msgid "%prog [options] myebook.mobi" msgid "%prog [options] myebook.mobi"
@ -1848,47 +1848,51 @@ msgstr "Original MOBI HTML gespeichert in"
#: /home/kovid/work/calibre/src/calibre/ebooks/mobi/writer.py:501 #: /home/kovid/work/calibre/src/calibre/ebooks/mobi/writer.py:501
msgid "Mobipocket" msgid "Mobipocket"
msgstr "" msgstr "Mobipocket"
#: /home/kovid/work/calibre/src/calibre/ebooks/mobi/writer.py:502 #: /home/kovid/work/calibre/src/calibre/ebooks/mobi/writer.py:502
msgid "Mobipocket-specific options." msgid "Mobipocket-specific options."
msgstr "" msgstr "Einstellungen speziell für Mobipocket."
#: /home/kovid/work/calibre/src/calibre/ebooks/mobi/writer.py:505 #: /home/kovid/work/calibre/src/calibre/ebooks/mobi/writer.py:505
msgid "" msgid ""
"Compress file text using PalmDOC compression. Results in smaller files, but " "Compress file text using PalmDOC compression. Results in smaller files, but "
"takes a long time to run." "takes a long time to run."
msgstr "" msgstr ""
"Textdatei mit PalmDOC compression komprimieren. Ergibt kleinere Dateien, "
"dauert aber länger beim Start."
#: /home/kovid/work/calibre/src/calibre/ebooks/mobi/writer.py:509 #: /home/kovid/work/calibre/src/calibre/ebooks/mobi/writer.py:509
msgid "Modify images to meet Palm device size limitations." msgid "Modify images to meet Palm device size limitations."
msgstr "" msgstr "Bilder auf die Größenlimitation von Palm Geräten einstellen."
#: /home/kovid/work/calibre/src/calibre/ebooks/mobi/writer.py:511 #: /home/kovid/work/calibre/src/calibre/ebooks/mobi/writer.py:511
msgid "" msgid ""
"Device renderer profiles. Affects conversion of default font sizes and " "Device renderer profiles. Affects conversion of default font sizes and "
"rasterization resolution. Valid profiles are: %s." "rasterization resolution. Valid profiles are: %s."
msgstr "" msgstr ""
"Profile der Gerätedarstellung. Betrifft das Konvertieren mit "
"voreingestellten Schriftgrößen und Rasterauflösung. Vorhandene Profile: %s."
#: /home/kovid/work/calibre/src/calibre/ebooks/mobi/writer.py:511 #: /home/kovid/work/calibre/src/calibre/ebooks/mobi/writer.py:511
msgid "Profiles" msgid "Profiles"
msgstr "" msgstr "Profile"
#: /home/kovid/work/calibre/src/calibre/ebooks/mobi/writer.py:516 #: /home/kovid/work/calibre/src/calibre/ebooks/mobi/writer.py:516
msgid "Source renderer profile. Default is 'Browser'." msgid "Source renderer profile. Default is 'Browser'."
msgstr "" msgstr "Profil der Quellendarstellung. Voreinstellung ist 'Browser'."
#: /home/kovid/work/calibre/src/calibre/ebooks/mobi/writer.py:519 #: /home/kovid/work/calibre/src/calibre/ebooks/mobi/writer.py:519
msgid "Destination renderer profile. Default is 'CybookG3'." msgid "Destination renderer profile. Default is 'CybookG3'."
msgstr "" msgstr "Profil der Zieldarstellung. Voreinstellung ist 'CybookG3'."
#: /home/kovid/work/calibre/src/calibre/ebooks/mobi/writer.py:543 #: /home/kovid/work/calibre/src/calibre/ebooks/mobi/writer.py:543
msgid "Unknown source profile %r" msgid "Unknown source profile %r"
msgstr "" msgstr "Unbekanntes Profil der Quelle %r"
#: /home/kovid/work/calibre/src/calibre/ebooks/mobi/writer.py:547 #: /home/kovid/work/calibre/src/calibre/ebooks/mobi/writer.py:547
msgid "Unknown destination profile %r" msgid "Unknown destination profile %r"
msgstr "" msgstr "Unbekanntes Profil des Ziels %r"
#: /home/kovid/work/calibre/src/calibre/ebooks/odt/to_oeb.py:57 #: /home/kovid/work/calibre/src/calibre/ebooks/odt/to_oeb.py:57
msgid "The output directory. Defaults to the current directory." msgid "The output directory. Defaults to the current directory."
@ -3513,7 +3517,7 @@ msgstr "Passwort erforderlich"
#: /home/kovid/work/calibre/src/calibre/gui2/dialogs/progress.py:42 #: /home/kovid/work/calibre/src/calibre/gui2/dialogs/progress.py:42
msgid "Aborting..." msgid "Aborting..."
msgstr "" msgstr "Abbruch läuft ..."
#: /home/kovid/work/calibre/src/calibre/gui2/dialogs/scheduler.py:39 #: /home/kovid/work/calibre/src/calibre/gui2/dialogs/scheduler.py:39
msgid "You" msgid "You"
@ -4548,11 +4552,11 @@ msgstr "Speichern auf Festplatte nicht möglich"
#: /home/kovid/work/calibre/src/calibre/gui2/main.py:973 #: /home/kovid/work/calibre/src/calibre/gui2/main.py:973
msgid "Saving to disk..." msgid "Saving to disk..."
msgstr "" msgstr "Speichere auf Festplatte..."
#: /home/kovid/work/calibre/src/calibre/gui2/main.py:978 #: /home/kovid/work/calibre/src/calibre/gui2/main.py:978
msgid "Saved" msgid "Saved"
msgstr "" msgstr "Gespeichert"
#: /home/kovid/work/calibre/src/calibre/gui2/main.py:984 #: /home/kovid/work/calibre/src/calibre/gui2/main.py:984
msgid "Choose destination directory" msgid "Choose destination directory"

View File

@ -14,7 +14,7 @@ msgstr ""
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2009-01-19 06:40+0000\n" "X-Launchpad-Export-Date: 2009-01-20 17:04+0000\n"
"X-Generator: Launchpad (build Unknown)\n" "X-Generator: Launchpad (build Unknown)\n"
#: /home/kovid/work/calibre/src/calibre/customize/__init__.py:41 #: /home/kovid/work/calibre/src/calibre/customize/__init__.py:41

View File

@ -14,7 +14,7 @@ msgstr ""
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2009-01-19 06:40+0000\n" "X-Launchpad-Export-Date: 2009-01-20 17:04+0000\n"
"X-Generator: Launchpad (build Unknown)\n" "X-Generator: Launchpad (build Unknown)\n"
#: /home/kovid/work/calibre/src/calibre/customize/__init__.py:41 #: /home/kovid/work/calibre/src/calibre/customize/__init__.py:41

View File

@ -14,7 +14,7 @@ msgstr ""
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2009-01-19 06:40+0000\n" "X-Launchpad-Export-Date: 2009-01-20 17:04+0000\n"
"X-Generator: Launchpad (build Unknown)\n" "X-Generator: Launchpad (build Unknown)\n"
#: /home/kovid/work/calibre/src/calibre/customize/__init__.py:41 #: /home/kovid/work/calibre/src/calibre/customize/__init__.py:41

View File

@ -14,7 +14,7 @@ msgstr ""
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2009-01-19 06:40+0000\n" "X-Launchpad-Export-Date: 2009-01-20 17:04+0000\n"
"X-Generator: Launchpad (build Unknown)\n" "X-Generator: Launchpad (build Unknown)\n"
#: /home/kovid/work/calibre/src/calibre/customize/__init__.py:41 #: /home/kovid/work/calibre/src/calibre/customize/__init__.py:41

View File

@ -13,7 +13,7 @@ msgstr ""
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2009-01-19 06:40+0000\n" "X-Launchpad-Export-Date: 2009-01-20 17:04+0000\n"
"X-Generator: Launchpad (build Unknown)\n" "X-Generator: Launchpad (build Unknown)\n"
"X-Poedit-Country: RUSSIAN FEDERATION\n" "X-Poedit-Country: RUSSIAN FEDERATION\n"
"X-Poedit-Language: Russian\n" "X-Poedit-Language: Russian\n"

View File

@ -14,7 +14,7 @@ msgstr ""
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2009-01-19 06:40+0000\n" "X-Launchpad-Export-Date: 2009-01-20 17:04+0000\n"
"X-Generator: Launchpad (build Unknown)\n" "X-Generator: Launchpad (build Unknown)\n"
#: /home/kovid/work/calibre/src/calibre/customize/__init__.py:41 #: /home/kovid/work/calibre/src/calibre/customize/__init__.py:41

View File

@ -7,13 +7,13 @@ msgstr ""
"Project-Id-Version: calibre 0.4.17\n" "Project-Id-Version: calibre 0.4.17\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-01-19 04:38+0000\n" "POT-Creation-Date: 2009-01-19 04:38+0000\n"
"PO-Revision-Date: 2009-01-07 18:38+0000\n" "PO-Revision-Date: 2009-01-19 08:55+0000\n"
"Last-Translator: Kovid Goyal <Unknown>\n" "Last-Translator: Janko Slatenšek <Unknown>\n"
"Language-Team: sl\n" "Language-Team: sl\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2009-01-19 06:40+0000\n" "X-Launchpad-Export-Date: 2009-01-20 17:04+0000\n"
"X-Generator: Launchpad (build Unknown)\n" "X-Generator: Launchpad (build Unknown)\n"
"Generated-By: pygettext.py 1.5\n" "Generated-By: pygettext.py 1.5\n"
@ -126,7 +126,7 @@ msgstr "Preberi meta podatke iz %s datotek"
#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:166 #: /home/kovid/work/calibre/src/calibre/customize/builtins.py:166
msgid "Extract cover from comic files" msgid "Extract cover from comic files"
msgstr "" msgstr "Pridobi naslovno stran iz stripa"
#: /home/kovid/work/calibre/src/calibre/customize/builtins.py:186 #: /home/kovid/work/calibre/src/calibre/customize/builtins.py:186
msgid "Read metadata from ebooks in ZIP archives" msgid "Read metadata from ebooks in ZIP archives"
@ -280,13 +280,15 @@ msgstr ""
#: /home/kovid/work/calibre/src/calibre/ebooks/epub/__init__.py:121 #: /home/kovid/work/calibre/src/calibre/ebooks/epub/__init__.py:121
msgid "Path to the cover to be used for this book" msgid "Path to the cover to be used for this book"
msgstr "" msgstr "Pot do naslovne strani, ki bo uporabljena za to knjigo"
#: /home/kovid/work/calibre/src/calibre/ebooks/epub/__init__.py:124 #: /home/kovid/work/calibre/src/calibre/ebooks/epub/__init__.py:124
msgid "" msgid ""
"Use the cover detected from the source file in preference to the specified " "Use the cover detected from the source file in preference to the specified "
"cover." "cover."
msgstr "" msgstr ""
"Uporabi naslovno stran zaznano v izvorni datoteki namesto v nastavitvah "
"specificirane naslovne strani."
#: /home/kovid/work/calibre/src/calibre/ebooks/epub/__init__.py:126 #: /home/kovid/work/calibre/src/calibre/ebooks/epub/__init__.py:126
msgid "" msgid ""
@ -397,7 +399,7 @@ msgstr ""
#: /home/kovid/work/calibre/src/calibre/ebooks/epub/__init__.py:167 #: /home/kovid/work/calibre/src/calibre/ebooks/epub/__init__.py:167
msgid "Print generated NCX file to stdout" msgid "Print generated NCX file to stdout"
msgstr "" msgstr "Izpiši ustvarjeno NCX datoteko na standardni izhod"
#: /home/kovid/work/calibre/src/calibre/ebooks/epub/__init__.py:169 #: /home/kovid/work/calibre/src/calibre/ebooks/epub/__init__.py:169
msgid "Keep intermediate files during processing by html2epub" msgid "Keep intermediate files during processing by html2epub"

View File

@ -14,7 +14,7 @@ msgstr ""
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2009-01-19 06:40+0000\n" "X-Launchpad-Export-Date: 2009-01-20 17:04+0000\n"
"X-Generator: Launchpad (build Unknown)\n" "X-Generator: Launchpad (build Unknown)\n"
#: /home/kovid/work/calibre/src/calibre/customize/__init__.py:41 #: /home/kovid/work/calibre/src/calibre/customize/__init__.py:41

View File

@ -14,7 +14,7 @@ msgstr ""
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2009-01-19 06:40+0000\n" "X-Launchpad-Export-Date: 2009-01-20 17:04+0000\n"
"X-Generator: Launchpad (build Unknown)\n" "X-Generator: Launchpad (build Unknown)\n"
#: /home/kovid/work/calibre/src/calibre/customize/__init__.py:41 #: /home/kovid/work/calibre/src/calibre/customize/__init__.py:41

View File

@ -532,7 +532,9 @@ class BasicNewsRecipe(object, LoggingInterface):
if body is not None: if body is not None:
templ = self.navbar.generate(False, f, a, feed_len, templ = self.navbar.generate(False, f, a, feed_len,
not self.has_single_feed, not self.has_single_feed,
url, __appname__, center=self.center_navbar) url, __appname__,
center=self.center_navbar,
extra_css=self.extra_css)
elem = BeautifulSoup(templ.render(doctype='xhtml').decode('utf-8')).find('div') elem = BeautifulSoup(templ.render(doctype='xhtml').decode('utf-8')).find('div')
body.insert(0, elem) body.insert(0, elem)
if self.remove_javascript: if self.remove_javascript:
@ -575,7 +577,8 @@ class BasicNewsRecipe(object, LoggingInterface):
def feeds2index(self, feeds): def feeds2index(self, feeds):
templ = templates.IndexTemplate() templ = templates.IndexTemplate()
return templ.generate(self.title, self.timefmt, feeds).render(doctype='xhtml') return templ.generate(self.title, self.timefmt, feeds,
extra_css=self.extra_css).render(doctype='xhtml')
@classmethod @classmethod
def description_limiter(cls, src): def description_limiter(cls, src):
@ -626,7 +629,8 @@ class BasicNewsRecipe(object, LoggingInterface):
templ = templates.FeedTemplate() templ = templates.FeedTemplate()
return templ.generate(feed, self.description_limiter).render(doctype='xhtml') return templ.generate(feed, self.description_limiter,
extra_css=self.extra_css).render(doctype='xhtml')
def create_logger(self, feed_number, article_number): def create_logger(self, feed_number, article_number):

View File

@ -22,7 +22,8 @@ recipe_modules = ['recipe_' + r for r in (
'time_magazine', 'endgadget', 'fudzilla', 'nspm_int', 'nspm', 'pescanik', 'time_magazine', 'endgadget', 'fudzilla', 'nspm_int', 'nspm', 'pescanik',
'spiegel_int', 'themarketticker', 'tomshardware', 'xkcd', 'ftd', 'zdnet', 'spiegel_int', 'themarketticker', 'tomshardware', 'xkcd', 'ftd', 'zdnet',
'joelonsoftware', 'telepolis', 'common_dreams', 'nin', 'tomshardware_de', 'joelonsoftware', 'telepolis', 'common_dreams', 'nin', 'tomshardware_de',
'pagina12', 'infobae', 'ambito', 'elargentino', 'sueddeutsche', 'pagina12', 'infobae', 'ambito', 'elargentino', 'sueddeutsche', 'the_age',
'laprensa',
)] )]
import re, imp, inspect, time, os import re, imp, inspect, time, os

View File

@ -0,0 +1,50 @@
#!/usr/bin/env python
__license__ = 'GPL v3'
__copyright__ = '2008, Darko Miletic <darko.miletic at gmail.com>'
'''
laprensa.com.ar
'''
import urllib
from calibre.web.feeds.news import BasicNewsRecipe
class LaPrensa(BasicNewsRecipe):
title = 'La Prensa'
__author__ = 'Darko Miletic'
description = 'Informacion Libre las 24 horas'
oldest_article = 7
max_articles_per_feed = 100
no_stylesheets = True
use_embedded_content = False
encoding = 'cp1252'
cover_url = 'http://www.laprensa.com.ar/imgs/logo.gif'
html2lrf_options = [
'--comment' , description
, '--category' , 'news, Argentina'
, '--publisher' , title
]
feeds = [
(u'Politica' , u'http://www.laprensa.com.ar/Rss.aspx?Rss=4' )
,(u'Economia' , u'http://www.laprensa.com.ar/Rss.aspx?Rss=5' )
,(u'Opinion' , u'http://www.laprensa.com.ar/Rss.aspx?Rss=6' )
,(u'El Mundo' , u'http://www.laprensa.com.ar/Rss.aspx?Rss=7' )
,(u'Actualidad' , u'http://www.laprensa.com.ar/Rss.aspx?Rss=8' )
,(u'Deportes' , u'http://www.laprensa.com.ar/Rss.aspx?Rss=9' )
,(u'Espectaculos', u'http://www.laprensa.com.ar/Rss.aspx?Rss=10')
]
def print_version(self, url):
return url.replace('.note.aspx','.NotePrint.note.aspx')
def get_article_url(self, article):
raw = article.get('link', None).encode('utf8')
final = urllib.quote(raw,':/')
return final
def preprocess_html(self, soup):
del soup.body['onload']
return soup

View File

@ -16,6 +16,14 @@ class NewYorker(BasicNewsRecipe):
max_articles_per_feed = 100 max_articles_per_feed = 100
no_stylesheets = False no_stylesheets = False
use_embedded_content = False use_embedded_content = False
extra_css = '''
.calibre_feed_list {font-size:xx-small}
.calibre_article_list {font-size:xx-small}
.calibre_feed_title {font-size:normal}
.calibre_recipe_title {font-size:normal}
.calibre_feed_description {font-size:xx-small}
'''
keep_only_tags = [ keep_only_tags = [
dict(name='div' , attrs={'id':'printbody' }) dict(name='div' , attrs={'id':'printbody' })

View File

@ -0,0 +1,55 @@
#!/usr/bin/env python
__license__ = 'GPL v3'
__copyright__ = '2009, Matthew Briggs <hal.sulphur@gmail.com>'
__docformat__ = 'restructuredtext en'
'''
theage.com.au
'''
from calibre import strftime
from calibre.web.feeds.news import BasicNewsRecipe
from calibre.ebooks.BeautifulSoup import BeautifulSoup
class TheAge(BasicNewsRecipe):
title = 'The Age'
description = 'Business News, World News and Breaking News in Melbourne, Australia'
__author__ = 'Matthew Briggs'
def get_browser(self):
br = BasicNewsRecipe.get_browser()
br.set_handle_refresh(False)
return br
def parse_index(self):
soup = BeautifulSoup(self.browser.open('http://www.theage.com.au/text/').read())
feeds, articles = [], []
feed = None
for tag in soup.findAll(['h3', 'a']):
if tag.name == 'h3':
if articles:
feeds.append((feed, articles))
articles = []
feed = self.tag_to_string(tag)
elif feed is not None and tag.has_key('href') and tag['href'].strip():
url = tag['href'].strip()
if url.startswith('/'):
url = 'http://www.theage.com.au' + url
title = self.tag_to_string(tag)
articles.append({
'title': title,
'url' : url,
'date' : strftime('%a, %d %b'),
'description' : '',
'content' : '',
})
return feeds

View File

@ -32,6 +32,11 @@ class NavBarTemplate(Template):
xmlns:py="http://genshi.edgewall.org/" xmlns:py="http://genshi.edgewall.org/"
> >
<head>
<style py:if="extra_css" type="text/css">
${extra_css}
</style>
</head>
<body> <body>
<div class="navbar" style="text-align:${'center' if center else 'left'};"> <div class="navbar" style="text-align:${'center' if center else 'left'};">
<hr py:if="bottom" /> <hr py:if="bottom" />
@ -60,14 +65,15 @@ class NavBarTemplate(Template):
''') ''')
def generate(self, bottom, feed, art, number_of_articles_in_feed, def generate(self, bottom, feed, art, number_of_articles_in_feed,
two_levels, url, __appname__, prefix='', center=True): two_levels, url, __appname__, prefix='', center=True,
extra_css=None):
if prefix and not prefix.endswith('/'): if prefix and not prefix.endswith('/'):
prefix += '/' prefix += '/'
return Template.generate(self, bottom=bottom, art=art, feed=feed, return Template.generate(self, bottom=bottom, art=art, feed=feed,
num=number_of_articles_in_feed, num=number_of_articles_in_feed,
two_levels=two_levels, url=url, two_levels=two_levels, url=url,
__appname__=__appname__, prefix=prefix, __appname__=__appname__, prefix=prefix,
center=center) center=center, extra_css=extra_css)
class IndexTemplate(Template): class IndexTemplate(Template):
@ -88,11 +94,14 @@ class IndexTemplate(Template):
<style py:if="style" type="text/css"> <style py:if="style" type="text/css">
${style} ${style}
</style> </style>
<style py:if="extra_css" type="text/css">
${extra_css}
</style>
</head> </head>
<body> <body>
<h1>${title}</h1> <h1 class="calibre_recipe_title">${title}</h1>
<p style="text-align:right">${date}</p> <p style="text-align:right">${date}</p>
<ul> <ul class="calibre_feed_list">
<py:for each="i, feed in enumerate(feeds)"> <py:for each="i, feed in enumerate(feeds)">
<li py:if="feed" id="feed_${str(i)}"> <li py:if="feed" id="feed_${str(i)}">
<a class="feed" href="${'feed_%d/index.html'%i}">${feed.title}</a> <a class="feed" href="${'feed_%d/index.html'%i}">${feed.title}</a>
@ -103,11 +112,12 @@ class IndexTemplate(Template):
</html> </html>
''') ''')
def generate(self, title, datefmt, feeds): def generate(self, title, datefmt, feeds, extra_css=None):
if isinstance(datefmt, unicode): if isinstance(datefmt, unicode):
datefmt = datefmt.encode(preferred_encoding) datefmt = datefmt.encode(preferred_encoding)
date = strftime(datefmt) date = strftime(datefmt)
return Template.generate(self, title=title, date=date, feeds=feeds) return Template.generate(self, title=title, date=date, feeds=feeds,
extra_css=extra_css)
class FeedTemplate(Template): class FeedTemplate(Template):
@ -128,18 +138,21 @@ class FeedTemplate(Template):
<style py:if="style" type="text/css"> <style py:if="style" type="text/css">
${style} ${style}
</style> </style>
<style py:if="extra_css" type="text/css">
${extra_css}
</style>
</head> </head>
<body style="page-break-before:always"> <body style="page-break-before:always">
<h2 class="feed_title">${feed.title}</h2> <h2 class="calibre_feed_title">${feed.title}</h2>
<py:if test="getattr(feed, 'image', None)"> <py:if test="getattr(feed, 'image', None)">
<div class="feed_image"> <div class="calibre_feed_image">
<img alt="${feed.image_alt}" src="${feed.image_url}" /> <img alt="${feed.image_alt}" src="${feed.image_url}" />
</div> </div>
</py:if> </py:if>
<div py:if="getattr(feed, 'description', None)"> <div class="calibre_feed_description" py:if="getattr(feed, 'description', None)">
${feed.description}<br /> ${feed.description}<br />
</div> </div>
<ul> <ul class="calibre_article_list">
<py:for each="i, article in enumerate(feed.articles)"> <py:for each="i, article in enumerate(feed.articles)">
<li id="${'article_%d'%i}" py:if="getattr(article, 'downloaded', False)" style="padding-bottom:0.5em"> <li id="${'article_%d'%i}" py:if="getattr(article, 'downloaded', False)" style="padding-bottom:0.5em">
<a class="article" href="${article.url}">${article.title}</a> <a class="article" href="${article.url}">${article.title}</a>
@ -157,8 +170,9 @@ class FeedTemplate(Template):
</html> </html>
''') ''')
def generate(self, feed, cutoff): def generate(self, feed, cutoff, extra_css=None):
return Template.generate(self, feed=feed, cutoff=cutoff) return Template.generate(self, feed=feed, cutoff=cutoff,
extra_css=extra_css)
class EmbeddedContent(Template): class EmbeddedContent(Template):

View File

@ -11,6 +11,8 @@ import sys, socket, os, urlparse, logging, re, time, copy, urllib2, threading, t
from urllib import url2pathname from urllib import url2pathname
from threading import RLock from threading import RLock
from httplib import responses from httplib import responses
from PIL import Image
from cStringIO import StringIO
from calibre import setup_cli_handlers, browser, sanitize_file_name, \ from calibre import setup_cli_handlers, browser, sanitize_file_name, \
relpath, LoggingInterface relpath, LoggingInterface
@ -183,8 +185,9 @@ class RecursiveFetcher(object, LoggingInterface):
except urllib2.URLError, err: except urllib2.URLError, err:
if hasattr(err, 'code') and responses.has_key(err.code): if hasattr(err, 'code') and responses.has_key(err.code):
raise FetchError, responses[err.code] raise FetchError, responses[err.code]
if getattr(err, 'reason', [0])[0] == 104: # Connection reset by peer if getattr(err, 'reason', [0])[0] == 104 or \
self.log_debug('Connection reset by peer retrying in 1 second.') getattr(getattr(err, 'args', [None])[0], 'errno', None) == -2: # Connection reset by peer or Name or service not know
self.log_debug('Temporary error, retrying in 1 second')
time.sleep(1) time.sleep(1)
with closing(self.browser.open(url)) as f: with closing(self.browser.open(url)) as f:
data = response(f.read()+f.read()) data = response(f.read()+f.read())
@ -304,12 +307,17 @@ class RecursiveFetcher(object, LoggingInterface):
fname = sanitize_file_name('img'+str(c)+ext) fname = sanitize_file_name('img'+str(c)+ext)
if isinstance(fname, unicode): if isinstance(fname, unicode):
fname = fname.encode('ascii', 'replace') fname = fname.encode('ascii', 'replace')
imgpath = os.path.join(diskpath, fname) imgpath = os.path.join(diskpath, fname+'.jpg')
try:
im = Image.open(StringIO(data)).convert('RGBA')
with self.imagemap_lock: with self.imagemap_lock:
self.imagemap[iurl] = imgpath self.imagemap[iurl] = imgpath
with open(imgpath, 'wb') as x: with open(imgpath, 'wb') as x:
x.write(data) im.save(x, 'JPEG')
tag['src'] = imgpath tag['src'] = imgpath
except:
traceback.print_exc()
continue
def absurl(self, baseurl, tag, key, filter=True): def absurl(self, baseurl, tag, key, filter=True):
iurl = tag[key] iurl = tag[key]
@ -398,7 +406,7 @@ class RecursiveFetcher(object, LoggingInterface):
_fname = basename(iurl) _fname = basename(iurl)
if not isinstance(_fname, unicode): if not isinstance(_fname, unicode):
_fname.decode('latin1', 'replace') _fname.decode('latin1', 'replace')
_fname.encode('ascii', 'replace').replace('%', '') _fname = _fname.encode('ascii', 'replace').replace('%', '').replace(os.sep, '')
res = os.path.join(linkdiskpath, _fname) res = os.path.join(linkdiskpath, _fname)
self.downloaded_paths.append(res) self.downloaded_paths.append(res)
self.filemap[nurl] = res self.filemap[nurl] = res