Ejemplo n.º 1
0
 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
Ejemplo n.º 2
0
def __setconf(confpath, kind):
    readcf = read_ini.config(dealwith_http_log.INIFILE)
    try:
        everypath = readcf.getvalue(confpath, kind)
    except Exception, e:
        errstr = "getpath Error!<__setconf>" + str(e)
        log.writelog(errstr)
Ejemplo n.º 3
0
 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
Ejemplo n.º 4
0
def __setconf(confpath, kind):
    readcf = read_ini.config(dealwith_http_log.INIFILE)
    try:
        everypath = readcf.getvalue(confpath, kind)
    except Exception, e:
        errstr = "getpath Error!<__setconf>" + str(e)
        log.writelog(errstr)
Ejemplo n.º 5
0
 def __init__(self, dev, needstrreturn = 0):
     self.cf = config()
     self.log = LogSys()
     self.ip = switch_ip(dev)
     self.nsr = needstrreturn
     self.port = int(self.cf.getvalue('server_conf', 'port'))
     self.username = switch_username(dev)
     self.password = switch_pwd(dev)
     pass
Ejemplo n.º 6
0
 def __init__(self, dev, needstrreturn=0):
     self.cf = config()
     self.log = LogSys()
     self.ip = switch_ip(dev)
     self.nsr = needstrreturn
     self.port = int(self.cf.getvalue('server_conf', 'port'))
     self.username = switch_username(dev)
     self.password = switch_pwd(dev)
     pass
Ejemplo n.º 7
0
def __init__(ttime):

    readcf = read_ini.config(INIFILE)
    try:
        everypath = readcf.getvalue('logpath_conf', 'nginx_status')
        #print everypath
    except Exception, e:
        print "getpath Error!" + str(e)
        return 9
Ejemplo n.º 8
0
    def __init__(self, inipath):

        readcf = read_ini.config(inipath)
        self.pathin = readcf.getvalue('write_path', 'pathin')
        filepath = ('/').join(self.pathin.split('/')[:-1])
        if os.path.exists(filepath):
            pass
        else:
            os.mkdir(filepath)
        pass
Ejemplo n.º 9
0
 def __init__(self, dev, pname):
     self.cf = config()
     self.log = LogSys()
     self.pname = pname
     self.ip = switch_ip(dev)
     self.port = int(self.cf.getvalue('server_conf', 'port'))
     self.localpath = self.cf.getvalue('write_path', 'upfilepath') + self.pname + ".zip"
     self.remotepath = self.cf.getvalue('write_path', 'topath') + self.pname + ".zip"
     self.username = switch_username(dev)
     self.password = switch_pwd(dev)
Ejemplo n.º 10
0
 def __init__(self, dev, pname):
     self.cf = config()
     self.log = LogSys()
     self.pname = pname
     self.ip = switch_ip(dev)
     self.port = int(self.cf.getvalue('server_conf', 'port'))
     self.localpath = self.cf.getvalue('write_path',
                                       'upfilepath') + self.pname + ".zip"
     self.remotepath = self.cf.getvalue('write_path',
                                        'topath') + self.pname + ".zip"
     self.username = switch_username(dev)
     self.password = switch_pwd(dev)
Ejemplo n.º 11
0
	def GET(self):
		apiname = web.input()
		dbconfig = config()
		dbpath = dbconfig.getvalue('db','sqlite_db')
		print dbpath
		if apiname['api']=='ecg' or apiname['api']=='run':
			api = apiTable(apiname['api']+'_api', dbpath)
			apiList = api.oprDB()
			if apiname['api']=='ecg':
				nameapi='ECG/SDK'
			else:
				nameapi = 'RUN'
			return render.SB_Admin.api(render.SB_Admin.allhead("Information-Support"), render.SB_Admin.navbar(session.username), render.SB_Admin.apiInfo(nameapi+'历史访问总排行',nameapi+'历史访问的api总排行',apiList))
Ejemplo n.º 12
0
 def GET(self):
     apiname = web.input()
     dbconfig = config()
     dbpath = dbconfig.getvalue('db', 'sqlite_db')
     print dbpath
     if apiname['api'] == 'ecg' or apiname['api'] == 'run':
         api = apiTable(apiname['api'] + '_api', dbpath)
         apiList = api.oprDB()
         if apiname['api'] == 'ecg':
             nameapi = 'ECG/SDK'
         else:
             nameapi = 'RUN'
         return render.SB_Admin.api(
             render.SB_Admin.allhead("Information-Support"),
             render.SB_Admin.navbar(session.username),
             render.SB_Admin.apiInfo(nameapi + '历史访问总排行',
                                     nameapi + '历史访问的api总排行', apiList))
Ejemplo n.º 13
0
def thread_up(pname):
    # 把线程池单独拿出来写到一个lib中集中调用.
    cf = config()
    log = LogSys()
    ll = cf.getvalue('devname', 'web_dev')
    ldev = ll.split(',')
    threadpool = []
    try:
        for dev in ldev:
            tp = threading.Thread(target=main_c, args=(dev, pname))
            threadpool.append(tp)

        for th in threadpool:
            time.sleep(0.1)
            th.start()

        for th in threadpool:
            th.join()
            print "main exit."

        return 5
    except Exception, e:
        errmsg = "threadError.func thread_up." + str(e)
        log.writelog(errmsg)
Ejemplo n.º 14
0
def thread_up(pname):
    # 把线程池单独拿出来写到一个lib中集中调用.
    cf = config()
    log = LogSys()
    ll = cf.getvalue('devname', 'web_dev')
    ldev = ll.split(',')
    threadpool = []
    try:
        for dev in ldev:
            tp = threading.Thread(target=main_c, args=(dev, pname))
            threadpool.append(tp)

        for th in threadpool:
            time.sleep(0.1)
            th.start()

        for th in threadpool:
            th.join()
            print "main exit."

        return 5
    except Exception, e:
        errmsg = "threadError.func thread_up." + str(e)
        log.writelog(errmsg)
Ejemplo n.º 15
0
 def __init__(self):
     self.rf = config()
     self.thp = ThreadPool()
     self.log = LogSys()
     self.cr = CRedis()
     pass