Ejemplo n.º 1
0
Archivo: server.py Proyecto: Kapin/rmc
import rmc.server.profile as profile
import rmc.server.view_helpers as view_helpers
import rmc.analytics.stats as rmc_stats
import rmc.shared.schedule_screenshot as schedule_screenshot
import rmc.kittens.data as kitten_data


app.register_blueprint(api_v1.api)

VERSION = int(time.time())

SERVER_DIR = os.path.dirname(os.path.realpath(__file__))

flask_render_template = flask.render_template

KITTEN_DATA = kitten_data.get_kitten_data()


def render_template(*args, **kwargs):
    redis = view_helpers.get_redis_instance()

    current_user = view_helpers.get_current_user()
    should_renew_fb_token = False
    if (current_user and
        current_user.fbid and
        not current_user.is_demo_account and
        not hasattr(flask.request, 'as_user_override')):
        should_renew_fb_token = current_user.should_renew_fb_token

    kwargs.update({
        'env': app.config['ENV'],
Ejemplo n.º 2
0
import rmc.server.api.v1 as api_v1
import rmc.server.profile as profile
import rmc.server.view_helpers as view_helpers
import rmc.analytics.stats as rmc_stats
import rmc.shared.schedule_screenshot as schedule_screenshot
import rmc.kittens.data as kitten_data

app.register_blueprint(api_v1.api)

VERSION = int(time.time())

SERVER_DIR = os.path.dirname(os.path.realpath(__file__))

flask_render_template = flask.render_template

KITTEN_DATA = kitten_data.get_kitten_data()


def render_template(*args, **kwargs):
    redis = view_helpers.get_redis_instance()

    current_user = view_helpers.get_current_user()
    should_renew_fb_token = False
    if (current_user and not current_user.is_demo_account
            and not hasattr(flask.request, 'as_user_override')):
        should_renew_fb_token = current_user.should_renew_fb_token

    kwargs.update({
        'env': app.config['ENV'],
        'VERSION': VERSION,
        'NUM_KITTENS': len(KITTEN_DATA),