| Total Complexity | 3 |
| Total Lines | 35 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | """ |
||
| 11 | class ShredderCommand(Command): |
||
| 12 | """ |
||
| 13 | Converteert XML-bestanden met groupertabellen naar CSV-bestanden |
||
| 14 | |||
| 15 | kerapu:shredder |
||
| 16 | {XML-bestand : XML-bestand met groupertabellen, b.v. BoomBestanden.xml, Referenties.xml} |
||
| 17 | {folder : Folder waar de CSV-bestanden moeten worden opgeslagen} |
||
| 18 | """ |
||
| 19 | |||
| 20 | # ------------------------------------------------------------------------------------------------------------------ |
||
| 21 | def handle(self): |
||
| 22 | """ |
||
| 23 | Executes the command. |
||
| 24 | """ |
||
| 25 | self.output = KerapuStyle(self.input, self.output) |
||
| 26 | |||
| 27 | filename = self.argument('XML-bestand') |
||
| 28 | folder = self.argument('folder') |
||
| 29 | |||
| 30 | # Lees de eerste gedeelte van het XML-bestand en bepaal type. |
||
| 31 | kop = open(filename, 'rt').read(1024) |
||
| 32 | |||
| 33 | if '<InlezenBoomBestanden>' in kop: |
||
| 34 | shredder = BoomBestandenShredder(self.output, folder) |
||
| 35 | shredder.shred_xml_file(filename) |
||
| 36 | |||
| 37 | elif '<InlezenReferenties>' in kop: |
||
| 38 | shredder = ReferentieShredder(self.output, folder) |
||
| 39 | shredder.shred_xml_file(filename) |
||
| 40 | |||
| 41 | else: |
||
| 42 | raise RuntimeError("Tag <InlezenBoomBestanden> of <InlezenReferenties> niet gevonden in '{}'". |
||
| 43 | format(filename)) |
||
| 44 | |||
| 45 | return 0 |
||
| 46 | |||
| 48 |
This can be caused by one of the following:
1. Missing Dependencies
This error could indicate a configuration issue of Pylint. Make sure that your libraries are available by adding the necessary commands.
2. Missing __init__.py files
This error could also result from missing
__init__.pyfiles in your module folders. Make sure that you place one file in each sub-folder.