def home():
if not session.get('logged_in'):
return render_template('login.html')
else:
sys_data = {"current_time": '',"machine_name": ''}
mycroft_skills = ""
try:
sys_data['current_time'] = subprocess.check_output(['date'], shell=True)
sys_data['machine_name'] = platform.node()
sys_data['mycroft_version'] = subprocess.check_output(['dpkg -s mycroft-core | grep Version'], shell=True)
mycroft_skills = sorted(os.listdir('/opt/mycroft/skills'))
sys_data['skills_log'] = subprocess.check_output(['tail -n 10 /var/log/mycroft-skills.log'], shell=True)
print(type(sys_data['skills_log']))
disk_usage_info = disk_usage_list()
except Exception as ex:
print(ex)
finally:
return render_template("index.html", title='Mark 1 - System Information',
sys_data = sys_data,
name=login['username'], mycroft_skills=mycroft_skills)
评论列表
文章目录