mirror of
https://github.com/midoks/mdserver-web.git
synced 2026-10-18 23:45:52 +08:00
修改引入公共方法方式
This commit is contained in:
@@ -6,8 +6,12 @@ import os
|
||||
import time
|
||||
import re
|
||||
|
||||
sys.path.append(os.getcwd() + "/class/core")
|
||||
import mw
|
||||
web_dir = os.getcwd() + "/web"
|
||||
if os.path.exists(web_dir):
|
||||
sys.path.append(web_dir)
|
||||
os.chdir(web_dir)
|
||||
|
||||
import core.mw as mw
|
||||
|
||||
app_debug = False
|
||||
if mw.isAppleSystem():
|
||||
|
||||
@@ -11,11 +11,12 @@ import re
|
||||
import json
|
||||
import pymemcache
|
||||
|
||||
try:
|
||||
sys.path.append(os.getcwd() + "/class/core")
|
||||
import mw
|
||||
except Exception as e:
|
||||
import core.mw as mw
|
||||
web_dir = os.getcwd() + "/web"
|
||||
if os.path.exists(web_dir):
|
||||
sys.path.append(web_dir)
|
||||
os.chdir(web_dir)
|
||||
|
||||
import core.mw as mw
|
||||
|
||||
|
||||
def singleton(cls):
|
||||
|
||||
@@ -12,11 +12,12 @@ import yaml
|
||||
from bson.objectid import ObjectId
|
||||
from bson.json_util import dumps
|
||||
|
||||
try:
|
||||
sys.path.append(os.getcwd() + "/class/core")
|
||||
import mw
|
||||
except Exception as e:
|
||||
import core.mw as mw
|
||||
web_dir = os.getcwd() + "/web"
|
||||
if os.path.exists(web_dir):
|
||||
sys.path.append(web_dir)
|
||||
os.chdir(web_dir)
|
||||
|
||||
import core.mw as mw
|
||||
|
||||
def singleton(cls):
|
||||
_instance = {}
|
||||
|
||||
@@ -7,12 +7,12 @@ import time
|
||||
import re
|
||||
import redis
|
||||
|
||||
web_dir = os.getcwd() + "/web"
|
||||
if os.path.exists(web_dir):
|
||||
sys.path.append(web_dir)
|
||||
os.chdir(web_dir)
|
||||
|
||||
try:
|
||||
sys.path.append(os.getcwd() + "/class/core")
|
||||
import mw
|
||||
except Exception as e:
|
||||
import core.mw as mw
|
||||
import core.mw as mw
|
||||
|
||||
|
||||
# def getPluginName():
|
||||
|
||||
@@ -8,11 +8,12 @@ import re
|
||||
import pymongo
|
||||
import json
|
||||
|
||||
try:
|
||||
sys.path.append(os.getcwd() + "/class/core")
|
||||
import mw
|
||||
except Exception as e:
|
||||
import core.mw as mw
|
||||
web_dir = os.getcwd() + "/web"
|
||||
if os.path.exists(web_dir):
|
||||
sys.path.append(web_dir)
|
||||
os.chdir(web_dir)
|
||||
|
||||
import core.mw as mw
|
||||
|
||||
def singleton(cls):
|
||||
_instance = {}
|
||||
|
||||
Reference in New Issue
Block a user