# Path: config.py
# class API:
# 
#     LISTEN_HOST = chain_load_setting("API_HOST", "YAMS_API_HOST", "127.0.0.1")
#     LISTEN_PORT = chain_load_setting("API_PORT", "YAMS_API_PORT", default=1111)
#     LISTEN_URL = "http://%s:%s" % (LISTEN_HOST, LISTEN_PORT)
#     # ----------------------------------------- #
#     # ---- Socket API ---- #
#     LISTEN_PORT_SOCKET = chain_load_setting("API_SOCKET_PORT", "YAMS_API_SOCKET_PORT", default=1112)
# 
#     # Yield epsilon is to avoid busy-waiting.  0 denotes yielding to any ready thread.  See scheduler docs.
#     # I've found 0 to fully utilize a core, so defaults to a longer interval to save electricity.
#     YIELD_TO_READY_THREADS=0
#     SOCKET_THREAD_YIELD_EPSILON = 0.25
#     SOCKET_TIMEOUT_SECONDS = 30
#     SOCKET_RX_BUFFER_BYTES = 4096
# 
#     # ----------------------------------------- #
# 
#     DEBUG = chain_load_setting("DEBUG", "YAMS_API_DEBUG", True)
# 
#     API_VERSION_CORE = chain_load_setting("API_VERSION_CORE", "YAMS_API_VERSION_CORE", default="dev")
#     API_VERSION_PLUGINS = chain_load_setting("API_VERSION_PLUGINS", "YAMS_API_VERSION_PLUGINS", default="dev")
# 
#     default_datadir = os.path.join(basedir, "yams_api", "data")
#     DATADIR = chain_load_setting("API_DATADIR", "YAMS_API_DATADIR", default=default_datadir)
# 
#     default_database = "sqlite:///" + os.path.join(basedir, "yams_api.sqlite")
#     SQLALCHEMY_DATABASE_URI = chain_load_setting("API_DATABASE_URI", "YAMS_API_DATABASE_URI", default=default_database)
# 
# 
#     # If we have redis, we have rate limiting available
#     try:
#         r = redis.Redis()
#         r.ping()
#         USE_RATE_LIMITS = True
#     except redis.ConnectionError:
#         USE_RATE_LIMITS = False


import os
import sys
import sqlalchemy as sa
from importlib import import_module
from alembic import op
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import sessionmaker, Session as SessionBase, relationship
from config import API
                "enabled": 1
            },
            {
                "id": 2,
                "label": "dropbox status",
                "width": "25%",
                "height": "100%",
                "data": {
                    "update_method": {
                        "interval_seconds": 30, "type": "polling"
                    },
                    "endpoint": API.SQLALCHEMY_DATABASE_URI  + "plugins/dropbox/status",
                    "data_type": "spot",
                    "logic": "boolean",
                    "field": {"response":"status"},
                    "field_type": "string",
                    "display_type": "list",
                    "detail_text_field": {'response': 'response'},
                },
                "enabled": 1
            },
            {
                "id": 3,
                "label": "facebook status",
                "width": "25%",
                "height": "100%",
                "data": {
                    "update_method": {
                        "interval_seconds": 30, "type": "polling"
                    },

# Path: config.py
# class API:
# 
#     LISTEN_HOST = chain_load_setting("API_HOST", "YAMS_API_HOST", "127.0.0.1")
#     LISTEN_PORT = chain_load_setting("API_PORT", "YAMS_API_PORT", default=1111)
#     LISTEN_URL = "http://%s:%s" % (LISTEN_HOST, LISTEN_PORT)
#     # ----------------------------------------- #
#     # ---- Socket API ---- #
#     LISTEN_PORT_SOCKET = chain_load_setting("API_SOCKET_PORT", "YAMS_API_SOCKET_PORT", default=1112)
# 
#     # Yield epsilon is to avoid busy-waiting.  0 denotes yielding to any ready thread.  See scheduler docs.
#     # I've found 0 to fully utilize a core, so defaults to a longer interval to save electricity.
#     YIELD_TO_READY_THREADS=0
#     SOCKET_THREAD_YIELD_EPSILON = 0.25
#     SOCKET_TIMEOUT_SECONDS = 30
#     SOCKET_RX_BUFFER_BYTES = 4096
# 
#     # ----------------------------------------- #
# 
#     DEBUG = chain_load_setting("DEBUG", "YAMS_API_DEBUG", True)
# 
#     API_VERSION_CORE = chain_load_setting("API_VERSION_CORE", "YAMS_API_VERSION_CORE", default="dev")
#     API_VERSION_PLUGINS = chain_load_setting("API_VERSION_PLUGINS", "YAMS_API_VERSION_PLUGINS", default="dev")
# 
#     default_datadir = os.path.join(basedir, "yams_api", "data")
#     DATADIR = chain_load_setting("API_DATADIR", "YAMS_API_DATADIR", default=default_datadir)
# 
#     default_database = "sqlite:///" + os.path.join(basedir, "yams_api.sqlite")
#     SQLALCHEMY_DATABASE_URI = chain_load_setting("API_DATABASE_URI", "YAMS_API_DATABASE_URI", default=default_database)
# 
# 
#     # If we have redis, we have rate limiting available
#     try:
#         r = redis.Redis()
#         r.ping()
#         USE_RATE_LIMITS = True
#     except redis.ConnectionError:
#         USE_RATE_LIMITS = False


# Path: multidb/versions/1d61b81b92d_initial_data_migration_adds_base_users_.py
import os
import sys
import sqlalchemy as sa
from importlib import import_module
from alembic import op
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import sessionmaker, Session as SessionBase, relationship
from config import API

                "enabled": 1
            },
            {
                "id": 2,
                "label": "dropbox status",
                "width": "25%",
                "height": "100%",
                "data": {
                    "update_method": {
                        "interval_seconds": 30, "type": "polling"
                    },
                    "endpoint": API.SQLALCHEMY_DATABASE_URI  + "plugins/dropbox/status",
                    "data_type": "spot",
                    "logic": "boolean",
                    "field": {"response":"status"},
                    "field_type": "string",
                    "display_type": "list",
                    "detail_text_field": {'response': 'response'},
                },
                "enabled": 1
            },
            {
                "id": 3,
                "label": "facebook status",
                "width": "25%",
                "height": "100%",
                "data": {
                    "update_method": {
                        "interval_seconds": 30, "type": "polling"
                    },

                    "endpoint": API.SQLALCHEMY_DATABASE_URI  + "plugins/facebook/status",