def getSMServer(): addr = smlib.getConfigStr(SMPROFILE, 'setup', 'ServerIp', '127.0.0.1') port = smlib.getConfigInt(SMPROFILE, 'setup', 'Port', 8801) return (addr, port)
def getServer(): addr = smlib.getConfigStr(WMPROFILE, 'NET', 'SERVER', '127.0.0.1') port = smlib.getConfigInt(WMPROFILE, 'NET', 'PORT', 9010) return (addr, port)
file = string.strip(file) if not os.path.exists(file) or not os.path.isfile(file): print '%s is directory or does not exist.\r\n' % file return try: fd = open(file, 'r') except IOError, err: print err print return head, tail = os.path.splitext(file) logfile = head + '.err' domain = smlib.getConfigStr(WMPROFILE, 'domain', 'domain', 'zj165.com') mail_clnt = connectServer() if not isinstance(mail_clnt, srpc.SRPCClient): fd.close() print "Can't connect to mail server!\r\n" return sms_clnt = connectSMServer() if not isinstance(sms_clnt, srpc.SRPCClient): fd.close() mail_clnt.Close() print "Can't connect to sms server!\r\n" return ok = 0
def getSMServer(): addr=smlib.getConfigStr(SMPROFILE,'setup','ServerIp','127.0.0.1') port=smlib.getConfigInt(SMPROFILE,'setup','Port',8801) return (addr,port)
def getServer(): addr=smlib.getConfigStr(WMPROFILE,'NET','SERVER','127.0.0.1') port=smlib.getConfigInt(WMPROFILE,'NET', 'PORT',9010) return (addr,port)
file=string.strip(file) if not os.path.exists( file) or not os.path.isfile( file): print '%s is directory or does not exist.\r\n' % file return try: fd=open(file,'r') except IOError, err: print err print return head,tail=os.path.splitext(file) logfile=head+'.err' domain=smlib.getConfigStr(WMPROFILE,'domain','domain','zj165.com') mail_clnt=connectServer() if not isinstance(mail_clnt,srpc.SRPCClient): fd.close() print "Can't connect to mail server!\r\n" return sms_clnt=connectSMServer() if not isinstance(sms_clnt,srpc.SRPCClient): fd.close() mail_clnt.Close() print "Can't connect to sms server!\r\n" return