def __init__(self, portconf='redis_cnf'): self.cf = config() self.log = LogSys() #self.host = 'localhost' #self.port = 6379 #self.db = 0 self.host = self.cf.getvalue('redis_cnf', 'host') self.port = self.cf.getvalue('redis_cnf', 'port') self.db = self.cf.getvalue('server_support', 'db') try: self.r = redis.Redis(host = self.host, port = self.port, db = self.db) except Exception, e: errmsg = "CRedis connect redis Err.Class CRedis." + str(e) self.log.writelog(errmsg)
class CRedis(object): def __init__(self, portconf='redis_cnf'): self.cf = Config(confpath='config.ini') self.log = LogSys() #self.host = 'localhost' #self.port = 6379 #self.db = 0 self.host = self.cf.getvalue('db-info', 'host') self.port = self.cf.getvalue('db-info', 'port') self.db = self.cf.getvalue('db-info', 'db') try: self.r = redis.Redis(host=self.host, port=self.port, db=self.db) except Exception, e: errmsg = "CRedis connect redis Err.Class CRedis." + str(e) self.log.writelog(errmsg)
def __init__(self): self.cf = config() self.log = LogSys() self.cr = CRedis() self.shpath = self.cf.getvalue('script_path', 'indexvalue') self.ec = ExcuteConn('agency', 1) # 表示需要返回执行的输出str pass
# coding: utf-8 import web from web import form import os import ConnPass import InitStr from lib.write_file import WriteFile from lib.allowpass import DealWithPwd from GetErrlog import ExcuteErrLog import time from logsys import LogSys import UpWeb as up from lib.showTableStructure import apiTable from lib.read_ini import config log = LogSys() dp = DealWithPwd() MissionNum = "mmnn88" urls = ('/', 'Index', '/index', 'Index', '/test', 'Test', '/login', 'Login', '/logout', 'Logout', '/faul', 'Faul', '/tables', 'Tables', '/charts', 'Charts', '/forms', 'Forms', '/up', 'Update', '/typography', 'Typo', '/post', 'PostD', '/test', 'Test', '/loginerror', 'LoginError', '/permission', 'Permission', '/upfile', 'UpFile', '/upcomplete', 'UpOver', '/logshow', 'LogShow', '/logget', 'LogGet', '/countapi', 'Countapi') root = os.path.dirname(__file__) render = web.template.render(os.path.join(root, "templates")) allowed = (('admin', '123123'), ('cuibing', '123123'))
def __init__(self): self.rf = config() self.thp = ThreadPool() self.log = LogSys() self.cr = CRedis() pass