| 130 | return s |
| 131 | |
| 132 | class CommentQueue(LineQueue): |
| 133 | def __init__(self): |
| 134 | LineQueue.__init__(self) |
| 135 | |
| 136 | def add(self, line): |
| 137 | if line.strip() == '': |
| 138 | LineQueue.add(self, '\n') |
| 139 | else: |
| 140 | line = ' ' + line[2:-3].rstrip() + '\n' |
| 141 | LineQueue.add(self, line) |
| 142 | |
| 143 | def flushTo(self, other_queue): |
| 144 | if len(self._queue) == 0: |
| 145 | pass |
| 146 | elif len(self._queue) == 1: |
| 147 | other_queue.add('/*' + self._queue[0][2:].rstrip() + ' */\n') |
| 148 | else: |
| 149 | other_queue.add('/*\n') |
| 150 | LineQueue.flushTo(self, other_queue) |
| 151 | other_queue.add('*/\n') |
| 152 | self.clear() |
| 153 | |
| 154 | # This really seems to be about 4x longer than it needs to be |
| 155 | def cleanComments(source): |
no outgoing calls
no test coverage detected
searching dependent graphs…