Passed
Push — master ( 84bec4...a08110 )
by Konstantin
04:15 queued 01:47
created

set_Coords   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 4
eloc 7
dl 0
loc 15
rs 10
c 0
b 0
f 0

1 Function

Rating   Name   Duplication   Size   Complexity  
A set_Coords() 0 14 4
1
def set_Coords(self, Coords):
2
    """
3
    Set coordinate polygon by given object.
4
    Moreover, invalidate self's AlternativeImages
5
    (because they will have been cropped with a bbox
6
     of the previous polygon).
7
    """
8
    if hasattr(self, 'invalidate_AlternativeImage'):
9
        # RegionType, TextLineType, WordType, GlyphType:
10
        self.invalidate_AlternativeImage()
11
    elif hasattr(self, 'parent_object_') and hasattr(self.parent_object_, 'invalidate_AlternativeImage'):
12
        # BorderType:
13
        self.parent_object_.invalidate_AlternativeImage(feature_selector='cropped')
14
    self.Coords = Coords
15