mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix handling of empty rows. Add option to disable autorotation.
This commit is contained in:
parent
2a83e24aa7
commit
7a21b56f22
31
setup.py
31
setup.py
@ -13,7 +13,7 @@
|
|||||||
## with this program; if not, write to the Free Software Foundation, Inc.,
|
## with this program; if not, write to the Free Software Foundation, Inc.,
|
||||||
## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
import sys, re
|
import sys, re, os, shutil
|
||||||
sys.path.append('src')
|
sys.path.append('src')
|
||||||
from libprs500 import __version__ as VERSION
|
from libprs500 import __version__ as VERSION
|
||||||
|
|
||||||
@ -21,13 +21,13 @@ import ez_setup
|
|||||||
ez_setup.use_setuptools()
|
ez_setup.use_setuptools()
|
||||||
from setuptools import setup, find_packages
|
from setuptools import setup, find_packages
|
||||||
|
|
||||||
|
|
||||||
################################# py2exe #######################################
|
################################# py2exe #######################################
|
||||||
py2exe_options = {}
|
py2exe_options = {}
|
||||||
if sys.argv[1] == 'py2exe':
|
if sys.argv[1] == 'py2exe':
|
||||||
py2exe_dir = 'C:\libprs500'
|
py2exe_dir = 'c:\libprs500'
|
||||||
|
fonts = ['src/libprs500/ebooks/lrf/fonts/prs500']
|
||||||
try:
|
try:
|
||||||
import py2exe
|
import py2exe, glob
|
||||||
console = [
|
console = [
|
||||||
{'script' : 'src/libprs500/devices/prs500/cli/main.py', 'dest_base':'prs500'},
|
{'script' : 'src/libprs500/devices/prs500/cli/main.py', 'dest_base':'prs500'},
|
||||||
{'script' : 'src/libprs500/ebooks/lrf/html/convert_from.py', 'dest_base':'html2lrf'},
|
{'script' : 'src/libprs500/ebooks/lrf/html/convert_from.py', 'dest_base':'html2lrf'},
|
||||||
@ -45,6 +45,20 @@ if sys.argv[1] == 'py2exe':
|
|||||||
'excludes' : excludes}}
|
'excludes' : excludes}}
|
||||||
py2exe_options = {'console' : console, 'windows' : windows,
|
py2exe_options = {'console' : console, 'windows' : windows,
|
||||||
'options' : options}
|
'options' : options}
|
||||||
|
|
||||||
|
dest_dir = py2exe_dir + '\\fonts\\'
|
||||||
|
if os.path.exists(dest_dir):
|
||||||
|
shutil.rmtree(dest_dir, True)
|
||||||
|
from distutils.filelist import FileList
|
||||||
|
fl = FileList()
|
||||||
|
fl.include_pattern('^src.*\.ttf$', is_regex=True)
|
||||||
|
fl.findall()
|
||||||
|
|
||||||
|
for file in fl.files:
|
||||||
|
dir = dest_dir + os.path.basename(os.path.dirname(file))
|
||||||
|
if not os.path.exists(dir):
|
||||||
|
os.makedirs(dir)
|
||||||
|
shutil.copy(file, dir)
|
||||||
except ImportError:
|
except ImportError:
|
||||||
print >>sys.stderr, 'Must be in Windows to run py2exe'
|
print >>sys.stderr, 'Must be in Windows to run py2exe'
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
@ -255,7 +269,11 @@ setup(
|
|||||||
author='Kovid Goyal',
|
author='Kovid Goyal',
|
||||||
author_email='kovid@kovidgoyal.net',
|
author_email='kovid@kovidgoyal.net',
|
||||||
url = 'http://libprs500.kovidgoyal.net',
|
url = 'http://libprs500.kovidgoyal.net',
|
||||||
package_data = { 'libprs500.ebooks' : ['*.jpg', '*.pl'], },
|
package_data = {
|
||||||
|
'libprs500.ebooks' : ['*.jpg', '*.pl'],
|
||||||
|
'libpre500.ebooks.lrf.fonts' : ['*.ttf'],
|
||||||
|
},
|
||||||
|
include_package_data = True,
|
||||||
entry_points = {
|
entry_points = {
|
||||||
'console_scripts': [ \
|
'console_scripts': [ \
|
||||||
'prs500 = libprs500.devices.prs500.cli.main:main', \
|
'prs500 = libprs500.devices.prs500.cli.main:main', \
|
||||||
@ -270,8 +288,7 @@ setup(
|
|||||||
install_requires = ['sqlalchemy >= 0.3.7'],
|
install_requires = ['sqlalchemy >= 0.3.7'],
|
||||||
description =
|
description =
|
||||||
"""
|
"""
|
||||||
Library to interface with the Sony Portable Reader 500
|
Ebook management application.
|
||||||
over USB. Also has a GUI with library management features.
|
|
||||||
""",
|
""",
|
||||||
long_description =
|
long_description =
|
||||||
"""
|
"""
|
||||||
|
@ -33,7 +33,7 @@ You may have to adjust the GROUP and the location of the rules file to
|
|||||||
suit your distribution.
|
suit your distribution.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
__version__ = "0.3.34"
|
__version__ = "0.3.35"
|
||||||
__docformat__ = "epytext"
|
__docformat__ = "epytext"
|
||||||
__author__ = "Kovid Goyal <kovid@kovidgoyal.net>"
|
__author__ = "Kovid Goyal <kovid@kovidgoyal.net>"
|
||||||
|
|
||||||
|
@ -193,6 +193,8 @@ class Row(object):
|
|||||||
width = sum(widths[i:i+cell.colspan])
|
width = sum(widths[i:i+cell.colspan])
|
||||||
heights.append(cell.height(width))
|
heights.append(cell.height(width))
|
||||||
i += cell.colspan
|
i += cell.colspan
|
||||||
|
if not heights:
|
||||||
|
return 0
|
||||||
return max(heights)
|
return max(heights)
|
||||||
|
|
||||||
def preferred_width(self, col):
|
def preferred_width(self, col):
|
||||||
@ -205,7 +207,8 @@ class Row(object):
|
|||||||
i += 1
|
i += 1
|
||||||
if i == col:
|
if i == col:
|
||||||
break
|
break
|
||||||
|
if not cell:
|
||||||
|
return 0
|
||||||
return 0 if cell.colspan > 1 else cell.preferred_width()
|
return 0 if cell.colspan > 1 else cell.preferred_width()
|
||||||
|
|
||||||
def cell_iterator(self):
|
def cell_iterator(self):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user