Hello community,
here is the log from the commit of package python-xlwt for openSUSE:Factory checked in at 2013-09-23 10:59:36
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-xlwt (Old)
and /work/SRC/openSUSE:Factory/.python-xlwt.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-xlwt"
Changes:
--------
--- /work/SRC/openSUSE:Factory/python-xlwt/python-xlwt.changes 2013-01-02 13:00:57.000000000 +0100
+++ /work/SRC/openSUSE:Factory/.python-xlwt.new/python-xlwt.changes 2013-09-23 11:17:56.000000000 +0200
@@ -1,0 +2,6 @@
+Wed Sep 18 14:02:35 UTC 2013 - idonmez@suse.com
+
+- Update to version 0.7.5
+ * No changelog provided upstream
+
+-------------------------------------------------------------------
Old:
----
xlwt-0.7.4.tar.gz
New:
----
xlwt-0.7.5.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-xlwt.spec ++++++
--- /var/tmp/diff_new_pack.DDWZyQ/_old 2013-09-23 11:17:56.000000000 +0200
+++ /var/tmp/diff_new_pack.DDWZyQ/_new 2013-09-23 11:17:56.000000000 +0200
@@ -1,7 +1,7 @@
#
# spec file for package python-xlwt
#
-# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany.
+# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -11,12 +11,13 @@
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
-#
+
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
+
Name: python-xlwt
-Version: 0.7.4
+Version: 0.7.5
Release: 0
Url: https://secure.simplistix.co.uk/svn/xlwt/trunk
Summary: Library to Create Spreadsheet Files Compatible With MS Excel 97/2000/XP/2003
++++++ xlwt-0.7.4.tar.gz -> xlwt-0.7.5.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xlwt-0.7.4/PKG-INFO new/xlwt-0.7.5/PKG-INFO
--- old/xlwt-0.7.4/PKG-INFO 2012-04-13 11:55:57.000000000 +0200
+++ new/xlwt-0.7.5/PKG-INFO 2013-04-06 02:05:28.000000000 +0200
@@ -1,8 +1,8 @@
Metadata-Version: 1.0
Name: xlwt
-Version: 0.7.4
+Version: 0.7.5
Summary: Library to create spreadsheet files compatible with MS Excel 97/2000/XP/2003 XLS files, on any platform, with Python 2.3 to 2.7
-Home-page: https://secure.simplistix.co.uk/svn/xlwt/trunk
+Home-page: http://www.python-excel.org/
Author: John Machin
Author-email: sjmachin@lexicon.net
License: BSD
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xlwt-0.7.4/licences.py new/xlwt-0.7.5/licences.py
--- old/xlwt-0.7.4/licences.py 2011-10-21 12:19:05.000000000 +0200
+++ new/xlwt-0.7.5/licences.py 2012-06-29 21:51:19.000000000 +0200
@@ -80,3 +80,35 @@
Subject: pyExcelerator
"""
+
+"""
+Portions of xlwt.Utils based on:
+pyXLWriter - A library for generating Excel Spreadsheets
+
+The licensing of pyXLWriter is as follows:
+
+ Copyright (c) 2004 Evgeny Filatov
+ Copyright (c) 2002-2004 John McNamara (Perl Spreadsheet::WriteExcel)
+
+ This library is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 2.1 of the License, or
+ (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
+ General Public License for more details:
+
+ http://www.gnu.org/licenses/lgpl.html
+
+ pyXLWriter also makes reference to the PERL Spreadsheet::WriteExcel as follows:
+
+ ----------------------------------------------------------------------------
+ This module was written/ported from PERL Spreadsheet::WriteExcel module
+ The author of the PERL Spreadsheet::WriteExcel module is John McNamara
+
+ ----------------------------------------------------------------------------
+
+"""
+
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xlwt-0.7.4/setup.py new/xlwt-0.7.5/setup.py
--- old/xlwt-0.7.4/setup.py 2012-04-13 11:55:28.000000000 +0200
+++ new/xlwt-0.7.5/setup.py 2013-04-05 00:50:09.000000000 +0200
@@ -33,17 +33,13 @@
'xls excel spreadsheet workbook worksheet pyExcelerator'
)
-SVN_URL = 'https://secure.simplistix.co.uk/svn/xlwt/trunk'
-
-DOWNLOAD_URL = 'http://pypi.python.org/pypi/xlwt'
-
setup(
name = 'xlwt',
version = __VERSION__,
maintainer = 'John Machin',
maintainer_email = 'sjmachin@lexicon.net',
- url = SVN_URL,
- download_url = DOWNLOAD_URL,
+ url = 'http://www.python-excel.org/',
+ download_url = 'http://pypi.python.org/pypi/xlwt',
description = DESCRIPTION,
long_description = LONG_DESCRIPTION,
license = 'BSD',
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xlwt-0.7.4/xlwt/BIFFRecords.py new/xlwt-0.7.5/xlwt/BIFFRecords.py
--- old/xlwt-0.7.4/xlwt/BIFFRecords.py 2012-03-05 08:47:19.000000000 +0100
+++ new/xlwt-0.7.5/xlwt/BIFFRecords.py 2013-04-06 01:50:21.000000000 +0200
@@ -1,7 +1,6 @@
# -*- coding: cp1252 -*-
from struct import pack
from UnicodeUtils import upack1, upack2, upack2rt
-import sys
class SharedStringTable(object):
_SST_ID = 0x00FC
@@ -187,7 +186,6 @@
def get(self):
# data = self.get_rec_data()
data = self._rec_data
-
if len(data) > 0x2020: # limit for BIFF7/8
chunks = []
pos = 0
@@ -1075,6 +1073,15 @@
"""
_REC_ID = 0x0092
+ def __init__(self, custom_palette):
+ n_colours = len(custom_palette)
+ assert n_colours == 56
+ # Pack number of colors with little-endian, what xlrd and excel expect.
+ self._rec_data = pack('>>The Known Token Types <<<
SKIP = antlr.SKIP
INVALID_TYPE = antlr.INVALID_TYPE
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xlwt-0.7.4/xlwt/Style.py new/xlwt-0.7.5/xlwt/Style.py
--- old/xlwt-0.7.4/xlwt/Style.py 2012-03-05 08:47:19.000000000 +0100
+++ new/xlwt-0.7.5/xlwt/Style.py 2013-04-05 00:49:23.000000000 +0200
@@ -371,6 +371,92 @@
colour_map[_name.replace('gray', 'grey')] = _num
del _colour_map_text, _line, _name, _num
+def add_palette_colour(colour_str, colour_index):
+ if not (8 <= colour_index <= 63):
+ raise Exception("add_palette_colour: colour_index (%d) not in range(8, 64)" %
+ (colour_index))
+ colour_map[colour_str] = colour_index
+
+# user-defined palette defines 56 RGB colors from entry 8 - 64
+#excel_default_palette_b8 = [ # (red, green, blue)
+# ( 0, 0, 0), (255,255,255), (255, 0, 0), ( 0,255, 0),
+# ( 0, 0,255), (255,255, 0), (255, 0,255), ( 0,255,255),
+# (128, 0, 0), ( 0,128, 0), ( 0, 0,128), (128,128, 0),
+# (128, 0,128), ( 0,128,128), (192,192,192), (128,128,128),
+# (153,153,255), (153, 51,102), (255,255,204), (204,255,255),
+# (102, 0,102), (255,128,128), ( 0,102,204), (204,204,255),
+# ( 0, 0,128), (255, 0,255), (255,255, 0), ( 0,255,255),
+# (128, 0,128), (128, 0, 0), ( 0,128,128), ( 0, 0,255),
+# ( 0,204,255), (204,255,255), (204,255,204), (255,255,153),
+# (153,204,255), (255,153,204), (204,153,255), (255,204,153),
+# ( 51,102,255), ( 51,204,204), (153,204, 0), (255,204, 0),
+# (255,153, 0), (255,102, 0), (102,102,153), (150,150,150),
+# ( 0, 51,102), ( 51,153,102), ( 0, 51, 0), ( 51, 51, 0),
+# (153, 51, 0), (153, 51,102), ( 51, 51,153), ( 51, 51, 51),
+# ]
+
+# Default colour table for BIFF8 copied from
+# OpenOffice.org's Documentation of the Microsoft Excel File Format, Excel Version 2003
+# Note palette has LSB padded with 2 bytes 0x00
+excel_default_palette_b8 = (
+0x00000000,
+0xFFFFFF00,
+0xFF000000,
+0x00FF0000,
+0x0000FF00,
+0xFFFF0000,
+0xFF00FF00,
+0x00FFFF00,
+0x80000000,
+0x00800000,
+0x00008000,
+0x80800000,
+0x80008000,
+0x00808000,
+0xC0C0C000,
+0x80808000,
+0x9999FF00,
+0x99336600,
+0xFFFFCC00,
+0xCCFFFF00,
+0x66006600,
+0xFF808000,
+0x0066CC00,
+0xCCCCFF00,
+0x00008000,
+0xFF00FF00,
+0xFFFF0000,
+0x00FFFF00,
+0x80008000,
+0x80000000,
+0x00808000,
+0x0000FF00,
+0x00CCFF00,
+0xCCFFFF00,
+0xCCFFCC00,
+0xFFFF9900,
+0x99CCFF00,
+0xFF99CC00,
+0xCC99FF00,
+0xFFCC9900,
+0x3366FF00,
+0x33CCCC00,
+0x99CC0000,
+0xFFCC0000,
+0xFF990000,
+0xFF660000,
+0x66669900,
+0x96969600,
+0x00336600,
+0x33996600,
+0x00330000,
+0x33330000,
+0x99330000,
+0x99336600,
+0x33339900,
+0x33333300)
+
+assert len(excel_default_palette_b8) == 56
pattern_map = {
# Text values for pattern.pattern
@@ -483,8 +569,8 @@
'left_color': 'left_colour',
'right_color': 'right_colour',
'diag_color': 'diag_colour',
- 'need_diag_1': bool_map,
- 'need_diag_2': bool_map,
+ 'need_diag1': bool_map,
+ 'need_diag2': bool_map,
},
'font': {
'bold': bool_map,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xlwt-0.7.4/xlwt/UnicodeUtils.py new/xlwt-0.7.5/xlwt/UnicodeUtils.py
--- old/xlwt-0.7.4/xlwt/UnicodeUtils.py 2012-03-05 08:47:19.000000000 +0100
+++ new/xlwt-0.7.5/xlwt/UnicodeUtils.py 2013-04-05 00:49:23.000000000 +0200
@@ -58,36 +58,49 @@
# Success here means all chars are in U+0000 to U+00FF
# inclusive, meaning that we can use "compressed format".
flag = 0
+ n_items = len_us
except UnicodeEncodeError:
encs = us.encode('utf_16_le')
flag = 1
- return pack(' 1 on a wide-unicode build
+ # and 2 on a narrow-unicode build.
+ # We need n_items == 2 in this case.
+ return pack(' 32767:
+ for s, fontx in rt:
+ if not isinstance(s, unicode):
+ s = unicode(s, encoding)
+ us += s
+ if fontx is not None:
+ # code in Rows.py ensures that
+ # fontx can be None only for the first piece
+ fr += pack(' 32767:
raise Exception('String longer than 32767 characters')
try:
encs = us.encode('latin1')
# Success here means all chars are in U+0000 to U+00FF
# inclusive, meaning that we can use "compressed format".
flag = 0 | 8
+ n_items = len(encs)
except UnicodeEncodeError:
encs = us.encode('utf_16_le')
flag = 1 | 8
- return pack('
-# Copyright (c) 2002-2004 John McNamara (Perl Spreadsheet::WriteExcel)
-#
-# This library is free software; you can redistribute it and/or modify it
-# under the terms of the GNU Lesser General Public License as published by
-# the Free Software Foundation; either version 2.1 of the License, or
-# (at your option) any later version.
-#
-# This library is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
-# General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public License
-# along with this library; if not, write to the Free Software Foundation,
-# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-#----------------------------------------------------------------------------
-# This module was written/ported from PERL Spreadsheet::WriteExcel module
-# The author of the PERL Spreadsheet::WriteExcel module is John McNamara
-#
-#----------------------------------------------------------------------------
-# See the README.txt distributed with pyXLWriter for more details.
-
-# Portions are (C) Roman V. Kiseliov, 2005
-
+# see the xlwt.license module for details of licensing.
# Utilities for work with reference to cells and with sheetnames
-
-__rev_id__ = """$Id$"""
-
import re
from ExcelMagic import MAX_ROW, MAX_COL
-
_re_cell_ex = re.compile(r"(\$?)([A-I]?[A-Z])(\$?)(\d+)", re.IGNORECASE)
_re_row_range = re.compile(r"\$?(\d+):\$?(\d+)")
_re_col_range = re.compile(r"\$?([A-I]?[A-Z]):\$?([A-I]?[A-Z])", re.IGNORECASE)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xlwt-0.7.4/xlwt/Workbook.py new/xlwt-0.7.5/xlwt/Workbook.py
--- old/xlwt-0.7.4/xlwt/Workbook.py 2012-03-05 08:47:19.000000000 +0100
+++ new/xlwt-0.7.5/xlwt/Workbook.py 2013-04-05 00:49:23.000000000 +0200
@@ -61,6 +61,7 @@
self.__vpos_twips = 0x005A
self.__width_twips = 0x3FCF
self.__height_twips = 0x2A4E
+ self.__custom_palette_b8 = None
self.__active_sheet = 0
self.__first_tab_index = 0
@@ -295,6 +296,22 @@
default_style = property(get_default_style)
+ #################################################################
+
+ def set_colour_RGB(self, colour_index, red, green, blue):
+ if not(8 <= colour_index <= 63):
+ raise Exception("set_colour_RGB: colour_index (%d) not in range(8, 64)" %
+ colour_index)
+ if min(red, green, blue) < 0 or max(red, green, blue) > 255:
+ raise Exception("set_colour_RGB: colour values (%d,%d,%d) must be in range(0, 256)"
+ % (red, green, blue))
+ if self.__custom_palette_b8 is None:
+ self.__custom_palette_b8 = list(Style.excel_default_palette_b8)
+ # User-defined Palette starts at colour index 8,
+ # so subtract 8 from colour_index when placing in palette
+ palette_index = colour_index - 8
+ self.__custom_palette_b8[palette_index] = red << 24 | green << 16 | blue << 8
+
##################################################################
## Methods
##################################################################
@@ -516,8 +533,10 @@
return self.__styles.get_biff_data()
def __palette_rec(self):
- result = ''
- return result
+ if self.__custom_palette_b8 is None:
+ return ''
+ info = BIFFRecords.PaletteRecord(self.__custom_palette_b8).get()
+ return info
def __useselfs_rec(self):
return BIFFRecords.UseSelfsRecord().get()
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xlwt-0.7.4/xlwt/Worksheet.py new/xlwt-0.7.5/xlwt/Worksheet.py
--- old/xlwt-0.7.4/xlwt/Worksheet.py 2012-03-05 08:47:19.000000000 +0100
+++ new/xlwt-0.7.5/xlwt/Worksheet.py 2013-04-06 01:40:31.000000000 +0200
@@ -36,12 +36,10 @@
import BIFFRecords
import Bitmap
-import Formatting
import Style
import tempfile
class Worksheet(object):
- from Workbook import Workbook
# a safe default value, 3 is always valid!
active_pane = 3
@@ -1208,6 +1206,16 @@
self.__vert_split_first_visible = self.__vert_split_pos
if self.__horz_split_first_visible is None:
self.__horz_split_first_visible = self.__horz_split_pos
+
+ # when frozen, the active pane has to be specifically set:
+ if self.__vert_split_pos > 0 and self.__horz_split_pos > 0:
+ active_pane = 0
+ elif self.__vert_split_pos > 0 and self.__horz_split_pos == 0:
+ active_pane = 1
+ elif self.__vert_split_pos == 0 and self.__horz_split_pos > 0:
+ active_pane = 2
+ else:
+ active_pane = 3
else:
if self.__vert_split_first_visible is None:
self.__vert_split_first_visible = 0
@@ -1220,12 +1228,15 @@
if self.__vert_split_pos > 0:
self.__vert_split_pos = 113.879 * self.__vert_split_pos + 390
+ # when split, the active pain can be set as required:
+ active_pane = self.active_pane
+
result = BIFFRecords.PanesRecord(*map(int, (
self.__vert_split_pos,
self.__horz_split_pos,
self.__horz_split_first_visible,
self.__vert_split_first_visible,
- self.active_pane
+ active_pane
))).get()
return result
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xlwt-0.7.4/xlwt/__init__.py new/xlwt-0.7.5/xlwt/__init__.py
--- old/xlwt-0.7.4/xlwt/__init__.py 2012-04-13 11:55:28.000000000 +0200
+++ new/xlwt-0.7.5/xlwt/__init__.py 2013-04-06 02:03:24.000000000 +0200
@@ -1,16 +1,9 @@
-# -*- coding: windows-1252 -*-
-
-__VERSION__ = '0.7.4'
-
-import sys
-if sys.version_info[:2] < (2, 3):
- print >> sys.stderr, "Sorry, xlwt requires Python 2.3 or later"
- sys.exit(1)
+__VERSION__ = '0.7.5'
from Workbook import Workbook
from Worksheet import Worksheet
from Row import Row
from Column import Column
from Formatting import Font, Alignment, Borders, Pattern, Protection
-from Style import XFStyle, easyxf, easyfont
+from Style import XFStyle, easyxf, easyfont, add_palette_colour
from ExcelFormula import *
--
To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit+help@opensuse.org