(self, data, type=SQLITE)
| 269 | See also: Database.binary(). |
| 270 | """ |
| 271 | def __init__(self, data, type=SQLITE): |
| 272 | self.data, self.type = str(hasattr(data, "read") and data.read() or data), type |
| 273 | def escape(self): |
| 274 | if self.type == SQLITE: |
| 275 | return str(self.data.encode("string-escape")).replace("'","''") |