# Path: toughwlan/models.py
# def get_metadata(db_engine):
# class SystemSession(DeclarativeBase):
# class SystemCache(DeclarativeBase):
# class TrwOperator(DeclarativeBase):
# class TrwOperatorRule(DeclarativeBase):
# class TrwParam(DeclarativeBase):
# class TrwIsp(DeclarativeBase):
# class TrwIspService(DeclarativeBase):
# class TrwBas(DeclarativeBase):
# class TrwDomain(DeclarativeBase):
# class TrwDomainAttr(DeclarativeBase):
# class TrwSsid(DeclarativeBase):
# class TrwRadius(DeclarativeBase):
# class TrwTemplate(DeclarativeBase):
# class TrwOperateLog(DeclarativeBase):
# class TrwOSTypes(DeclarativeBase):
# 
# Path: toughwlan/manage/settings.py
# def redis_conf(config):
#     eredis_url = os.environ.get("REDIS_URL")
#     eredis_port = os.environ.get("REDIS_PORT")
#     eredis_pwd = os.environ.get("REDIS_PWD")
#     eredis_db = os.environ.get("REDIS_DB")
# 
#     is_update = any([eredis_url,eredis_port,eredis_pwd,eredis_db])
# 
#     if eredis_url:
#         config['redis']['host'] = eredis_url
#     if eredis_port:
#         config['redis']['port'] = int(eredis_port)
#     if eredis_pwd:
#         config['redis']['passwd'] = eredis_pwd 
#     if eredis_db:
#         config['redis']['db'] = int(eredis_db)
#     if is_update:
#         config.save()
# 
#     return config['redis']


import sys
import os
import time
import cyclone.web
import toughwlan
from twisted.python import log
from twisted.internet import reactor
from beaker.cache import CacheManager
from beaker.util import parse_cache_config_options
from mako.lookup import TemplateLookup
from sqlalchemy.orm import scoped_session, sessionmaker
from toughlib import utils
from toughlib import logger
from toughwlan import models
from toughwlan.manage.settings import redis_conf
from toughlib.dbengine import get_engine
from toughlib.permit import permit, load_handlers
from toughlib import redis_cache
from toughlib import redis_session
from toughlib.db_backup import DBBackup
#!/usr/bin/env python
#coding:utf-8



class Httpd(cyclone.web.Application):
    def __init__(self, config=None, dbengine=None, **kwargs):

        self.config = config

        settings = dict(
            cookie_secret="12oETzKXQAGaYdkL5gEmGeJJFuYh7EQnp2XdTP1o/Vo=",
            login_url="/login",
            template_path=os.path.join(os.path.dirname(toughwlan.__file__), "views"),

# Path: toughwlan/models.py
# def get_metadata(db_engine):
# class SystemSession(DeclarativeBase):
# class SystemCache(DeclarativeBase):
# class TrwOperator(DeclarativeBase):
# class TrwOperatorRule(DeclarativeBase):
# class TrwParam(DeclarativeBase):
# class TrwIsp(DeclarativeBase):
# class TrwIspService(DeclarativeBase):
# class TrwBas(DeclarativeBase):
# class TrwDomain(DeclarativeBase):
# class TrwDomainAttr(DeclarativeBase):
# class TrwSsid(DeclarativeBase):
# class TrwRadius(DeclarativeBase):
# class TrwTemplate(DeclarativeBase):
# class TrwOperateLog(DeclarativeBase):
# class TrwOSTypes(DeclarativeBase):
# 
# Path: toughwlan/manage/settings.py
# def redis_conf(config):
#     eredis_url = os.environ.get("REDIS_URL")
#     eredis_port = os.environ.get("REDIS_PORT")
#     eredis_pwd = os.environ.get("REDIS_PWD")
#     eredis_db = os.environ.get("REDIS_DB")
# 
#     is_update = any([eredis_url,eredis_port,eredis_pwd,eredis_db])
# 
#     if eredis_url:
#         config['redis']['host'] = eredis_url
#     if eredis_port:
#         config['redis']['port'] = int(eredis_port)
#     if eredis_pwd:
#         config['redis']['passwd'] = eredis_pwd 
#     if eredis_db:
#         config['redis']['db'] = int(eredis_db)
#     if is_update:
#         config.save()
# 
#     return config['redis']


# Path: toughwlan/manage/httpd.py
import sys
import os
import time
import cyclone.web
import toughwlan
from twisted.python import log
from twisted.internet import reactor
from beaker.cache import CacheManager
from beaker.util import parse_cache_config_options
from mako.lookup import TemplateLookup
from sqlalchemy.orm import scoped_session, sessionmaker
from toughlib import utils
from toughlib import logger
from toughwlan import models
from toughwlan.manage.settings import redis_conf
from toughlib.dbengine import get_engine
from toughlib.permit import permit, load_handlers
from toughlib import redis_cache
from toughlib import redis_session
from toughlib.db_backup import DBBackup

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



class Httpd(cyclone.web.Application):
    def __init__(self, config=None, dbengine=None, **kwargs):

        self.config = config

        settings = dict(
            cookie_secret="12oETzKXQAGaYdkL5gEmGeJJFuYh7EQnp2XdTP1o/Vo=",
            login_url="/login",
            template_path=os.path.join(os.path.dirname(toughwlan.__file__), "views"),

            static_path=os.path.join(os.path.dirname(toughwlan.__file__), "static"),