Format the completions suggestions in the following format: @@COMPLETIONS(modFile(token,description),(token,description),(token,description))END@@
(self, defFile, completionsList)
| 134 | return " " |
| 135 | |
| 136 | def format_completion_message(self, defFile, completionsList): |
| 137 | """ |
| 138 | Format the completions suggestions in the following format: |
| 139 | @@COMPLETIONS(modFile(token,description),(token,description),(token,description))END@@ |
| 140 | """ |
| 141 | compMsg = [] |
| 142 | compMsg.append("%s" % defFile) |
| 143 | for tup in completionsList: |
| 144 | compMsg.append(",") |
| 145 | |
| 146 | compMsg.append("(") |
| 147 | compMsg.append(str(self.remove_invalid_chars(tup[0]))) # token |
| 148 | compMsg.append(",") |
| 149 | compMsg.append(self.remove_invalid_chars(tup[1])) # description |
| 150 | |
| 151 | if len(tup) > 2: |
| 152 | compMsg.append(",") |
| 153 | compMsg.append(self.remove_invalid_chars(tup[2])) # args - only if function. |
| 154 | |
| 155 | if len(tup) > 3: |
| 156 | compMsg.append(",") |
| 157 | compMsg.append(self.remove_invalid_chars(tup[3])) # TYPE |
| 158 | |
| 159 | compMsg.append(")") |
| 160 | |
| 161 | return "%s(%s)%s" % (MSG_COMPLETIONS, "".join(compMsg), MSG_END) |
| 162 | |
| 163 | |
| 164 | class Exit(Exception): |