# -*- coding: utf-8 -*- import sys import socket try: import cPickle as pickle except ImportError: import pickle from bae_utils.check import checkParamsType from bae_utils.log import getLogger from bae_memcache import mcpack from bae_memcache import nshead LOG = getLogger("bae.cache.log") class BaeMemcacheException(Exception): pass class BaeMemcacheInternalError(BaeMemcacheException): pass class BaeMemcacheParamsError(BaeMemcacheException): pass class BaeMemcache(object): CACHE_MAX_KEY_LEN = 180 CACHE_MAX_VALUE_LEN = 1048576 CACHE_MAX_QUERY_NUM = 64 def __init__(self, cache_id, memcache_addr, user, password): checkParamsType([(memcache_addr, [basestring]), (user, [basestring]), (password, [basestring]), (cache_id, [basestring])])
from google.appengine.api import conf _, _, GAE_DEVELOPMENT = conf._inspect_environment() RUNTIME_ENV = "gae" if GAE_DEVELOPMENT: RUNTIME_ENV = "gae_dev" except: RUNTIME_ENV = "local" server = os.environ.get("SERVER_SOFTWARE", "") if server.startswith("bae"): RUNTIME_ENV = "bae" from bae_utils.log import getLogger logging = getLogger("bae.debug.log") elif server.startswith("direwolf"): RUNTIME_ENV = "sae" from flask import Flask ###################################### # Application ###################################### app = Flask(__name__) app.config["APP_VER"] = __version__ app.config["SiteTitle"] = u"Stephen" app.config["SiteSubTitle"] = "做一些有趣的事, 做一些有趣的人!" app.config["OwnerEmail"] = "*****@*****.**"
from google.appengine.api import conf _, _, GAE_DEVELOPMENT = conf._inspect_environment() RUNTIME_ENV = "gae" if GAE_DEVELOPMENT: RUNTIME_ENV = "gae_dev" except: RUNTIME_ENV = "local" server = os.environ.get("SERVER_SOFTWARE", "") if server.startswith("bae"): RUNTIME_ENV = "bae" from bae_utils.log import getLogger logging = getLogger("bae.debug.log") elif server.startswith("direwolf"): RUNTIME_ENV = "sae" from flask import Flask ###################################### # Application ###################################### app = Flask(__name__) app.config["APP_VER"] = __version__ app.config["SiteTitle"] = "ME@deepgully"