예제 #1
0
    def index(self):
        """The default method

        related to templates/welcome/index.html
        """
        app_version, current_config_version, development = conf._inspect_environment()
        self.development = development
예제 #2
0
    def index(self):
        """The default method

        related to templates/welcome/index.html
        """
        app_version, current_config_version, development = conf._inspect_environment(
        )
        self.development = development
예제 #3
0
sys.path.append(os.path.join(BASE_DIR, "baidubos"))


class MagicDict(dict):
    def __init__(self, **kwargs):
        dict.__init__(self, kwargs)
        self.__dict__ = self

    def __getattr__(self, name):
        self[name] = MagicDict()
        return self[name]


try:
    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")
예제 #4
0
파일: settings.py 프로젝트: uplusplus/me
import os
import sys


######################################
## Global environment
######################################

BASE_DIR = os.path.abspath(os.path.dirname(__file__))
sys.path.insert(0, os.path.join(BASE_DIR, "libs"))

try:
    from google.appengine.api import conf

    _, _, GAE_DEVELOPMENT = conf._inspect_environment()

    RUNTIME_ENV = "gae"
    if GAE_DEVELOPMENT:
        RUNTIME_ENV = "gae_dev"

    import logging
except:
    RUNTIME_ENV = "local"
    if "SERVER_SOFTWARE" in os.environ:
        from bae.core import const
        from bae.api import logging

        RUNTIME_ENV = "bae"
    else:
        import logging
예제 #5
0
파일: main.py 프로젝트: deepgully/GAEPhotos
import time
import logging
import jinja2
import webapp2
from datetime import datetime
from webapp2_extras import json
from functools import wraps
from django.utils.encoding import force_unicode
from google.appengine.api import users
from google.appengine.ext import blobstore
from google.appengine.api import memcache
from google.appengine.api import urlfetch
from google.appengine.ext.webapp import blobstore_handlers

from google.appengine.api import conf
APP_VERSION, CURRENT_CONFIG_VERSION, DEVELOPMENT = conf._inspect_environment()
if DEVELOPMENT:
    ENABLE_DEBUG = True
else:
    ENABLE_DEBUG = False

import utils
import model
from lib.cc_cookies import CCCookiesWSGIMiddleware
from lang import save_current_lang
from lang import ugettext, ungettext, ccTranslations

_ = ugettext
__ = ungettext

def dateformat(value, format='%Y-%m-%d'):