Пример #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')
Пример #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')
Пример #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')
Пример #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')