Skip to content

Commit ba4f501

Browse files
committed
- 更改依赖版本以及格式有问题的地方
Signed-off-by: tinybees <[email protected]>
1 parent c47a080 commit ba4f501

File tree

7 files changed

+43
-27
lines changed

7 files changed

+43
-27
lines changed

CHANGES.md

Lines changed: 31 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,39 @@
11
## tabdoc changelog
22

3+
###[1.0.6] - 2024-08-19
4+
5+
#### Changed
6+
7+
- 更改依赖版本以及格式有问题的地方
8+
39
###[1.0.4] - 2023-06-16
410

5-
#### Changed
6-
- 更改模板增加新的用于图片显示的居中样式并且应用到添加图片中
11+
#### Changed
712

13+
- 更改模板增加新的用于图片显示的居中样式并且应用到添加图片中
814

915
###[1.0.3] - 2023-05-03
1016

11-
#### Added
17+
#### Added
18+
1219
- 新增添加表格时可以单独设置每个单元格的值、背景颜色和水平对齐方式功能
1320
- 新增添加表格时可以单独设置表格中的行的背景颜色的功能
1421
- 新增添加表格时可以设置单元格边框的功能(未测试)
1522
- 新增添加表格时可以设置单元格内容字号的功能(默认字号10号)
1623
- 新增添加表格时可以设置单元格内容是否加粗
1724
- 新增以行列固定数量添加表格的功能
1825

19-
2026
###[1.0.2] - 2023-04-28
2127

22-
#### Changed
28+
#### Changed
29+
2330
- 修复tabexcel中的一些版本太低造成的格式问题
2431
- 修复tabword中添加图片时如果图片路径不存在导致的报错问题
2532

26-
2733
###[1.0.0b9] - 2019-10-9
2834

29-
#### Added
35+
#### Added
36+
3037
- 增加excel合并单元格功能
3138
- 增加excel合并单元格后左右上下居中的功能
3239
- 增加支持导出样式功能,包括颜色,对其方式等功能
@@ -39,33 +46,39 @@
3946

4047
###[1.0.0b8] - 2019-07-31
4148

42-
#### Changed
49+
#### Changed
50+
4351
- 处理excel中如果多个工作表有重名的则生成报错的问题,会按照重名的数量添加序号
4452

4553
###[1.0.0b7] - 2019-07-31
4654

47-
#### Changed
55+
#### Changed
56+
4857
- 处理PDF中添加表格数据为空的情况,增加默认的空字符串数据
4958
- 处理excel中添加数据为空的情况,增加默认的空字符串数据
5059

5160
###[1.0.0b6] - 2019-07-31
5261

53-
#### Changed
62+
#### Changed
63+
5464
- 解决如果写入表格时如果列数超过36列,造成行高大于一页的的高度而报错的问题,
55-
暂时的解决办法是把数据进行截断为最大36列
65+
暂时的解决办法是把数据进行截断为最大36列
5666

5767
###[1.0.0b5] - 2019-07-25
5868

59-
#### Added
69+
#### Added
70+
6071
- 增加水印的功能
6172

62-
#### Changed
73+
#### Changed
74+
6375
- 解决表格列多的时候,列宽超过页面宽度造成截断的问题
6476
- 解决表格内文字不自动换行,出了单元格边界的问题
6577

6678
###[1.0.0b4] - 2019-07-25
6779

68-
#### Added
80+
#### Added
81+
6982
- 增加PDFWriter模块,方便的创建PDF文档
7083
- 增加PDF中上下文管理的功能
7184
- 增加PDF中添加标题的功能
@@ -75,12 +88,14 @@
7588

7689
###[1.0.0b3] - 2019-04-11
7790

78-
#### Changed
91+
#### Changed
92+
7993
- 更改setup.py文件,修改依赖缺失的问题
8094

8195
###[1.0.0b1] - 2019-03-20
8296

83-
#### Added
97+
#### Added
98+
8499
- 增加excel的上下文管理器
85100
- 增加excel中添加多个工作表的功能
86101
- 增加excel中保存工作薄的功能

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
path.py>=11.5
1+
path<=16.2.0
22
aelog>=1.0.3
33
tablib>=0.12.1
44
python-docx>=0.8.10

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
entry_points={},
4242
install_requires=['tablib>=0.12.1',
4343
'python-docx>=0.8.10',
44-
'path.py>=11.5',
44+
'path<=16.2.0',
4545
'aelog>=1.0.3',
4646
'reportlab<=3.5.68',
4747
'openpyxl>=2.4.11,<=3.1.5'],

tabdoc/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
@time: 19-3-20 下午6:29
88
"""
99

10-
__version__ = "1.0.5"
10+
__version__ = "1.0.6"
1111

1212
from .tabexcel import *
1313
from .tabpdf import *

tabdoc/tabexcel.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,9 @@
66
@software: PyCharm
77
@time: 19-2-11 下午6:14
88
"""
9-
from collections import Counter, MutableMapping, Sequence
9+
from collections import Counter
1010
from io import BytesIO
11+
from typing import MutableMapping, Sequence
1112

1213
import tablib
1314
from openpyxl import Workbook

tabdoc/tabpdf.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
@software: PyCharm
77
@time: 19-2-11 下午6:14
88
"""
9-
from collections import MutableMapping, Sequence
9+
from typing import MutableMapping, Sequence
1010

1111
from path import Path
1212
from reportlab.lib import colors
@@ -167,17 +167,16 @@ def add_paragraph(self, paragraph_text, alignment="left"):
167167
self.story.append(Paragraph(paragraph_text, styles))
168168
self.story.append(Spacer(1, 0.15 * inch))
169169

170+
# noinspection PyUnusedLocal
170171
def add_table(self, table_data: list, table_name=None, data_align='CENTER', table_halign='CENTER',
171172
cell_styles: list = None, is_landscape=False):
172173
"""
173174
为pdf添加表格数据
174175
Args:
175176
table_name: 表格的名称
176177
table_data: 表格的数据, 必须是列表中嵌套元祖、列表或者字典(从records查询出来的数据库的数据)
177-
data_align: The alignment of the data inside the table (eg.
178-
'LEFT', 'CENTER', 'RIGHT')
179-
table_halign: Horizontal alignment of the table on the page
180-
(eg. 'LEFT', 'CENTER', 'RIGHT')
178+
data_align: The alignment of the data inside the table ('LEFT', 'CENTER', 'RIGHT')
179+
table_halign: Horizontal alignment of the table on the page('LEFT', 'CENTER', 'RIGHT')
181180
cell_styles: 每个单元格样式
182181
is_landscape: 是否横向展示,默认false
183182
Returns:

tabdoc/tabword.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,8 @@
66
@software: PyCharm
77
@time: 19-2-11 下午6:14
88
"""
9-
from collections import MutableSequence
109
from itertools import zip_longest
11-
from typing import Any, List, Optional, Tuple, Union
10+
from typing import Any, List, MutableSequence, Optional, Tuple, Union
1211

1312
from docx import Document, document, table
1413
from docx.enum.table import WD_CELL_VERTICAL_ALIGNMENT, WD_ROW_HEIGHT_RULE, WD_TABLE_ALIGNMENT
@@ -103,6 +102,7 @@ def _reduce_datetimes(row):
103102
row[i] = val.isoformat()
104103
return tuple(row)
105104

105+
# noinspection DuplicatedCode
106106
def add_table(self, header_name: str, header_data: List[List[Union[ValueAttr, str]]],
107107
table_data: List[List[Union[ValueAttr, str]]],
108108
merge_cells: List[Tuple[Tuple[int, int], Tuple[int, int]]] = None,
@@ -177,6 +177,7 @@ def add_table(self, header_name: str, header_data: List[List[Union[ValueAttr, st
177177

178178
self.document.add_paragraph() # 增加一个空行的段落
179179

180+
# noinspection DuplicatedCode
180181
def add_table2(self, header_name: str, rows_cols: Tuple[int, int],
181182
table_data: List[List[Union[ValueAttr, str]]],
182183
merge_cells: List[Tuple[Tuple[int, int], Tuple[int, int]]] = None,

0 commit comments

Comments
 (0)