app.py 文件源码

python
阅读 25 收藏 0 点赞 0 评论 0

项目:mark1-gui 作者: Geeked-Out-Solutions 项目源码 文件源码
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)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号