def getChild(self, path, request): try: paste = Paste.findByName(self.store, path.decode('ascii')) except ItemNotFound: return NoResource('No such paste') else: return Data(paste.content.encode('utf-8'), 'text/plain; charset=UTF-8')
def getChild(self, path, request): try: paste = Paste.findByName(self._store, path.decode('ascii')) except ItemNotFound: return NoResource('No such paste') else: return Data(paste.toJSON(), 'application/json')