@@ -779,7 +779,7 @@ def add_comment(self, sheet: str, opts: Comment) -> None:
779
779
780
780
def add_form_control (self , sheet : str , opts : FormControl ) -> None :
781
781
"""
782
- Add form control button in a worksheet by given worksheet name and form
782
+ Add form control object in a worksheet by given worksheet name and form
783
783
control options. Supported form control type: button, check box, group
784
784
box, label, option button, scroll bar and spinner. If set macro for the
785
785
form control, the workbook extension should be XLSM or XLTM. Scroll
@@ -1554,8 +1554,8 @@ def get_app_props(self) -> Optional[AppProperties]:
1554
1554
Get document application properties.
1555
1555
1556
1556
Returns:
1557
- Optional[AppProperties]: Return the the app properties if no
1558
- error occurred, otherwise raise a RuntimeError with the message.
1557
+ Optional[AppProperties]: Return the app properties if no error
1558
+ occurred, otherwise raise a RuntimeError with the message.
1559
1559
"""
1560
1560
lib .GetAppProps .restype = types_go ._GetAppPropsResult
1561
1561
res = lib .GetAppProps (self .file_index )
@@ -1699,6 +1699,65 @@ def get_cell_value(self, sheet: str, cell: str, *opts: Options) -> str:
1699
1699
return res .val .decode (ENCODE )
1700
1700
raise RuntimeError (err )
1701
1701
1702
+ def get_row_outline_level (self , sheet : str , row : int ) -> int :
1703
+ """
1704
+ Get outline level of a single row by given worksheet name and row
1705
+ number.
1706
+
1707
+ Args:
1708
+ sheet (str): The worksheet name
1709
+ row (int): The row number
1710
+
1711
+ Returns:
1712
+ int: Return the row outline level if no error occurred, otherwise
1713
+ raise a RuntimeError with the message.
1714
+
1715
+ Example:
1716
+ For example, get outline level of row 5 in Sheet1:
1717
+
1718
+ ```python
1719
+ try:
1720
+ level = f.get_row_outline_level("Sheet1", 5)
1721
+ except RuntimeError as err:
1722
+ print(err)
1723
+ ```
1724
+ """
1725
+ lib .GetRowOutlineLevel .restype = types_go ._IntErrorResult
1726
+ res = lib .GetRowOutlineLevel (self .file_index , sheet .encode (ENCODE ), row )
1727
+ err = res .err .decode (ENCODE )
1728
+ if not err :
1729
+ return res .val
1730
+ raise RuntimeError (err )
1731
+
1732
+ def get_row_height (self , sheet : str , row : int ) -> float :
1733
+ """
1734
+ Get row height by given worksheet name and row number.
1735
+
1736
+ Args:
1737
+ sheet (str): The worksheet name
1738
+ row (int): The row number
1739
+
1740
+ Returns:
1741
+ float: Return the row height if no error occurred, otherwise
1742
+ raise a RuntimeError with the message.
1743
+
1744
+ Example:
1745
+ For example, get height of row 5 in Sheet1:
1746
+
1747
+ ```python
1748
+ try:
1749
+ height = f.get_row_height("Sheet1", 5)
1750
+ except RuntimeError as err:
1751
+ print(err)
1752
+ ```
1753
+ """
1754
+ lib .GetRowHeight .restype = types_go ._Float64ErrorResult
1755
+ res = lib .GetRowHeight (self .file_index , sheet .encode (ENCODE ), row )
1756
+ err = res .err .decode (ENCODE )
1757
+ if not err :
1758
+ return res .val
1759
+ raise RuntimeError (err )
1760
+
1702
1761
def get_col_outline_level (self , sheet : str , col : str ) -> int :
1703
1762
"""
1704
1763
Get outline level of a single column by given worksheet name and column
@@ -1975,7 +2034,7 @@ def get_sheet_map(self) -> Dict[int, str]:
1975
2034
sheets ID, and name maps of the workbook.
1976
2035
1977
2036
Returns:
1978
- dict [int, str]: Return the sheet ID and name map if no error
2037
+ Dict [int, str]: Return the sheet ID and name map if no error
1979
2038
occurred, otherwise return an empty dictionary.
1980
2039
"""
1981
2040
lib .GetSheetMap .restype = types_go ._GetSheetMapResult
@@ -3378,7 +3437,7 @@ def set_row_height(self, sheet: str, row: int, height: float) -> None:
3378
3437
if err != "" :
3379
3438
raise RuntimeError (err )
3380
3439
3381
- def set_row_outline (self , sheet : str , row : int , level : int ) -> None :
3440
+ def set_row_outline_level (self , sheet : str , row : int , level : int ) -> None :
3382
3441
"""
3383
3442
Set outline level number of a single row by given worksheet name and
3384
3443
Excel row number. The value of parameter 'level' is 1-7.
@@ -3397,7 +3456,7 @@ def set_row_outline(self, sheet: str, row: int, level: int) -> None:
3397
3456
3398
3457
```python
3399
3458
try:
3400
- f.set_row_outline ("Sheet1", 2, 1)
3459
+ f.set_row_outline_level ("Sheet1", 2, 1)
3401
3460
except RuntimeError as err:
3402
3461
print(err)
3403
3462
```
0 commit comments