■ ■ ■ ■ ■ ■
maryam/modules/iris/sentiment.py
| skipped 24 lines |
25 | 25 | | 'required': ('vaderSentiment',), |
26 | 26 | | 'options': ( |
27 | 27 | | ('json', None, True, 'Json file that contains the data', '-j', 'store', str), |
28 | | - | ('key', '', False, 'Data key. the value should be a list. None means the json file contains a list: ["..", ..]', '-k', 'store', str), |
| 28 | + | ('key', None, False, 'Data key. the value should be a list. None means the json file contains a list: ["..", ..]', '-k', 'store', str), |
29 | 29 | | ('thread', 5, False, 'The number of thread per each sell(default=10)', '-t', 'store', int), |
30 | 30 | | ('pipe', False, False, 'Dev only! pipe data from other modules(default=False)', '-p', 'store_true', bool), |
31 | 31 | | ), |
| skipped 37 lines |
69 | 69 | | if not file: |
70 | 70 | | return |
71 | 71 | | DATA = loads(file.read()) |
72 | | - | if key not in DATA: |
| 72 | + | if key not in DATA and key != None: |
73 | 73 | | self.error("The key doesn't exists", 'module_api', 'iris/sentiment') |
74 | 74 | | return |
75 | | - | if key != '': |
| 75 | + | if key != None: |
76 | 76 | | DATA = DATA[key] |
77 | 77 | | LEN = len(DATA) |
78 | 78 | | thread(self.options['thread']) |
| skipped 15 lines |