diff --git a/src/libprs500/ebooks/lrf/__init__.py b/src/libprs500/ebooks/lrf/__init__.py index c7e6bcba5e..c792407f8a 100644 --- a/src/libprs500/ebooks/lrf/__init__.py +++ b/src/libprs500/ebooks/lrf/__init__.py @@ -20,7 +20,8 @@ At the time fo writing, this package only supports reading and writing LRF meat from optparse import OptionParser, OptionValueError from libprs500.ebooks.lrf.pylrs.pylrs import Book as _Book -from libprs500.ebooks.lrf.pylrs.pylrs import TextBlock, Header, PutObj, Paragraph, TextStyle +from libprs500.ebooks.lrf.pylrs.pylrs import TextBlock, Header, PutObj, \ + Paragraph, TextStyle, BlockStyle from libprs500 import __version__ as VERSION __docformat__ = "epytext" @@ -82,7 +83,8 @@ def Book(font_delta=0, header=None, profile=PRS500_PROFILE, **settings): textheight=profile.page_height) if header: hdr = Header() - hb = TextBlock(textStyle=TextStyle(align='foot', fontsize=60)) + hb = TextBlock(textStyle=TextStyle(align='foot', fontsize=60), + blockStyle=BlockStyle(sidemargin=10)) hb.append(header) hdr.PutObj(hb) ps['headheight'] = 30 diff --git a/src/libprs500/ebooks/lrf/html/convert_from.py b/src/libprs500/ebooks/lrf/html/convert_from.py index 272a9dbf70..e0fa5aa0b7 100644 --- a/src/libprs500/ebooks/lrf/html/convert_from.py +++ b/src/libprs500/ebooks/lrf/html/convert_from.py @@ -1051,7 +1051,7 @@ def process_file(path, options): options.cover = os.path.abspath(os.path.expanduser(options.cover)) cpath = options.cover if os.access(options.cover, os.R_OK): - from libprs500.prs500 import PRS500 + from libprs500.devices.prs500.driver import PRS500 im = PILImage.open(os.path.join(cwd, cpath)) cim = im.resize((options.profile.screen_width, options.profile.screen_height), @@ -1088,7 +1088,7 @@ def process_file(path, options): header = Paragraph() header.append(Bold(options.title)) header.append(' by ') - header.append(Italic(options.author)) + header.append(Italic(options.author+" ")) book = Book(header=header, **args) le = re.compile(options.link_exclude) if options.link_exclude else \ re.compile('$') diff --git a/upload b/upload index 86e36ea239..ef83ac39a5 100644 --- a/upload +++ b/upload @@ -6,12 +6,12 @@ PREFIX=/var/www/vhosts/kovidgoyal.net/subdomains/libprs500 DOWNLOADS=$PREFIX/httpdocs/downloads DOCS=$PREFIX/httpdocs/apidocs exe=`cd dist && ls -1 libprs500-*.exe | tail -n1 && cd ..` +HTML2LRF=src/libprs500/ebooks/lrf/html/demo - -echo "
" > src/libprs500/lrf/html/demo/demo_ext.html -cat src/libprs500/lrf/html/demo/demo.html >> src/libprs500/lrf/html/demo/demo_ext.html -echo '' >> src/libprs500/lrf/html/demo/demo_ext.html -html2lrf --title='Demonstration of html2lrf' --author='Kovid Goyal' --header --output=/tmp/html2lrf.lrf src/libprs500/lrf/html/demo/demo.html +echo "
" > ${HTML2LRF}/demo_ext.html +cat ${HTML2LRF}/demo.html >> ${HTML2LRF}/demo_ext.html +echo '' >> ${HTML2LRF}/demo_ext.html +html2lrf --title='Demonstration of html2lrf' --author='Kovid Goyal' --header --output=/tmp/html2lrf.lrf ${HTML2LRF}/demo.html scp /tmp/html2lrf.lrf castalia:$DOWNLOADS/ ssh castalia rm -f $DOWNLOADS/libprs500\*.exe