| 231 | |
| 232 | # Can be executed earlier than 'setup' if desired |
| 233 | def execRcLines(self): |
| 234 | if not self.rcLines: |
| 235 | return |
| 236 | # local copy because of recursion |
| 237 | rcLines = self.rcLines |
| 238 | rcLines.reverse() |
| 239 | # execute every line only once |
| 240 | self.rcLines = [] |
| 241 | while rcLines: |
| 242 | line = rcLines.pop().strip() |
| 243 | if line and line[0] != '#': |
| 244 | if self.onecmd(line): |
| 245 | # if onecmd returns True, the command wants to exit |
| 246 | # from the interaction, save leftover rc lines |
| 247 | # to execute before next interaction |
| 248 | self.rcLines += reversed(rcLines) |
| 249 | return True |
| 250 | |
| 251 | # Override Bdb methods |
| 252 | |