def install(self,DB):
import stat
self.backup_db(DB)
'''output=Popen(['gksudo','rmdir','/var/21'],stdout=PIPE,stderr=PIPE)
output = p.stdout.read()
print output
'''
#print subprocess.check_call('cd /tmp/smart_school', shell=True)# IF OUT PUT 0 success, if 1, fail, 3 password error
#print subprocess.call('gksu chmod +x /tmp/smart_school/install.sh',shell=True,stderr=subprocess.STDOUT)# IF OUT PUT 0 success, if 1, fail, 3 password error
os.chmod('/tmp/smart_school/install.sh', stat.S_IEXEC)
output=subprocess.call('cd /tmp/smart_school\ngksu ./install.sh',shell=True)#,stderr=subprocess.STDOUT)# IF OUT PUT 0 success, if 1, fail, 3 password error
return output # success if out put is 0
评论列表
文章目录