コード例 #1
0
  def get(self):
    BaseHandler.initialize(self)

    if not self.authenticate(author=True):
      return

    path = self.data_liberation_path()
    tornado.web.StaticFileHandler.get(self, path)
コード例 #2
0
ファイル: private.py プロジェクト: randy-ran/helloworld
    def get(self, path):
        BaseHandler.initialize(self)

        try:
            if not self.authenticate(private_resource=self.request.uri,
                                     auto_login=False):
                # 401, need to login
                self.set_status(401)
                self.prevent_caching()
                tornado.web.StaticFileHandler.get(self, "401.png")
                return
        except tornado.web.HTTPError as ex:
            # 403, forbidden
            self.set_status(403)
            self.prevent_caching()
            tornado.web.StaticFileHandler.get(self, "403.png")
            return

        # ok!
        tornado.web.StaticFileHandler.get(self, path)
コード例 #3
0
ファイル: private.py プロジェクト: Acidburn0zzz/helloworld
  def get(self, path):
    BaseHandler.initialize(self)

    try:
      if not self.authenticate(private_resource=self.request.uri,
          auto_login=False):
        # 401, need to login
        self.set_status(401)
        self.prevent_caching()
        tornado.web.StaticFileHandler.get(self, "401.png")
        return
    except tornado.web.HTTPError as ex:
      # 403, forbidden
      self.set_status(403)
      self.prevent_caching()
      tornado.web.StaticFileHandler.get(self, "403.png")
      return

    # ok!
    tornado.web.StaticFileHandler.get(self, path)
コード例 #4
0
ファイル: image_proxy.py プロジェクト: messiahxu/Twitdao11
 def initialize(self, request, response):
     BaseHandler.initialize(self, request, response)
     self.image_proxy_config = md.get_image_proxy_config()
コード例 #5
0
    def get(self):
        BaseHandler.initialize(self)

        increase_count(self)

        tornado.web.StaticFileHandler.get(self, 'img/pixel.gif')
コード例 #6
0
ファイル: api.py プロジェクト: jcomo/thermal-sensing
	def initialize(self, *a, **kw):
		BaseHandler.initialize(self, *a, **kw)
		self.error_code = None
コード例 #7
0
ファイル: authenticated.py プロジェクト: zxul767/Wikipages
 def initialize(self, *params, **named_params):
     BaseHandler.initialize(self, *params, **named_params)
     self.account = self.get_logged_in_account()
コード例 #8
0
ファイル: stats.py プロジェクト: Acidburn0zzz/helloworld
  def get(self):
    BaseHandler.initialize(self)

    increase_count(self)

    tornado.web.StaticFileHandler.get(self, 'img/pixel.gif')
コード例 #9
0
ファイル: authenticated.py プロジェクト: chazarovsky/omnimobi
 def initialize(self, *params, **named_params):
     BaseHandler.initialize(self, *params, **named_params)
     self.account = self.get_logged_in_account()
コード例 #10
0
	def initialize(self, *a, **kw):
		BaseHandler.initialize(self, *a, **kw)
		self.error_code = None
コード例 #11
0
ファイル: me.py プロジェクト: JeanCSM/quizzical
 def initialize(self, request, response):
     BaseHandler.initialize(self, request, response)
     self.values['action'] = self.request.url