Coverage for /pythoncovmergedfiles/medio/medio/usr/local/lib/python3.8/site-packages/openpyxl/chart/descriptors.py: 94%

Shortcuts on this page

r m x   toggle line displays

j k   next/prev highlighted chunk

0   (zero) top of page

1   (one) first highlighted chunk

18 statements  

1# Copyright (c) 2010-2024 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().__set__(instance, value)