| Total Complexity | 10 |
| Total Lines | 28 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | def get_AllAlternativeImages(self, page=True, region=True, line=True, word=True, glyph=True): |
||
| 2 | """ |
||
| 3 | Get all the pc:AlternativeImage in a document |
||
| 4 | |||
| 5 | |||
| 6 | page (boolean): Get pc:Page level images |
||
| 7 | region (boolean): Get images on pc:*Region level |
||
| 8 | line (boolean) Get images on pc:TextLine level |
||
| 9 | word (boolean) Get images on pc:Word level |
||
| 10 | glyph (boolean) Get images on pc:Glyph level |
||
| 11 | """ |
||
| 12 | ret = [] |
||
| 13 | if page: |
||
| 14 | ret += self.get_AlternativeImage() |
||
| 15 | for this_region in self.get_AllRegions(['Text']): |
||
| 16 | if region: |
||
| 17 | ret += this_region.get_AlternativeImage() |
||
| 18 | for this_line in this_region.get_TextLine(): |
||
| 19 | if line: |
||
| 20 | ret += this_line.get_AlternativeImage() |
||
| 21 | for this_word in this_line.get_Word(): |
||
| 22 | if word: |
||
| 23 | ret += this_word.get_AlternativeImage() |
||
| 24 | for this_glyph in this_word.get_Glyph(): |
||
| 25 | if glyph: |
||
| 26 | ret += this_glyph.get_AlternativeImage() |
||
| 27 | return ret |
||
| 28 | |||
| 29 |