Mercurial > p > roundup > code
comparison roundup/cgi/TAL/TALInterpreter.py @ 5478:c8902d398434
removed FasterStringIO
| author | Christof Meerwald <cmeerw@cmeerw.org> |
|---|---|
| date | Sun, 29 Jul 2018 15:52:15 +0100 |
| parents | 7172c201dec2 |
| children | d79ba7365abb |
comparison
equal
deleted
inserted
replaced
| 5477:b0c2307be3d1 | 5478:c8902d398434 |
|---|---|
| 150 self.i18nContext = TranslationContext() | 150 self.i18nContext = TranslationContext() |
| 151 | 151 |
| 152 def StringIO(self): | 152 def StringIO(self): |
| 153 # Third-party products wishing to provide a full Unicode-aware | 153 # Third-party products wishing to provide a full Unicode-aware |
| 154 # StringIO can do so by monkey-patching this method. | 154 # StringIO can do so by monkey-patching this method. |
| 155 return FasterStringIO() | 155 return StringIO() |
| 156 | 156 |
| 157 def saveState(self): | 157 def saveState(self): |
| 158 return (self.position, self.col, self.stream, | 158 return (self.position, self.col, self.stream, |
| 159 self.scopeLevel, self.level, self.i18nContext) | 159 self.scopeLevel, self.level, self.i18nContext) |
| 160 | 160 |
| 749 bytecode_handlers_tal["onError"] = do_onError_tal | 749 bytecode_handlers_tal["onError"] = do_onError_tal |
| 750 bytecode_handlers_tal["<attrAction>"] = attrAction_tal | 750 bytecode_handlers_tal["<attrAction>"] = attrAction_tal |
| 751 bytecode_handlers_tal["optTag"] = do_optTag_tal | 751 bytecode_handlers_tal["optTag"] = do_optTag_tal |
| 752 | 752 |
| 753 | 753 |
| 754 class FasterStringIO(StringIO): | |
| 755 """Append-only version of StringIO. | |
| 756 | |
| 757 This let's us have a much faster write() method. | |
| 758 """ | |
| 759 pass | |
| 760 | |
| 761 | |
| 762 def _write_ValueError(s): | 754 def _write_ValueError(s): |
| 763 raise ValueError("I/O operation on closed file") | 755 raise ValueError("I/O operation on closed file") |
