示例#1
0
 def _process(self):
     sprite_mapping = _cache.get('rooms-sprite-mapping')
     if sprite_mapping is None:
         build_rooms_spritesheet()
     if 'version' not in request.view_args:
         return redirect(url_for('.sprite', version=_cache.get('rooms-sprite-token')))
     photo_data = _cache.get('rooms-sprite')
     return send_file('rooms-sprite.jpg', BytesIO(photo_data), 'image/jpeg', no_cache=False, cache_timeout=365*86400)
示例#2
0
 def _process(self):
     tos_url = legal_settings.get('tos_url')
     tos_html = sanitize_html(legal_settings.get('tos')) or None
     privacy_policy_url = legal_settings.get('privacy_policy_url')
     privacy_policy_html = sanitize_html(legal_settings.get('privacy_policy')) or None
     if tos_url:
         tos_html = None
     if privacy_policy_url:
         privacy_policy_html = None
     return jsonify(rooms_sprite_token=unicode(_cache.get('rooms-sprite-token', '')),
                    languages=get_all_locales(),
                    tileserver_url=rb_settings.get('tileserver_url'),
                    grace_period=rb_settings.get('grace_period'),
                    managers_edit_rooms=rb_settings.get('managers_edit_rooms'),
                    help_url=config.HELP_URL,
                    contact_email=config.PUBLIC_SUPPORT_EMAIL,
                    has_tos=bool(tos_url or tos_html),
                    tos_html=tos_html,
                    has_privacy_policy=bool(privacy_policy_url or privacy_policy_html),
                    privacy_policy_html=privacy_policy_html)
示例#3
0
 def _process(self):
     return jsonify(rooms_sprite_token=unicode(
         _cache.get('rooms-sprite-token', '')),
                    languages=get_all_locales(),
                    tileserver_url=rb_settings.get('tileserver_url'),
                    grace_period=rb_settings.get('grace_period'))