diff --git a/src/libprs500/__init__.py b/src/libprs500/__init__.py index 96a417cbfc..01e4bc8f6f 100644 --- a/src/libprs500/__init__.py +++ b/src/libprs500/__init__.py @@ -13,7 +13,7 @@ ## with this program; if not, write to the Free Software Foundation, Inc., ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. ''' E-book management software''' -__version__ = "0.3.46" +__version__ = "0.3.47" __docformat__ = "epytext" __author__ = "Kovid Goyal " diff --git a/src/libprs500/devices/__init__.py b/src/libprs500/devices/__init__.py index a37a0ddab9..5391abc7c1 100644 --- a/src/libprs500/devices/__init__.py +++ b/src/libprs500/devices/__init__.py @@ -13,5 +13,5 @@ ## with this program; if not, write to the Free Software Foundation, Inc., ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. ''' -Device drivers -''' \ No newline at end of file +Device drivers. +''' diff --git a/src/libprs500/devices/interface.py b/src/libprs500/devices/interface.py index c0ea879e78..c20ea429b0 100644 --- a/src/libprs500/devices/interface.py +++ b/src/libprs500/devices/interface.py @@ -44,6 +44,11 @@ class Device(object): """ raise NotImplementedError() + @classmethod + def is_connected(cls): + '''Return True iff the device is physically connected to the computer''' + raise NotImplementedError() + def get_device_information(self, end_session=True): """ Ask device for device information. See L{DeviceInfoQuery}. diff --git a/src/libprs500/ebooks/lrf/__init__.py b/src/libprs500/ebooks/lrf/__init__.py index 1d53413ac5..97a3945bbe 100644 --- a/src/libprs500/ebooks/lrf/__init__.py +++ b/src/libprs500/ebooks/lrf/__init__.py @@ -106,8 +106,8 @@ def Book(options, font_delta=0, header=None, ps['header'] = hdr ps['topmargin'] = 10 ps['textheight'] = profile.screen_height - (options.bottom_margin + ps['topmargin']) - profile.fudge - baselineskip = (12 + 2*font_delta)*10 - return _Book(textstyledefault=dict(fontsize=100+font_delta*20, + baselineskip = 120 + int(20*font_delta) + return _Book(textstyledefault=dict(fontsize=100+int(font_delta*20), parindent=80, linespace=12, baselineskip=baselineskip), \ pagestyledefault=ps, **settings) \ No newline at end of file diff --git a/src/libprs500/ebooks/lrf/html/convert_from.py b/src/libprs500/ebooks/lrf/html/convert_from.py index 9ace1fcc99..fe675fd01e 100644 --- a/src/libprs500/ebooks/lrf/html/convert_from.py +++ b/src/libprs500/ebooks/lrf/html/convert_from.py @@ -124,7 +124,7 @@ class Span(_Span): elif "large" in val >= 0: ans = 120 if ans is not None: - ans += font_delta * 20 + ans += int(font_delta * 20) ans = str(ans) return ans @@ -1222,9 +1222,9 @@ def parse_options(argv=None, cli=True): laf = parser.add_option_group('LOOK AND FEEL') laf.add_option('--cover', action='store', dest='cover', default=None, \ help='Path to file containing image to be used as cover') - laf.add_option('--font-delta', action='store', type='int', default=0, \ + laf.add_option('--font-delta', action='store', type='float', default=0., \ help="""Increase the font size by 2 * FONT_DELTA pts and """ - '''the line spacing by FONT_DELTA pts. ''' + '''the line spacing by FONT_DELTA pts. FONT_DELTA can be a fraction.''' """If FONT_DELTA is negative, the font size is decreased.""", dest='font_delta') laf.add_option('--disable-autorotation', action='store_true', default=False, @@ -1266,7 +1266,7 @@ def parse_options(argv=None, cli=True): parser.print_help() raise ConversionError, 'no filename specified' if options.output: - options.output = os.path.abspath(os.path.expanduser(options.output)) + options.output = os.path.abspath(os.path.expanduser(options.output)) return options, args, parser diff --git a/upload b/upload index 15a287c83b..666fb0b443 100644 --- a/upload +++ b/upload @@ -43,15 +43,15 @@ f.write(open(os.path.join(HTML2LRF, 'demo.html')).read()) f.write('\n') f.close() - + check_call('''html2lrf --title='Demonstration of html2lrf' --author='Kovid Goyal' --header --output=/tmp/html2lrf.lrf %s/demo.html'''%(HTML2LRF,)) check_call('''scp /tmp/html2lrf.lrf castalia:%s/'''%(DOWNLOADS,)) -check_call('''python setup.py register sdist bdist_egg upload''') check_call('''ssh castalia rm -f %s/libprs500\*.exe'''%(DOWNLOADS,)) check_call('''scp dist/%s castalia:%s/'''%(exe, DOWNLOADS)) check_call('''ssh castalia chmod a+r %s/\*'''%(DOWNLOADS,)) check_call('''ssh castalia /root/bin/update-installer-link %s'''%(exe,)) +check_call('''python setup.py register sdist bdist_egg upload''') check_call('''epydoc --config epydoc.conf''') check_call('''scp -r docs/html castalia:%s/'''%(DOCS,))