#!/usr/bin/env python
# -*- coding: utf-8 -*-

import os

from redylitics.defaults import *


# sentinels stuff

_SENTINEL_HOSTS = os.environ.get("RA_SENTINEL_HOSTS", DEF_SENTINEL_HOSTS)
SENTINEL_HOSTS = [h.strip() for h in _SENTINEL_HOSTS.split(",")]
SENTINEL_PORT = os.environ.get("RA_SENTINEL_PORT", DEF_SENTINEL_PORT)
SENTINEL_MASTER_NAME = os.environ.get("RA_SENTINEL_MASTER_NAME", DEF_SENTINEL_MASTER_NAME)


# strict clients stuff

REDIS_HOST = os.environ.get("RA_REDIS_HOST", DEF_REDIS_HOST)
REDIS_PORT = os.environ.get("RA_REDIS_PORT", DEF_REDIS_PORT)
REDIS_DB = os.environ.get("RA_REDIS_DB", DEF_REDIS_PORT)


# pageview stuff

WRITE_CHANNEL_REGEX_PATTERN = os.environ.get("RA_WRITE_CHANNEL_REGEX", DEF_WRITE_CHANNEL_REGEX_PATTERN)
WRITE_DATE_REGEX_PATTERN = os.environ.get("RA_WRITE_DATE_REGEX", DEF_WRITE_DATE_REGEX_PATTERN)
READ_CHANNEL_REGEX_PATTERN = os.environ.get("RA_READ_CHANNEL_REGEX", DEF_READ_CHANNEL_REGEX_PATTERN)
READ_DATE_REGEX_PATTERN = os.environ.get("RA_READ_DATE_REGEX", DEF_READ_DATE_REGEX_PATTERN)
DATE_EXTRACTION_REGEX_PATTERN = os.environ.get("RA_DATE_EXTRACTION_REGEX", DEF_DATE_EXTRACTION_REGEX_PATTERN)


# video stuff

VIDEO_PREFIX = os.environ.get("RA_VIDEO_PREFIX", DEF_VIDEO_PREFIX)
VIDEO_ID_REGEX_PATTERN = os.environ.get("RA_VIDEO_ID_REGEX", DEF_VIDEO_ID_REGEX_PATTERN)
VIDEO_EVENT_REGEX_PATTERN = os.environ.get("RA_VIDEO_EVENT_REGEX", DEF_VIDEO_EVENT_REGEX_PATTERN)


# video ad stuff

VIDEO_AD_PREFIX = os.environ.get("RA_VIDEO_AD_PREFIX", DEF_VIDEO_AD_PREFIX)
VIDEO_AD_ID_REGEX_PATTERN = os.environ.get("RA_VIDEO_AD_ID_REGEX", DEF_VIDEO_AD_ID_REGEX_PATTERN)
VIDEO_AD_EVENT_REGEX_PATTERN = os.environ.get("RA_VIDEO_AD_EVENT_REGEX", DEF_VIDEO_AD_EVENT_REGEX_PATTERN)


# wsgi stuff

REFERER_ANCHORED_REGEX_PATTERN = os.environ.get("RA_REFERER_ANCHORED_REGEX", DEF_REFERER_ANCHORED_REGEX_PATTERN)
REFERER_EXTRACT_REGEX_PATTERN = os.environ.get("RA_REFERER_EXTRACT_REGEX", DEF_REFERER_EXTRACT_REGEX_PATTERN)
FLUSH_INTERVAL = os.environ.get("RA_FLUSH_INTERVAL", DEF_FLUSH_INTERVAL)
