• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Python public.returnMsg函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中public.returnMsg函数的典型用法代码示例。如果您正苦于以下问题:Python returnMsg函数的具体用法?Python returnMsg怎么用?Python returnMsg使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了returnMsg函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: ResDatabasePassword

 def ResDatabasePassword(self,get):
     try:
         newpassword = get['password']
         username = get['username']
         id = get['id']
         name = public.M('databases').where('id=?',(id,)).getField('name');
         rep = "^[\w#@%\.]+$"
         if len(re.search(rep, newpassword).groups()) > 0: return public.returnMsg(False, 'DATABASE_NAME_ERR_T')
         
         #修改MYSQL
         if '5.7' in public.readFile(web.ctx.session.setupPath + '/mysql/version.pl'):
             result = panelMysql.panelMysql().execute("update mysql.user set authentication_string=password('" + newpassword + "') where User='" + username + "'")
         else:
             result = panelMysql.panelMysql().execute("update mysql.user set Password=password('" + newpassword + "') where User='" + username + "'")
         
         isError=self.IsSqlError(result)
         if  isError != None: return isError
         panelMysql.panelMysql().execute("flush privileges")
         #if result==False: return public.returnMsg(False,'DATABASE_PASS_ERR_NOT_EXISTS')
         #修改SQLITE
         if int(id) > 0:
             public.M('databases').where("id=?",(id,)).setField('password',newpassword)
         else:
             public.M('config').where("id=?",(id,)).setField('mysql_root',newpassword)
             web.ctx.session.config['mysql_root'] = newpassword
         
         public.WriteLog("TYPE_DATABASE",'DATABASE_PASS_SUCCESS',(name,))
         return public.returnMsg(True,'DATABASE_PASS_SUCCESS',(name,))
     except Exception,ex:
         public.WriteLog("TYPE_DATABASE", 'DATABASE_PASS_ERROR',(name,str(ex)))
         return public.returnMsg(False,'DATABASE_PASS_ERROR',(name,))
开发者ID:soitun,项目名称:BaoTa-Panel,代码行数:31,代码来源:database.py


示例2: AddCrontab

 def AddCrontab(self,get):
     if len(get['name'])<1:
          return public.returnMsg(False,'CRONTAB_TASKNAME_EMPTY')
     cuonConfig=""
     if get['type']=="day":
         cuonConfig = self.GetDay(get)
         name = public.getMsg('CRONTAB_TODAY')
     elif get['type']=="day-n":
         cuonConfig = self.GetDay_N(get)
         name = public.getMsg('CRONTAB_N_TODAY',(get['where1'],))
     elif get['type']=="hour":
         cuonConfig = self.GetHour(get)
         name = public.getMsg('CRONTAB_HOUR')
     elif get['type']=="hour-n":
         cuonConfig = self.GetHour_N(get)
         name = public.getMsg('CRONTAB_HOUR')
     elif get['type']=="minute-n":
         cuonConfig = self.Minute_N(get)
     elif get['type']=="week":
         get['where1']=get['week']
         cuonConfig = self.Week(get)
     elif get['type']=="month":
         cuonConfig = self.Month(get)
     cronPath=web.ctx.session.setupPath+'/cron'
     cronName=self.GetShell(get)
     if type(cronName) == dict: return cronName;
     cuonConfig += ' ' + cronPath+'/'+cronName+' >> '+ cronPath+'/'+cronName+'.log 2>&1'
     self.WriteShell(cuonConfig)
     self.CrondReload()
     addData=public.M('crontab').add('name,type,where1,where_hour,where_minute,echo,addtime',(get['name'],get['type'],get['where1'],get['hour'],get['minute'],cronName,time.strftime('%Y-%m-%d %X',time.localtime())))
     if addData>0:
          return public.returnMsg(True,'ADD_SUCCESS')
     return public.returnMsg(False,'ADD_ERROR')
开发者ID:soitun,项目名称:BaoTa-Panel,代码行数:33,代码来源:crontab.py


示例3: SetDataDir

 def SetDataDir(self,get):
     if get.datadir[-1] == '/': get.datadir = get.datadir[0:-1];
     if os.path.exists(get.datadir): os.system('mkdir -p ' + get.datadir);
     mysqlInfo = self.GetMySQLInfo(get);
     if mysqlInfo['datadir'] == get.datadir: return public.returnMsg(False,'DATABASE_MOVE_RE');
     
     os.system('/etc/init.d/mysqld stop');
     os.system('\cp -a -r ' + mysqlInfo['datadir'] + '/* ' + get.datadir + '/');
     os.system('chown -R mysql.mysql ' + get.datadir);
     os.system('chmod -R 755 ' + get.datadir);
     os.system('rm -f ' + get.datadir + '/*.pid');
     os.system('rm -f ' + get.datadir + '/*.err');
     
     public.CheckMyCnf();
     myfile = '/etc/my.cnf';
     mycnf = public.readFile(myfile);
     public.writeFile('/etc/my_backup.cnf',mycnf);
     mycnf = mycnf.replace(mysqlInfo['datadir'],get.datadir);
     public.writeFile(myfile,mycnf);
     os.system('/etc/init.d/mysqld start');
     result = public.ExecShell('/etc/init.d/mysqld status');
     if result[0].find('SUCCESS') != -1:
         public.writeFile('data/datadir.pl',get.datadir);
         return public.returnMsg(True,'DATABASE_MOVE_SUCCESS');
     else:
         os.system('pkill -9 mysqld');
         public.writeFile(myfile,public.readFile('/etc/my_backup.cnf'));
         os.system('/etc/init.d/mysqld start');
         return public.returnMsg(False,'DATABASE_MOVE_ERR');
开发者ID:soitun,项目名称:BaoTa-Panel,代码行数:29,代码来源:database.py


示例4: GetSSLInfo

 def GetSSLInfo(self,get):
     self.__PDATA['data']['partnerOrderId'] = get.partnerOrderId;
     self.__PDATA['data'] = self.De_Code(self.__PDATA['data']);
     result = json.loads(public.httpPost(self.__APIURL + '/GetSSLInfo',self.__PDATA));
     result['data'] = self.En_Code(result['data']);
     
     #写配置到站点
     if hasattr(get,'siteName'):
         try:
             siteName = get.siteName;
             path =   '/etc/letsencrypt/live/'+ siteName;
             if not os.path.exists(path):
                 public.ExecShell('mkdir -p ' + path)
             csrpath = path+"/fullchain.pem";
             keypath = path+"/privkey.pem";
             pidpath = path+"/partnerOrderId";
             #清理旧的证书链
             public.ExecShell('rm -f ' + keypath)
             public.ExecShell('rm -f ' + csrpath)
             public.ExecShell('rm -rf ' + path + '-00*')
             public.ExecShell('rm -rf /etc/letsencrypt/archive/' + get.siteName)
             public.ExecShell('rm -rf /etc/letsencrypt/archive/' + get.siteName + '-00*')
             public.ExecShell('rm -f /etc/letsencrypt/renewal/'+ get.siteName + '.conf')
             public.ExecShell('rm -f /etc/letsencrypt/renewal/'+ get.siteName + '-00*.conf')
             public.ExecShell('rm -f ' + path + '/README');
             
             public.writeFile(keypath,result['data']['privateKey']);
             public.writeFile(csrpath,result['data']['cert']+result['data']['certCa']);
             public.writeFile(pidpath,get.partnerOrderId);
             import panelSite
             panelSite.panelSite().SetSSLConf(get);
             public.serviceReload();
             return public.returnMsg(True,'SET_SUCCESS');
         except Exception,ex:
             return public.returnMsg(False,'SET_ERROR,' + str(ex));
开发者ID:soitun,项目名称:BaoTa-Panel,代码行数:35,代码来源:panelSSL.py


示例5: DelCrontab

 def DelCrontab(self,get):
     try:
         id = get['id']
         find = public.M('crontab').where("id=?",(id,)).field('name,echo').find()
         x = web.ctx.session.server_os['x'];
         if x == 'RHEL':
             file='/var/spool/cron/root'
         else:
             file='/var/spool/cron/crontabs/root'
         conf=public.readFile(file)
         rep = ".+" + str(find['echo']) + ".+\n"
         conf = re.sub(rep, "", conf)
         cronPath = web.ctx.session.setupPath + '/cron'
         public.writeFile(file,conf)
         
         sfile = cronPath + '/' + find['echo']
         if os.path.exists(sfile): os.remove(sfile)
         sfile = cronPath + '/' + find['echo'] + '.log'
         if os.path.exists(sfile): os.remove(sfile)
         
         self.CrondReload()
         public.M('crontab').where("id=?",(id,)).delete()
         public.WriteLog('TYPE_CRON', 'CRONTAB_DEL',(find['name'],))
         return public.returnMsg(True, 'DEL_SUCCESS')
     except:
         return public.returnMsg(False, 'DEL_ERROR')
开发者ID:soitun,项目名称:BaoTa-Panel,代码行数:26,代码来源:crontab.py


示例6: DeleteDatabase

 def DeleteDatabase(self,get):
     try:
         id=get['id']
         name = get['name']
         if os.path.exists('data/recycle_bin_db.pl'): return self.DeleteToRecycleBin(name);
         
         find = public.M('databases').where("id=?",(id,)).field('id,pid,name,username,password,accept,ps,addtime').find();
         accept = find['accept'];
         username = find['username'];
         #删除MYSQL
         result = panelMysql.panelMysql().execute("drop database `" + name + "`")
         isError=self.IsSqlError(result)
         if  isError != None: return isError
         users = panelMysql.panelMysql().query("select Host from mysql.user where User='" + username + "' AND Host!='localhost'")
         panelMysql.panelMysql().execute("drop user '" + username + "'@'localhost'")
         for us in users:
             panelMysql.panelMysql().execute("drop user '" + username + "'@'" + us[0] + "'")
         panelMysql.panelMysql().execute("flush privileges")
         #删除SQLITE
         public.M('databases').where("id=?",(id,)).delete()
         public.WriteLog("TYPE_DATABASE", 'DATABASE_DEL_SUCCESS',(name,))
         return public.returnMsg(True, 'DEL_SUCCESS')
     except Exception,ex:
         public.WriteLog("TYPE_DATABASE",'DATABASE_DEL_ERR',(get.name , str(ex)))
         return public.returnMsg(False,'DEL_ERROR')
开发者ID:soitun,项目名称:BaoTa-Panel,代码行数:25,代码来源:database.py


示例7: GetLogs

 def GetLogs(self,get):
     id = get['id']
     echo = public.M('crontab').where("id=?",(id,)).field('echo').find()
     logFile = web.ctx.session.setupPath+'/cron/'+echo['echo']+'.log'
     if not os.path.exists(logFile):return public.returnMsg(False, 'CRONTAB_TASKLOG_EMPTY')
     log = public.GetNumLines(logFile,2000)
     f = open(logFile,'r')
     tmp = f.readline()
     n=0;
     while tmp:
         n += 1;
         tmp = f.readline();
     f.close();
     if n > 2000: public.writeFile(logFile,log)
     
     where = "Warning: Using a password on the command line interface can be insecure.\n"
     if  log.find(where)>-1:
         log = log.replace(where, '')
         public.writeFile('/tmp/read.tmp',log)
     
     import chardet;
     char=chardet.detect(log);
     encodeing = char['encoding'];
     if char['encoding'] == 'GB2312': encodeing = 'GBK';
     if char['encoding'] == 'ascii': encodeing = 'utf-8';
     log = log.decode(encodeing).encode('utf-8');
     return public.returnMsg(True, log);
开发者ID:soitun,项目名称:BaoTa-Panel,代码行数:27,代码来源:crontab.py


示例8: BinLog

 def BinLog(self,get):
     myfile = '/etc/my.cnf';
     mycnf = public.readFile(myfile);
     if mycnf.find('#log-bin=mysql-bin') != -1:
         if hasattr(get,'status'): return public.returnMsg(False,'0');
         mycnf = mycnf.replace('#log-bin=mysql-bin','log-bin=mysql-bin')
         mycnf = mycnf.replace('#binlog_format=mixed','binlog_format=mixed')
         os.system('sync')
         os.system('/etc/init.d/mysqld restart');
     else:
         path = self.GetMySQLInfo(get)['datadir'];
         if hasattr(get,'status'): 
             dsize = 0;
             for n in os.listdir(path):
                 if len(n) < 9: continue;
                 if n[0:9] == 'mysql-bin':
                     dsize += os.path.getsize(path + '/' + n);
             return public.returnMsg(True,dsize);
         
         mycnf = mycnf.replace('log-bin=mysql-bin','#log-bin=mysql-bin')
         mycnf = mycnf.replace('binlog_format=mixed','#binlog_format=mixed')
         os.system('sync')
         os.system('/etc/init.d/mysqld restart');
         os.system('rm -f ' + path + '/mysql-bin.*')
     
     public.writeFile(myfile,mycnf);
     return public.returnMsg(True,'SUCCESS');
开发者ID:soitun,项目名称:BaoTa-Panel,代码行数:27,代码来源:database.py


示例9: AddUser

 def AddUser(self,get):
     try:
         import files,time
         fileObj=files.files()
         if re.search("\W + ",get['ftp_username']): return {'status':False,'code':501,'msg':public.getMsg('FTP_USERNAME_ERR_T')}
         if len(get['ftp_username']) < 3: return {'status':False,'code':501,'msg':public.getMsg('FTP_USERNAME_ERR_LEN')}
         if not fileObj.CheckDir(get['path']): return {'status':False,'code':501,'msg':public.getMsg('FTP_USERNAME_ERR_DIR')}
         if public.M('ftps').where('name=?',(get.ftp_username.strip(),)).count(): return public.returnMsg(False,'FTP_USERNAME_ERR_EXISTS',(get.ftp_username,))
         username = get['ftp_username'].replace(' ','')
         password = get['ftp_password']
         get.path = get['path'].replace(' ','')
         get.path = get.path.replace("\\", "/")
         fileObj.CreateDir(get)
         os.system('chown www.www ' + get.path)
         public.ExecShell(self.__runPath + '/pure-pw useradd ' + username + ' -u www -d ' + get.path + '<<EOF \n' + password + '\n' + password + '\nEOF')
         self.FtpReload()
         ps=get['ps']
         if get['ps']=='': ps= public.getMsg('INPUT_PS');
         addtime=time.strftime('%Y-%m-%d %X',time.localtime())
         
         pid = 0
         if hasattr(get,'pid'): pid = get.pid
         public.M('ftps').add('pid,name,password,path,status,ps,addtime',(pid,username,password,get.path,1,ps,addtime))
         public.WriteLog('TYPE_FTP', 'FTP_ADD_SUCCESS',(username,))
         return public.returnMsg(True,'ADD_SUCCESS')
     except Exception,ex:
         public.WriteLog('TYPE_FTP', 'FTP_ADD_ERR',(username,str(ex)))
         return public.returnMsg(False,'ADD_ERROR')
开发者ID:soitun,项目名称:BaoTa-Panel,代码行数:28,代码来源:ftp.py


示例10: setPassword

 def setPassword(self,get):
     #return public.returnMsg(False,'体验服务器,禁止修改!')
     if get.password1 != get.password2: return public.returnMsg(False,'USER_PASSWORD_CHECK')
     if len(get.password1) < 5: return public.returnMsg(False,'USER_PASSWORD_LEN')
     public.M('users').where("username=?",(web.ctx.session.username,)).setField('password',public.md5(get.password1.strip()))
     public.WriteLog('TYPE_PANEL','USER_PASSWORD_SUCCESS',(web.ctx.session.username,))
     return public.returnMsg(True,'USER_PASSWORD_SUCCESS')
开发者ID:soitun,项目名称:BaoTa-Panel,代码行数:7,代码来源:config.py


示例11: AddPackage

 def AddPackage(self,get):
     jsonFile = self.__setupPath + '/list.json';
     if not os.path.exists(jsonFile): return public.returnMsg(False,'配置文件不存在!');
     
     data = {}
     data = json.loads(public.readFile(jsonFile));
     for d in data:
         if d['name'] == get.dname: return public.returnMsg(False,'您要添加的程序标识已存在!');
         if d['title'] == get.title: return public.returnMsg(False,'您要添加的程序名称已存在!');
     
     if hasattr(get,'rewrite'): get.rewrite = True;
     
     pinfo = {}
     pinfo['name'] = get.dname;
     pinfo['title'] = get.title;
     pinfo['version'] = get.version;
     pinfo['md5'] = get.md5;
     pinfo['rewrite'] = get.rewrite;
     pinfo['php'] = get.php;
     pinfo['ps'] = get.ps;
     pinfo['shell'] = get.shell;
     pinfo['download'] = get.download;
     data.append(pinfo);
     public.writeFile(jsonFile,json.dumps(data));
     return public.returnMsg(True,'添加成功!');
开发者ID:soitun,项目名称:BaoTa-Panel,代码行数:25,代码来源:deployment_main.py


示例12: setPHPMaxSize

 def setPHPMaxSize(self,get):
     version = get.version
     max = get.max
     
     if int(max) < 2: return public.returnMsg(False,'PHP_UPLOAD_MAX_ERR')
     
     #设置PHP
     path = web.ctx.session.setupPath+'/php/'+version+'/etc/php.ini'
     conf = public.readFile(path)
     rep = u"\nupload_max_filesize\s*=\s*[0-9]+M"
     conf = re.sub(rep,u'\nupload_max_filesize = '+max+'M',conf)
     rep = u"\npost_max_size\s*=\s*[0-9]+M"
     conf = re.sub(rep,u'\npost_max_size = '+max+'M',conf)
     public.writeFile(path,conf)
     
     if public.get_webserver() == 'nginx':
         #设置Nginx
         path = web.ctx.session.setupPath+'/nginx/conf/nginx.conf'
         conf = public.readFile(path)
         rep = "client_max_body_size\s+([0-9]+)m"
         tmp = re.search(rep,conf).groups()
         if int(tmp[0]) < int(max):
             conf = re.sub(rep,'client_max_body_size '+max+'m',conf)
             public.writeFile(path,conf)
         
     public.serviceReload()
     public.phpReload(version);
     public.WriteLog("TYPE_PHP", "PHP_UPLOAD_MAX",(version,max))
     return public.returnMsg(True,'SET_SUCCESS')
开发者ID:soitun,项目名称:BaoTa-Panel,代码行数:29,代码来源:config.py


示例13: SetSshPort

 def SetSshPort(self,get):
     #return public.returnMsg(False,'演示服务器,禁止此操作!');
     port = get.port
     if int(port) < 22 or int(port) > 65535: return public.returnMsg(False,'FIREWALL_SSH_PORT_ERR');
     ports = ['21','25','80','443','8080','888','8888'];
     if port in ports: return public.returnMsg(False,'');
     
     file = '/etc/ssh/sshd_config'
     conf = public.readFile(file)
     
     rep = "#*Port\s+([0-9]+)\s*\n"
     conf = re.sub(rep, "Port "+port+"\n", conf)
     public.writeFile(file,conf)
     
     if self.__isFirewalld:
         self.__Obj.AddAcceptPort(port);
         public.ExecShell('setenforce 0');
         public.ExecShell('sed -i "s#SELINUX=enforcing#SELINUX=disabled#" /etc/selinux/config');
         public.ExecShell("systemctl restart sshd.service")
     elif self.__isUfw:
         public.ExecShell('ufw allow ' + port + '/tcp');
         public.ExecShell("service ssh restart")
     else:
         public.ExecShell('iptables -I INPUT -p tcp -m state --state NEW -m tcp --dport '+port+' -j ACCEPT')
         public.ExecShell("/etc/init.d/sshd restart")
     
     self.FirewallReload()
     public.M('firewall').where("ps=?",('SSH远程管理服务',)).setField('port',port)
     public.WriteLog("TYPE_FIREWALL", "FIREWALL_SSH_PORT",(port,))
     return public.returnMsg(True,'EDIT_SUCCESS') 
开发者ID:soitun,项目名称:BaoTa-Panel,代码行数:30,代码来源:firewalls.py


示例14: GetTaskSpeed

 def GetTaskSpeed(self,get):
     tempFile = '/tmp/panelExec.log'
     freshFile = '/tmp/panelFresh'
     import db
     find = db.Sql().table('tasks').where('status=? OR status=?',('-1','0')).field('id,type,name,execstr').find()
     if not len(find): return public.returnMsg(False,'当前没有任务队列在执行-2!')
     isTask = '/tmp/panelTask.pl'
     public.writeFile(isTask,'True');
     echoMsg = {}
     echoMsg['name'] = find['name']
     echoMsg['execstr'] = find['execstr']
     if find['type'] == 'download':
         import json
         try:
             tmp = public.readFile(tempFile)
             if len(tmp) < 10:
                 return public.returnMsg(False,'当前没有任务队列在执行-3!')
             echoMsg['msg'] = json.loads(tmp)
             echoMsg['isDownload'] = True
         except:
             db.Sql().table('tasks').where("id=?",(find['id'],)).save('status',('0',))
             return public.returnMsg(False,'当前没有任务队列在执行-4!')
     else:
         echoMsg['msg'] = self.GetLastLine(tempFile,20)
         echoMsg['isDownload'] = False
     
     echoMsg['task'] = public.M('tasks').where("status!=?",('1',)).field('id,status,name,type').order("id asc").select()
     return echoMsg
开发者ID:soitun,项目名称:BaoTa-Panel,代码行数:28,代码来源:files.py


示例15: BatchPaste

 def BatchPaste(self,get):
     import shutil,web
     get.path = get.path.encode('utf-8');
     if not self.CheckDir(get.path): return public.returnMsg(False,'FILE_DANGER');
     i = 0;
     l = len(web.ctx.session.selected.data);
     if get.type == '1':
         for key in web.ctx.session.selected.data:
             i += 1
             public.writeSpeed(key,i,l);
             try:
                 sfile = web.ctx.session.selected.path + '/' + key.encode('utf-8')
                 dfile = get.path + '/' + key.encode('utf-8')
                 if os.path.isdir(sfile):
                     shutil.copytree(sfile,dfile)
                 else:
                     shutil.copyfile(sfile,dfile)
             except:
                 continue;
         public.WriteLog('TYPE_FILE','FILE_ALL_COPY',(web.ctx.session.selected.path,get.path))
     else:
         for key in web.ctx.session.selected.data:
             try:
                 i += 1
                 public.writeSpeed(key,i,l);
                 sfile = web.ctx.session.selected.path + '/' + key.encode('utf-8')
                 dfile = get.path + '/' + key.encode('utf-8')
                 shutil.move(sfile,dfile)
             except:
                 continue;
         public.WriteLog('TYPE_FILE','FILE_ALL_MOTE',(web.ctx.session.selected.path,get.path))
     public.writeSpeed(None,0,0);
     errorCount = len(web.ctx.session.selected.data) - i
     del(web.ctx.session.selected)
     return public.returnMsg(True,'FILE_ALL',(str(i),str(errorCount)));
开发者ID:soitun,项目名称:BaoTa-Panel,代码行数:35,代码来源:files.py


示例16: GetFileBody

 def GetFileBody(self,get) :
     get.path = get.path.encode('utf-8');
     if not os.path.exists(get.path):
         if get.path.find('rewrite') == -1:
             return public.returnMsg(False,'FILE_NOT_EXISTS')
         public.writeFile(get.path,'');
     try:
         if os.path.getsize(get.path) > 2097152: return public.returnMsg(False,'不能在线编辑大于2MB的文件!');
         srcBody = public.readFile(get.path)
         
         data = {}
         if srcBody:
             import chardet
             char=chardet.detect(srcBody)
             data['encoding'] = char['encoding']
             if char['encoding'] == 'GB2312': data['encoding'] = 'GBK';
             if char['encoding'] == 'ascii': data['encoding'] = 'utf-8'
             data['data'] = srcBody.decode(data['encoding']).encode('utf-8')
         else:
             data['data'] = srcBody
             data['encoding'] = 'utf-8'
         
         data['status'] = True
         return data
     except Exception,ex:
         return public.returnMsg(False,'FILE_GET_ERR' + str(ex))
开发者ID:soitun,项目名称:BaoTa-Panel,代码行数:26,代码来源:files.py


示例17: IsSqlError

 def IsSqlError(self,mysqlMsg):
     mysqlMsg=str(mysqlMsg)
     if "MySQLdb" in mysqlMsg: return public.returnMsg(False,'DATABASE_ERR_MYSQLDB')
     if "2002," in mysqlMsg: return public.returnMsg(False,'DATABASE_ERR_CONNECT')
     if "using password:" in mysqlMsg: return public.returnMsg(False,'DATABASE_ERR_PASS')
     if "Connection refused" in mysqlMsg: return public.returnMsg(False,'DATABASE_ERR_CONNECT')
     if "1133" in mysqlMsg: return public.returnMsg(False,'DATABASE_ERR_NOT_EXISTS')
     return None
开发者ID:soitun,项目名称:BaoTa-Panel,代码行数:8,代码来源:database.py


示例18: GetFpmSlowLogs

 def GetFpmSlowLogs(self,get):
     path = '/www/server/php/' + get.version + '/var/log/slow.log';
     if not os.path.exists(path): return public.returnMsg(False,'日志文件不存在!');
     return public.returnMsg(True,public.GetNumLines(path,1000));
 
     
     
     
开发者ID:soitun,项目名称:BaoTa-Panel,代码行数:4,代码来源:ajax.py


示例19: setUsername

 def setUsername(self,get):
     #return public.returnMsg(False,'体验服务器,禁止修改!')
     if get.username1 != get.username2: return public.returnMsg(False,'USER_USERNAME_CHECK')
     if len(get.username1) < 3: return public.returnMsg(False,'USER_USERNAME_LEN')
     public.M('users').where("username=?",(web.ctx.session.username,)).setField('username',get.username1.strip())
     public.WriteLog('TYPE_PANEL','USER_USERNAME_SUCCESS',(web.ctx.session.username,get.username2))
     web.ctx.session.username = get.username1
     return public.returnMsg(True,'USER_USERNAME_SUCCESS')
开发者ID:soitun,项目名称:BaoTa-Panel,代码行数:8,代码来源:config.py


示例20: remove_ssh_limit

 def remove_ssh_limit(self,get):
     ip = get.ip;
     if not ip in self.get_ssh_limit(): return public.returnMsg(True,'指定白名单不存在!');
     allowConf = public.readFile(self.__ALLOW).strip();
     while allowConf[-1:] == "\n" or allowConf[-1:] == " ": allowConf = allowConf[:-1];
     allowConf = re.sub("\nsshd:"+ip+":allow\n?","\n",allowConf);
     public.writeFile(self.__ALLOW,allowConf+"\n");
     return public.returnMsg(True,'删除成功!');
开发者ID:soitun,项目名称:BaoTa-Panel,代码行数:8,代码来源:safelogin_main.py



注:本文中的public.returnMsg函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python public.success_result_http函数代码示例发布时间:2022-05-25
下一篇:
Python public.readFile函数代码示例发布时间:2022-05-25
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap