예제 #1
0
def auto_version(path_string):
    if utils.is_ksyun_server() == None:
        return path_string
    try:
        if path_string in version_cache:
            mtime = version_cache[path_string]
        else:
            mtime = os.path.getmtime('%s%s' % (Global.AUTO_VERSION_STATCI_PATH,
                                               path_string, ))
            version_cache[path_string] = mtime
        v_str = rx.sub(r"\1.%d.\2" % mtime, path_string)
        return v_str
    except:
        return path_string
예제 #2
0
파일: Global.py 프로젝트: yangsongx/doc
RESOURCE_TYPE_RINGER = 3
global RESOURCE_TYPE_APP
RESOURCE_TYPE_APP = 4
global RESOURCE_TYPE_PAPER
RESOURCE_TYPE_PAPER = 5
global QINIU_DOWNLOAD_PREFIX
QINIU_DOWNLOAD_PREFIX = 'http://7xio6q.com1.z0.glb.clouddn.com/'
global BOOTANIMATION_TMP
BOOTANIMATION_TMP = 'bootanimation_tmp/'

global MAKER_WEBSITE_URL
MAKER_WEBSITE_URL = 'http://maker.caredear.com/'

global REDIS_LOCK_HOST
global AUTO_VERSION_STATCI_PATH
if utils.is_ksyun_server() != None:
    REDIS_LOCK_HOST = 'yz-maker1'
    #AUTO_VERSION_STATCI_PATH="/opt/maker/env/maker"
    AUTO_VERSION_STATCI_PATH = os.path.dirname(os.path.dirname(
        os.path.abspath(__file__)))
else:
    AUTO_VERSION_STATCI_PATH = ""
    REDIS_LOCK_HOST = '192.168.1.13'

global REDIS_LOCK_PORT
REDIS_LOCK_PORT = 6379
global REDIS_LOCK_DB_NUM
REDIS_LOCK_DB_NUM = 0
global REDIS_LOCK_TIMEOUT
REDIS_LOCK_TIMEOUT = 30
global MAKERID_SALT