Coverage for /var/srv/projects/api.amasfac.comuna18.com/tmp/venv/lib/python3.9/site-packages/openpyxl/chart/descriptors.py: 81%

18 statements  

« prev     ^ index     » next       coverage.py v6.4.4, created at 2023-07-17 14:22 -0600

1# Copyright (c) 2010-2022 openpyxl 

2 

3 

4 

5from openpyxl.descriptors.nested import ( 

6 NestedMinMax 

7 ) 

8 

9from openpyxl.descriptors import Typed 

10 

11from .data_source import NumFmt 

12 

13""" 

14Utility descriptors for the chart module. 

15For convenience but also clarity. 

16""" 

17 

18class NestedGapAmount(NestedMinMax): 

19 

20 allow_none = True 

21 min = 0 

22 max = 500 

23 

24 

25class NestedOverlap(NestedMinMax): 

26 

27 allow_none = True 

28 min = -100 

29 max = 100 

30 

31 

32class NumberFormatDescriptor(Typed): 

33 """ 

34 Allow direct assignment of format code 

35 """ 

36 

37 expected_type = NumFmt 

38 allow_none = True 

39 

40 def __set__(self, instance, value): 

41 if isinstance(value, str): 

42 value = NumFmt(value) 

43 super(NumberFormatDescriptor, self).__set__(instance, value)