def delLastText(self, fileName):
"""
删除指定文件最后一行
"""
self.cmd('cd /var/www/html/http/')
self.cmd('pwd')
self.cmd("sed -i '$d' %s" % fileName)
result = self.cmd('cat %s' % fileName)
return result
def addLastText(self, fileName, text):
"""
给某个文件添加内容
"""
self.cmd('cd /var/www/html/http/')
self.cmd('pwd')
self.cmd("echo '%s' >> %s" % (text, fileName))
result = self.cmd('cat %s' % fileName)
return result