Did I find the right examples for you? yes no

All Samples(486)  |  Call(486)  |  Derive(0)  |  Import(0)

src/g/a/gae-paypal-online-market-example-HEAD/app/main.py   gae-paypal-online-market-example(Download)
  def error( self, code ):
    webapp.RequestHandler.error( self, code )
    if code >= 500 and code <= 599:
      path = os.path.join(os.path.dirname(__file__), 'templates/50x.htm')
      self.response.out.write(template.render(path, {}))

src/w/a/watchbots-gae-python-HEAD/lib/watchbot.py   watchbots-gae-python(Download)
  def error(self, status_code):
    webapp.RequestHandler.error(self, status_code)
    if status_code == 404:
      self.generate('404.html')
 
  def update(self, stream_id):
    """Override this to handle stream updates"""  
    webapp.RequestHandler.error(self, 501)
    self.response.headers['Content-Type'] = "application/json"
    self.response.out.write('{"status": "not supported"}')
    stream = self.get_stream(stream_id)
    if stream is None:
      webapp.RequestHandler.error(self, 404)
      self.response.out.write('{"status": "failed", "message": "stream not found"}')
    else:

src/w/a/watchbots-gae-python-HEAD/feedbot.py   watchbots-gae-python(Download)
 
    logging.warn("feed failed to be created: %s" % self.request.POST.get('url'))  
    webapp.RequestHandler.error(self, 400)
    self.response.headers['Content-Type'] = "application/json"
    self.response.out.write('{"status": "failed", "message": "stream was not created"}')
    stream = self.get_stream(stream_id)
    if stream is None:
      webapp.RequestHandler.error(self, 404)
      self.response.out.write('{"status": "failed", "message": "stream not found"}')
      return
    stream = self.get_stream(stream_id)
    if stream is None:
      webapp.RequestHandler.error(self, 404)
      self.response.out.write('{"status": "failed", "message": "stream not found"}')
      return
  def render_json(self, stream):
    self.response.headers['Content-Type'] = "application/json"
 
    if stream is None:
      webapp.RequestHandler.error(self, 404)

src/d/a/Darwin-Core-Engine-HEAD/app/organizations.py   Darwin-Core-Engine(Download)
    def get(self, urlname):
        o = Organization.get_by_urlname(urlname)
        if not o:
            self.error(404)
            return
    def get(self):
        self.error(405)
        self.response.headers['Allow'] = 'POST'
        return
 
    def post(self):
        # Validate name
        name = self.request.get('name', None)        
        if not name:
            self.error(400)
        user = users.get_current_user()
        if not user:
            self.error(401)
            return
 
        # Check if organization exists
        organization = Organization.get_by_name(name)
        if organization:
            self.error(403)

src/a/u/autoproxy2pac-HEAD/handlers/pac_generate.py   autoproxy2pac(Download)
 
        if not self.parseRequest(urlpart):
            self.error(404)
            return
 
        rules = RuleList.getList('gfwlist')
        if rules is None:
            self.error(500)
            logging.debug('%(ip)s is banned on full fetch #%(rt)d, UA="%(ua)s"', dict(rt=rate, **param))
            if not DEBUG:
                self.error(403)
                return True
 

src/a/u/autoproxy2pac-HEAD/handlers/changelog.py   autoproxy2pac(Download)
    def get(self, name):
        name = name.lower()
        rules = RuleList.getList(name)
        if rules is None:
            self.error(404)
        fetchNum = start + int(self.request.get('num', 20))
        if fetchNum > 1000:
            self.error(412)
            return
 

src/t/y/typhoonae-0.2.0/src/typhoonae/handlers/json_rpc.py   typhoonae(Download)
        except (InvalidRequestError, ParseError), ex:
            logging.info(ex)
            self.error(ex.status)
            body = self._build_error(ex)
            self.response.out.write(dumps(body))
            if len(responses) == 0:
                # Only notifications were sent
                self.error(204)
                return
 
            if batch_request:
                #TODO Which http_status to set for batches?
                self.error(200)
                    raise  InternalError() #this cannot happen
                status, body = responses[0]
                self.error(status)
                self.response.out.write(dumps(body))
 

src/s/t/stashboard-HEAD/stashboard/handlers/site.py   stashboard(Download)
    def not_found(self):
        self.error(404)
        self.render(default_template_data(), "404.html")
 
 
    def get(self):
        self.error(403)
        self.render(default_template_data(), "404.html")
 
 

src/g/a/gaesynkit-1.0.0a2/src/gaesynkit/json_rpc.py   gaesynkit(Download)
        except (InvalidRequestError, ParseError), ex:
            logging.error(ex)
            self.error(ex.status)
            body = self._build_error(ex)
            self.response.out.write(simplejson.dumps(body))
            if len(responses) == 0:
                # Only notifications were sent
                self.error(204)
                return
 
            if batch_request:
                #TODO Which http_status to set for batches?
                self.error(200)
                    raise InternalError()   # pragma: no cover
                status, body = responses[0]
                self.error(status)
                self.response.out.write(simplejson.dumps(body))
 

src/w/a/wave-extensions-gallery-HEAD/app/gallery.py   wave-extensions-gallery(Download)
				self.redirect('/static/images/gadget_icon_128x128.png')
		else:
			self.error(404)
 
class ScreenshotHandler(webapp.RequestHandler):
			self.response.out.write(ext.screenshots[number])
		else:
			self.error(404)
 
class RatingHandler(webapp.RequestHandler):
		else:
			if Extension.gql('WHERE extID = :1',extID).count(limit=1) == 0:
				self.error(404)
			else:
				rating = Rating.gql('WHERE user = :1 AND extID = :2',user,extID).get()

  1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9  Next