Source code

Download source archive ↓

src/openpyxl/workbook/function_group.py

1# Copyright (c) 2010-2024 openpyxl
2
3from openpyxl.descriptors.serialisable import Serialisable
4from openpyxl.descriptors import (
5    Sequence,
6    String,
7    Integer,
8)
9
10class FunctionGroup(Serialisable):
11
12    tagname = "functionGroup"
13
14    name = String()
15
16    def __init__(self,
17                 name=None,
18                ):
19        self.name = name
20
21
22class FunctionGroupList(Serialisable):
23
24    tagname = "functionGroups"
25
26    builtInGroupCount = Integer(allow_none=True)
27    functionGroup = Sequence(expected_type=FunctionGroup, allow_none=True)
28
29    __elements__ = ('functionGroup',)
30
31    def __init__(self,
32                 builtInGroupCount=16,
33                 functionGroup=(),
34                ):
35        self.builtInGroupCount = builtInGroupCount
36        self.functionGroup = functionGroup