Mercurial > repos > rmarenco > hubarchivecreator
comparison util/Reader.py @ 30:e7c4be523cb7 draft
planemo upload for repository https://github.com/goeckslab/hub-archive-creator commit 2f1b3cc8c9cb463e460f7f79efe99ed472700ecf
| author | yating-l |
|---|---|
| date | Tue, 19 Jun 2018 13:02:32 -0400 |
| parents | 7e8a8b732db3 |
| children |
comparison
equal
deleted
inserted
replaced
| 29:7e8a8b732db3 | 30:e7c4be523cb7 |
|---|---|
| 1 import os | |
| 1 import json | 2 import json |
| 2 import logging | 3 import logging |
| 3 import codecs | 4 import codecs |
| 4 | 5 |
| 5 | 6 |
| 103 datatype_dictionary = {} | 104 datatype_dictionary = {} |
| 104 | 105 |
| 105 # TODO: Optimize this double loop | 106 # TODO: Optimize this double loop |
| 106 for input_data in array_inputs: | 107 for input_data in array_inputs: |
| 107 input_false_path = input_data["false_path"] | 108 input_false_path = input_data["false_path"] |
| 108 input_data["name"] = santitizer.sanitize_name_input(input_data["name"]) | 109 # if the file is empty, skip the rest |
| 109 extensionObject = ExtensionClass(input_false_path, input_data) | 110 if os.path.isfile(input_false_path) and os.path.getsize(input_false_path) > 0: |
| 110 extensionObject.generateCustomTrack() | 111 input_data["name"] = santitizer.sanitize_name_input(input_data["name"]) |
| 111 datatype_dictionary.update({input_data["order_index"]: extensionObject}) | 112 extensionObject = ExtensionClass(input_false_path, input_data) |
| 113 extensionObject.generateCustomTrack() | |
| 114 datatype_dictionary.update({input_data["order_index"]: extensionObject}) | |
| 115 else: | |
| 116 self.logger.info("The input file: %s is empty, skip creating the track for this data", input_data["name"]) | |
| 112 return datatype_dictionary | 117 return datatype_dictionary |
| 113 | 118 |
| 114 | 119 |
| 115 | 120 |
| 116 | 121 |
