mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
This commit is contained in:
parent
0caca9fe4c
commit
8b1800f8dc
@ -43,6 +43,10 @@ def option_parser(usage):
|
|||||||
dest="category", help="Set the category", default=' ')
|
dest="category", help="Set the category", default=' ')
|
||||||
parser.add_option('-o', '--output', action='store', default=None, \
|
parser.add_option('-o', '--output', action='store', default=None, \
|
||||||
help='Output file name. Default is derived from input filename')
|
help='Output file name. Default is derived from input filename')
|
||||||
|
parser.add_option('--title-sort', action='store', default='', dest='title_sort',
|
||||||
|
help='Sort key for the title')
|
||||||
|
parser.add_option('--author-sort', action='store', default='', dest='author_sort',
|
||||||
|
help='Sort key for the author')
|
||||||
return parser
|
return parser
|
||||||
|
|
||||||
def Book(font_delta=0, header=None, **settings):
|
def Book(font_delta=0, header=None, **settings):
|
||||||
|
@ -992,10 +992,6 @@ def main():
|
|||||||
parser.add_option('--dpi', action='store', type='int', default=166, dest='dpi',
|
parser.add_option('--dpi', action='store', type='int', default=166, dest='dpi',
|
||||||
help='''The DPI of the target device. Default is 166 for the
|
help='''The DPI of the target device. Default is 166 for the
|
||||||
Sony PRS 500''')
|
Sony PRS 500''')
|
||||||
parser.add_option('--title-sort', action='store', default='', dest='title_sort',
|
|
||||||
help='Sort key for the title')
|
|
||||||
parser.add_option('--author-sort', action='store', default='', dest='author_sort',
|
|
||||||
help='Sort key for the author')
|
|
||||||
options, args = parser.parse_args()
|
options, args = parser.parse_args()
|
||||||
if len(args) != 1:
|
if len(args) != 1:
|
||||||
parser.print_help()
|
parser.print_help()
|
||||||
|
@ -19,7 +19,7 @@ import os, sys
|
|||||||
|
|
||||||
from libprs500.lrf import ConversionError, option_parser
|
from libprs500.lrf import ConversionError, option_parser
|
||||||
from libprs500.lrf import Book
|
from libprs500.lrf import Book
|
||||||
from libprs500.lrf.pylrs.pylrs import Paragraph, Italic, Bold
|
from libprs500.lrf.pylrs.pylrs import Paragraph, Italic, Bold, BookSetting
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
@ -64,9 +64,12 @@ def convert_txt(path, options):
|
|||||||
header.append(Bold(options.title))
|
header.append(Bold(options.title))
|
||||||
header.append(' by ')
|
header.append(' by ')
|
||||||
header.append(Italic(options.author))
|
header.append(Italic(options.author))
|
||||||
book = Book(header=header, title=options.title, author=options.author, \
|
title = (options.title, options.title_sort)
|
||||||
|
author = (options.author, options.author_sort)
|
||||||
|
book = Book(header=header, title=title, author=author, \
|
||||||
sourceencoding=options.encoding, freetext=options.freetext, \
|
sourceencoding=options.encoding, freetext=options.freetext, \
|
||||||
category=options.category)
|
category=options.category, booksetting=BookSetting
|
||||||
|
(dpi=10*options.dpi,screenheight=800, screenwidth=600))
|
||||||
buffer = ''
|
buffer = ''
|
||||||
pg = book.create_page()
|
pg = book.create_page()
|
||||||
block = book.create_text_block()
|
block = book.create_text_block()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user