本文整理汇总了Python中MyUtil._secret方法的典型用法代码示例。如果您正苦于以下问题:Python MyUtil._secret方法的具体用法?Python MyUtil._secret怎么用?Python MyUtil._secret使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MyUtil
的用法示例。
在下文中一共展示了MyUtil._secret方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: SvcDoRun
# 需要导入模块: import MyUtil [as 别名]
# 或者: from MyUtil import _secret [as 别名]
def SvcDoRun(self):
try:
global LOG,DBIP,DBPort,_3ds,log,socksize,innerIP,CPUCores
socksize = 64000
_3ds = MyUtil._secret()
cf1 = ConfigParser.ConfigParser()
cf1.read(MyUtil.cur_file_dir() + "\\agent.ini")
agentpath = cf1.get("main", "path").decode('gbk').encode("utf-8")
agentlogfile = cf1.get("main", "agentlogfile").decode('gbk').encode("utf-8")
MyUtil.DBIP = cf1.get("main", "DBIP").decode('gbk').encode("utf-8")
MyUtil.DBPort = cf1.get("main", "DBPort").decode('gbk').encode("utf-8")
LOG = os.path.join(agentpath,agentlogfile)
#创建日志实例
log = MyUtil.CLogInfo(LOG)
cf = ConfigParser.ConfigParser()
cf.read(MyUtil.cur_file_dir()+"\\auto.ini")
#强制读取配置文件中的IP地址设置,当前的问题是第一次必须手工更改配置文件中的IP,否则传出的IP错误
innerIP = cf.get("Configuration", "localip").decode('gbk').encode("utf-8")
try:
CPUCores = cf.get("Configuration","cpucores").decode('gbk').encode("utf-8")
CPUCores = int(CPUCores)
except:
CPUCores = int('1')
rc = runCron()
rc.run()
except:
#print "main Error:"+str(sys.exc_info()[0])+str(sys.exc_info()[1])
pass
示例2: start
# 需要导入模块: import MyUtil [as 别名]
# 或者: from MyUtil import _secret [as 别名]
def start():
try:
global fm,_3ds
_3ds = MyUtil._secret()
fm = {"startAgent":startAgent,"insertServer":insertServer,"insertProLog":insertProLog,"ServerMonitorInfo":ServerMonitorInfo,"agentHeart":agentHeart,"processRestart":processRestart,"NotRUNProess":NotRUNProess}
cf = ConfigParser.ConfigParser()
cf.read("MonitorDB.ini")
DBUtil.DBHost = cf.get("main", "DBHost")
DBUtil.DBPort=cf.get("main", "DBPort")
DBUtil.DBUser=cf.get("main", "DBUser")
DBUtil.DBPwd=cf.get("main", "DBPwd")
serverIP=cf.get("main", "serverip")
serverPORT=cf.get("main", "serverport")
print u"数据库服务启动"
print version.__doc__,MyUtil.version.__doc__,DBUtil.version.__doc__
print u"DataManagerServerIP %s PORT:%s"%(serverIP,serverPORT)
srv = SocketServer.ThreadingTCPServer((serverIP,int(serverPORT)), DataManager)
srv.serve_forever()
except:
print "start Error:"+str(sys.exc_info()[0])+str(sys.exc_info()[1])
示例3: str
# 需要导入模块: import MyUtil [as 别名]
# 或者: from MyUtil import _secret [as 别名]
except:
print "writeLog Error:" + str(sys.exc_info()[0]) + str(sys.exc_info()[1])
pass
def setLocalIP():
#强写本地IP地址到配置文件中去
cf1 = ConfigParser.ConfigParser()
cf1.read(MyUtil.cur_file_dir() + "\\auto.ini")
ipMac = ServerInfo.GetinnerIPMac()
innerIP = str(ipMac[0])
cf1.set("Configuration", "localIP", innerIP)
cf1.write(open(MyUtil.cur_file_dir() + "\\auto.ini", "w"))
if __name__ == '__main__':
global computerId, fm, sockSize, _3ds
_3ds = MyUtil._secret()
sockSize = 64000
computerId = MyUtil.getComputerId()
setLocalIP()
fm = {
"downloads":AgentUpdateClient.downloads,
"updateself":AgentUpdateClient.updateSelf,
"cronlist":cronlist,
"agentlist":isOnLine,
"command":command,
"version":version,
"password":Cpassword,
"cronadd":cronAdd,
"cronremove":cronRemove,
"unzip":MyUnZIP
}