~ubuntu-branches/ubuntu/karmic/calibre/karmic

« back to all changes in this revision

Viewing changes to src/calibre/ebooks/lit/output.py

  • Committer: Bazaar Package Importer
  • Author(s): Martin Pitt
  • Date: 2009-07-30 12:49:41 UTC
  • mfrom: (1.3.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20090730124941-qjdsmri25zt8zocn
Tags: 0.6.3+dfsg-0ubuntu1
* New upstream release. Please see http://calibre.kovidgoyal.net/new_in_6/
  for the list of new features and changes.
* remove_postinstall.patch: Update for new version.
* build_debug.patch: Does not apply any more, disable for now. Might not be
  necessary any more.
* debian/copyright: Fix reference to versionless GPL.
* debian/rules: Drop obsolete dh_desktop call.
* debian/rules: Add workaround for weird Python 2.6 setuptools behaviour of
  putting compiled .so files into src/calibre/plugins/calibre/plugins
  instead of src/calibre/plugins.
* debian/rules: Drop hal fdi moving, new upstream version does not use hal
  any more. Drop hal dependency, too.
* debian/rules: Install udev rules into /lib/udev/rules.d.
* Add debian/calibre.preinst: Remove unmodified
  /etc/udev/rules.d/95-calibre.rules on upgrade.
* debian/control: Bump Python dependencies to 2.6, since upstream needs
  it now.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/env python
 
2
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai
 
3
from __future__ import with_statement
 
4
 
 
5
__license__   = 'GPL v3'
 
6
__copyright__ = '2009, Kovid Goyal <kovid@kovidgoyal.net>'
 
7
__docformat__ = 'restructuredtext en'
 
8
 
 
9
 
 
10
from calibre.customize.conversion import OutputFormatPlugin
 
11
 
 
12
class LITOutput(OutputFormatPlugin):
 
13
 
 
14
    name = 'LIT Output'
 
15
    author = 'Marshall T. Vandegrift'
 
16
    file_type = 'lit'
 
17
 
 
18
    def convert(self, oeb, output_path, input_plugin, opts, log):
 
19
        self.log, self.opts, self.oeb = log, opts, oeb
 
20
        from calibre.ebooks.oeb.transforms.manglecase import CaseMangler
 
21
        from calibre.ebooks.oeb.transforms.rasterize import SVGRasterizer
 
22
        from calibre.ebooks.oeb.transforms.htmltoc import HTMLTOCAdder
 
23
        from calibre.ebooks.lit.writer import LitWriter
 
24
        from calibre.ebooks.oeb.transforms.split import Split
 
25
        split = Split(split_on_page_breaks=True, max_flow_size=0)
 
26
        split(self.oeb, self.opts)
 
27
 
 
28
 
 
29
        tocadder = HTMLTOCAdder()
 
30
        tocadder(oeb, opts)
 
31
        mangler = CaseMangler()
 
32
        mangler(oeb, opts)
 
33
        rasterizer = SVGRasterizer()
 
34
        rasterizer(oeb, opts)
 
35
        lit = LitWriter()
 
36
        lit(oeb, output_path)
 
37
 
 
38