Exemplo n.º 1
0
 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')
Exemplo n.º 2
0
 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')
Exemplo n.º 3
0
 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')
Exemplo n.º 4
0
 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')