Пример #1
0
  def __init__(self):
    super(Application, self).__init__(
        handler_factory=functools.partial(web.RequestHandlerFactory, access_log=None),
        debug=options.options.debug)
    globals()[self.__class__.__name__] = lambda: self  # singleton

    # Initialize components.
    translation_path = path.join(path.dirname(__file__), 'locale')
    locale.load_translations(translation_path)
    self.loop.run_until_complete(asyncio.gather(tools.ensure_all_indexes(), bus.init()))
    smallcache.init()

    # Load views.
    from vj4.view import contest
    from vj4.view import discussion
    from vj4.view import home
    from vj4.view import judge
    from vj4.view import main
    from vj4.view import problem
    from vj4.view import record
    from vj4.view import training
    from vj4.view import user
    from vj4.view import i18n
    if options.options.static:
      self.router.add_static('/', path.join(path.dirname(__file__), '.uibuild'), name='static')
Пример #2
0
    def __init__(self):
        super(Application, self).__init__(debug=options.debug)
        globals()[self.__class__.__name__] = lambda: self  # singleton

        # Initialize components.
        translation_path = path.join(path.dirname(__file__), 'locale')
        locale.load_translations(translation_path)
        self.loop.run_until_complete(
            asyncio.gather(tools.ensure_all_indexes(), bus.init()))
        smallcache.init()

        # Load views.
        from vj4.handler import contest
        from vj4.handler import discussion
        from vj4.handler import domain
        from vj4.handler import home
        from vj4.handler import judge
        from vj4.handler import misc
        from vj4.handler import problem
        from vj4.handler import record
        from vj4.handler import training
        from vj4.handler import user
        from vj4.handler import i18n
        if options.static:
            self.router.add_static('/',
                                   path.join(path.dirname(__file__),
                                             '.uibuild'),
                                   name='static')